Commit 4e2df09c authored by Fangwen Fu's avatar Fangwen Fu Committed by Yaowu Xu

Set ext_delta_q default and bug fix

* Set ext_delta_q experiment as default
* Update test for ext_delta_q
* Fix a bug (BUG=aomedia:485) in encoder which
  cause decoder and encoder mismatch.

Change-Id: I28ece21c32ff8621f8837ed4807b02eef8c92e29
parent 46443741
......@@ -2453,10 +2453,12 @@ static void encode_b(const AV1_COMP *const cpi, const TileInfo *const tile,
#endif
PICK_MODE_CONTEXT *ctx, int *rate) {
MACROBLOCK *const x = &td->mb;
#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
#if (CONFIG_MOTION_VAR && CONFIG_NCOBMC) | CONFIG_EXT_DELTA_Q
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *mbmi;
#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
int check_ncobmc;
#endif
#endif
set_offsets(cpi, tile, x, mi_row, mi_col, bsize);
......@@ -2481,6 +2483,13 @@ static void encode_b(const AV1_COMP *const cpi, const TileInfo *const tile,
encode_superblock(cpi, td, tp, dry_run, mi_row, mi_col, bsize, ctx, rate);
if (!dry_run) {
#if CONFIG_EXT_DELTA_Q
mbmi = &xd->mi[0]->mbmi;
if (bsize == BLOCK_64X64 && mbmi->skip == 1 && is_inter_block(mbmi) &&
cpi->common.delta_lf_present_flag) {
mbmi->current_delta_lf_from_base = xd->prev_delta_lf_from_base;
}
#endif
#if CONFIG_SUPERTX
update_stats(&cpi->common, td, mi_row, mi_col, 0);
#else
......
......@@ -494,6 +494,7 @@ post_process_cmdline() {
soft_enable dual_filter
soft_enable motion_var
soft_enable warped_motion
soft_enable ext_delta_q
# Backwards/jenkins compatibility with --enable-aom-highbitdepth
enabled aom_highbitdepth && enable_feature highbitdepth
......
......@@ -37,12 +37,18 @@ class AqSegmentTest
if (video->frame() == 1) {
encoder->Control(AOME_SET_CPUUSED, set_cpu_used_);
encoder->Control(AV1E_SET_AQ_MODE, aq_mode_);
#if CONFIG_EXT_DELTA_Q
encoder->Control(AV1E_SET_DELTAQ_MODE, deltaq_mode_);
#endif
encoder->Control(AOME_SET_MAX_INTRA_BITRATE_PCT, 100);
}
}
void DoTest(int aq_mode) {
aq_mode_ = aq_mode;
#if CONFIG_EXT_DELTA_Q
deltaq_mode_ = 0;
#endif
cfg_.kf_max_dist = 12;
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 56;
......@@ -59,6 +65,9 @@ class AqSegmentTest
int set_cpu_used_;
int aq_mode_;
#if CONFIG_EXT_DELTA_Q
int deltaq_mode_;
#endif
};
// Validate that this AQ segmentation mode (AQ=1, variance_ap)
......@@ -81,12 +90,11 @@ TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ2) { DoTest(2); }
TEST_P(AqSegmentTestLarge, TestNoMisMatchAQ3) { DoTest(3); }
#if CONFIG_DELTA_Q
#if CONFIG_DELTA_Q & !CONFIG_EXT_DELTA_Q
// Validate that this AQ mode (AQ=4, delta q)
// encodes and decodes without a mismatch.
TEST_P(AqSegmentTest, TestNoMisMatchAQ4) {
cfg_.rc_end_usage = AOM_CQ;
aq_mode_ = 4;
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
......@@ -96,6 +104,20 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ4) {
}
#endif
#if CONFIG_EXT_DELTA_Q
// Validate that this delta q mode
// encodes and decodes without a mismatch.
TEST_P(AqSegmentTest, TestNoMisMatchExtDeltaQ) {
cfg_.rc_end_usage = AOM_CQ;
aq_mode_ = 0;
deltaq_mode_ = 2;
::libaom_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
#endif
AV1_INSTANTIATE_TEST_CASE(AqSegmentTest,
::testing::Values(::libaom_test::kRealTime,
::libaom_test::kOnePassGood),
......
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