Commit ccb27264 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Misc. resize fixes along with the resize test

Re-enables most of the previously disabled tests.
The ones that are still disabled expect resize to be triggered
through rate control, which is no longer supported in Av1.

Change-Id: Ie5e9ba3eb0843cd44ff1ac988500081470ba0fe2
parent 593d02c8
......@@ -91,6 +91,7 @@ static void free_seg_map(AV1_COMMON *cm) {
if (!cm->frame_parallel_decode) {
cm->last_frame_seg_map = NULL;
}
cm->seg_map_alloc_size = 0;
}
void av1_free_ref_frame_buffers(BufferPool *pool) {
......@@ -155,6 +156,7 @@ void av1_free_context_buffers(AV1_COMMON *cm) {
}
aom_free(cm->above_seg_context);
cm->above_seg_context = NULL;
cm->above_context_alloc_cols = 0;
#if CONFIG_VAR_TX
aom_free(cm->above_txfm_context);
cm->above_txfm_context = NULL;
......
......@@ -397,6 +397,7 @@ static void cyclic_refresh_update_map(AV1_COMP *const cpi) {
// Set the segmentation map: cycle through the superblocks, starting at
// cr->mb_index, and stopping when either block_count blocks have been found
// to be refreshed, or we have passed through whole frame.
if (cr->sb_index >= sbs_in_frame) cr->sb_index = 0;
assert(cr->sb_index < sbs_in_frame);
i = cr->sb_index;
cr->target_num_seg_blocks = 0;
......
This diff is collapsed.
......@@ -571,6 +571,13 @@ typedef struct AV1_COMP {
// number of MBs in the current frame when the frame is
// scaled.
// When resize is triggered through external control, the desired width/height
// are stored here until use in the next frame coded. They are effective only
// for
// one frame and are reset after use.
int resize_pending_width;
int resize_pending_height;
int frame_flags;
search_site_config ss_cfg;
......
......@@ -50,7 +50,8 @@ typedef enum {
#endif // CONFIG_EXT_REFS
typedef struct {
uint8_t resize_num;
int resize_width;
int resize_height;
#if CONFIG_FRAME_SUPERRES
uint8_t superres_num;
#endif // CONFIG_FRAME_SUPERRES
......
......@@ -351,11 +351,11 @@ class ResizeInternalTest : public ResizeTest {
encoder->Config(&cfg_);
}
} else {
if (video->frame() == kStepDownFrame) {
if (video->frame() >= kStepDownFrame && video->frame() < kStepUpFrame) {
struct aom_scaling_mode mode = { AOME_FOURFIVE, AOME_THREEFIVE };
encoder->Control(AOME_SET_SCALEMODE, &mode);
}
if (video->frame() == kStepUpFrame) {
if (video->frame() >= kStepUpFrame) {
struct aom_scaling_mode mode = { AOME_NORMAL, AOME_NORMAL };
encoder->Control(AOME_SET_SCALEMODE, &mode);
}
......@@ -388,7 +388,7 @@ class ResizeInternalTest : public ResizeTest {
#endif
};
TEST_P(ResizeInternalTest, DISABLED_TestInternalResizeWorks) {
TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 10);
init_flags_ = AOM_CODEC_USE_PSNR;
......@@ -404,6 +404,9 @@ TEST_P(ResizeInternalTest, DISABLED_TestInternalResizeWorks) {
cfg_.g_lag_in_frames = 0;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
info != frame_info_list_.end(); ++info) {
}
for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
info != frame_info_list_.end(); ++info) {
const aom_codec_pts_t pts = info->pts;
......@@ -417,7 +420,7 @@ TEST_P(ResizeInternalTest, DISABLED_TestInternalResizeWorks) {
}
}
TEST_P(ResizeInternalTest, DISABLED_TestInternalResizeChangeConfig) {
TEST_P(ResizeInternalTest, TestInternalResizeChangeConfig) {
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 10);
cfg_.g_w = 352;
......@@ -493,7 +496,7 @@ class ResizeRealtimeTest
int mismatch_nframes_;
};
TEST_P(ResizeRealtimeTest, DISABLED_TestExternalResizeWorks) {
TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
ResizingVideoSource video;
video.flag_codec_ = 1;
DefaultConfig();
......@@ -693,15 +696,6 @@ class ResizingCspVideoSource : public ::libaom_test::DummyVideoSource {
}
};
#ifdef DISABLE_TRELLISQ_SEARCH
TEST_P(ResizeCspTest, DISABLED_TestResizeCspWorks) {
ResizingCspVideoSource video;
init_flags_ = AOM_CODEC_USE_PSNR;
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
cfg_.g_lag_in_frames = 0;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
#else
TEST_P(ResizeCspTest, TestResizeCspWorks) {
ResizingCspVideoSource video;
init_flags_ = AOM_CODEC_USE_PSNR;
......@@ -709,7 +703,6 @@ TEST_P(ResizeCspTest, TestResizeCspWorks) {
cfg_.g_lag_in_frames = 0;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
#endif
AV1_INSTANTIATE_TEST_CASE(ResizeTest,
::testing::Values(::libaom_test::kRealTime));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment