Change encoder initialization in unit tests
In some unit tests, the set control is done when video->frame() is 1.
Modified it so that the config initialization was done before encoding
frames.
Change-Id: I698b17b518fec64275f23cec68cf51bd8b60a716
diff --git a/test/active_map_test.cc b/test/active_map_test.cc
index a2b0546..0f8a732 100644
--- a/test/active_map_test.cc
+++ b/test/active_map_test.cc
@@ -37,7 +37,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, cpu_used_);
} else if (video->frame() == 3) {
aom_active_map_t map = aom_active_map_t();
diff --git a/test/aq_segment_test.cc b/test/aq_segment_test.cc
index bbb5027..51557a5 100644
--- a/test/aq_segment_test.cc
+++ b/test/aq_segment_test.cc
@@ -35,7 +35,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, set_cpu_used_);
encoder->Control(AV1E_SET_AQ_MODE, aq_mode_);
encoder->Control(AV1E_SET_DELTAQ_MODE, deltaq_mode_);
diff --git a/test/av1_encoder_parms_get_to_decoder.cc b/test/av1_encoder_parms_get_to_decoder.cc
index e8470e5..ef8ccdb 100644
--- a/test/av1_encoder_parms_get_to_decoder.cc
+++ b/test/av1_encoder_parms_get_to_decoder.cc
@@ -95,7 +95,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AV1E_SET_COLOR_PRIMARIES, encode_parms.color_primaries);
encoder->Control(AV1E_SET_TRANSFER_CHARACTERISTICS,
encode_parms.transfer_characteristics);
diff --git a/test/borders_test.cc b/test/borders_test.cc
index 893237e..31eacab 100644
--- a/test/borders_test.cc
+++ b/test/borders_test.cc
@@ -33,7 +33,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, 1);
encoder->Control(AOME_SET_ENABLEAUTOALTREF, 1);
encoder->Control(AOME_SET_ARNR_MAXFRAMES, 7);
diff --git a/test/cpu_speed_test.cc b/test/cpu_speed_test.cc
index 8ea3e69..2a16497 100644
--- a/test/cpu_speed_test.cc
+++ b/test/cpu_speed_test.cc
@@ -46,7 +46,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, set_cpu_used_);
encoder->Control(AV1E_SET_TUNE_CONTENT, tune_content_);
if (encoding_mode_ != ::libaom_test::kRealTime) {
diff --git a/test/decode_multithreaded_test.cc b/test/decode_multithreaded_test.cc
index cea1d14..92253ed 100644
--- a/test/decode_multithreaded_test.cc
+++ b/test/decode_multithreaded_test.cc
@@ -76,7 +76,7 @@
virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AV1E_SET_TILE_COLUMNS, n_tile_cols_);
encoder->Control(AV1E_SET_TILE_ROWS, n_tile_rows_);
encoder->Control(AV1E_SET_NUM_TG, n_tile_groups_);
diff --git a/test/decode_perf_test.cc b/test/decode_perf_test.cc
index bb7b000..2f67342 100644
--- a/test/decode_perf_test.cc
+++ b/test/decode_perf_test.cc
@@ -122,7 +122,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, speed_);
encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
encoder->Control(AV1E_SET_TILE_COLUMNS, 2);
diff --git a/test/end_to_end_test.cc b/test/end_to_end_test.cc
index 1ac0ae9..be70321 100644
--- a/test/end_to_end_test.cc
+++ b/test/end_to_end_test.cc
@@ -120,7 +120,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
encoder->Control(AV1E_SET_TILE_COLUMNS, 4);
encoder->Control(AOME_SET_CPUUSED, cpu_used_);
diff --git a/test/frame_size_tests.cc b/test/frame_size_tests.cc
index eaf0b83..1546012 100644
--- a/test/frame_size_tests.cc
+++ b/test/frame_size_tests.cc
@@ -35,7 +35,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, 7);
encoder->Control(AOME_SET_ENABLEAUTOALTREF, 1);
encoder->Control(AOME_SET_ARNR_MAXFRAMES, 7);
diff --git a/test/horz_superres_test.cc b/test/horz_superres_test.cc
index 973f55b..6d7f2f2 100644
--- a/test/horz_superres_test.cc
+++ b/test/horz_superres_test.cc
@@ -125,7 +125,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
encoder->Control(AV1E_SET_TILE_COLUMNS, 4);
@@ -248,7 +248,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AV1E_SET_FRAME_PARALLEL_DECODING, 1);
encoder->Control(AV1E_SET_TILE_COLUMNS, 0);
diff --git a/test/lossless_test.cc b/test/lossless_test.cc
index 3f8e89c..71ae5e7 100644
--- a/test/lossless_test.cc
+++ b/test/lossless_test.cc
@@ -40,7 +40,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
// Only call Control if quantizer > 0 to verify that using quantizer
// alone will activate lossless
if (cfg_.rc_max_quantizer > 0 || cfg_.rc_min_quantizer > 0) {
diff --git a/test/motion_vector_test.cc b/test/motion_vector_test.cc
index 27eb938..a9b48d9 100644
--- a/test/motion_vector_test.cc
+++ b/test/motion_vector_test.cc
@@ -60,7 +60,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, cpu_used_);
encoder->Control(AV1E_ENABLE_MOTION_VECTOR_UNIT_TEST, mv_test_mode_);
if (encoding_mode_ != ::libaom_test::kRealTime) {
diff --git a/test/qm_test.cc b/test/qm_test.cc
index c87506b..d1dfbb8 100644
--- a/test/qm_test.cc
+++ b/test/qm_test.cc
@@ -33,7 +33,7 @@
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_CPUUSED, set_cpu_used_);
encoder->Control(AV1E_SET_ENABLE_QM, 1);
encoder->Control(AV1E_SET_QM_MIN, qm_min_);
diff --git a/test/superframe_test.cc b/test/superframe_test.cc
index 7be18f7..2cec95a 100644
--- a/test/superframe_test.cc
+++ b/test/superframe_test.cc
@@ -45,7 +45,7 @@
virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AOME_SET_ENABLEAUTOALTREF, 1);
encoder->Control(AOME_SET_CPUUSED, 2);
encoder->Control(AV1E_SET_TILE_COLUMNS, n_tile_cols_);
diff --git a/test/tile_independence_test.cc b/test/tile_independence_test.cc
index cf534c0..4f7c4a4 100644
--- a/test/tile_independence_test.cc
+++ b/test/tile_independence_test.cc
@@ -59,7 +59,7 @@
virtual void PreEncodeFrameHook(libaom_test::VideoSource *video,
libaom_test::Encoder *encoder) {
- if (video->frame() == 1) {
+ if (video->frame() == 0) {
encoder->Control(AV1E_SET_TILE_COLUMNS, n_tile_cols_);
encoder->Control(AV1E_SET_TILE_ROWS, n_tile_rows_);
SetCpuUsed(encoder);