rtc: Enable RTC reference strucutre for speed >= 6 Enable set_reference_structure for 1 pass RTC, for speed >= 6. This bypasses the internal structure, but the behavior explicitly set by the flag set_reference_structure is very similar (mainly fixes the golden update to be what was intended for RTC, and provides flexibility for future adjustments). bdrate gains on all clips for rtc_derf set: speed 7: avg. ~1.1%, max ~4.8, a few clips over 3%. speed 6: avg. ~0.35, max ~1.45. No speed/fps change observed. Change-Id: I25bdd6fa5282032ef40697f4226e310a0bdaeb1b
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c index 6b93e10..40cc509 100644 --- a/av1/encoder/ratectrl.c +++ b/av1/encoder/ratectrl.c
@@ -1921,7 +1921,7 @@ int target; // Turn this on to explicitly set the reference structure rather than // relying on internal/default structure. - const int set_reference_structure = 0; + const int set_reference_structure = 1; if (cpi->use_svc) { av1_update_temporal_layer_framerate(cpi); av1_restore_layer_context(cpi); @@ -1996,8 +1996,7 @@ } av1_rc_set_frame_target(cpi, target, cm->width, cm->height); rc->base_frame_target = target; - // For 1 layer nonrd allow option to set reference structure. - if (set_reference_structure && cpi->sf.use_nonrd_pick_mode && + if (set_reference_structure && cpi->oxcf.speed >= 6 && cm->number_spatial_layers == 1 && cm->number_temporal_layers == 1) set_reference_structure_one_pass_rt(cpi); }
diff --git a/test/rt_end_to_end_test.cc b/test/rt_end_to_end_test.cc index 8edaf18..18a21aa 100644 --- a/test/rt_end_to_end_test.cc +++ b/test/rt_end_to_end_test.cc
@@ -31,11 +31,11 @@ std::unordered_map<std::string, std::unordered_map<int, std::unordered_map<int, double>>> kPsnrThreshold = { { "park_joy_90p_8_420.y4m", - { { 6, { { 0, 35.4 }, { 3, 36.3 } } }, + { { 6, { { 0, 35.4 }, { 3, 36.2 } } }, { 7, { { 0, 34.9 }, { 3, 35.8 } } }, { 8, { { 0, 35.0 }, { 3, 35.8 } } } } }, { "paris_352_288_30.y4m", - { { 6, { { 0, 36.3 }, { 3, 36.7 } } }, + { { 6, { { 0, 36.2 }, { 3, 36.7 } } }, { 7, { { 0, 35.5 }, { 3, 36.0 } } }, { 8, { { 0, 36.0 }, { 3, 36.5 } } } } }, { "niklas_1280_720_30.y4m",