summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2013-03-12 15:33:40 +0000
committerPaul Wilkins <paulwilkins@google.com>2013-03-12 16:57:39 +0000
commit8be3056c457f5eda9660cc732b2808a8a72dfedd (patch)
treed53749b9e4e2c2b8e25e275501e74774af049286 /vp9/encoder
parent08d2c3829ab47f2ef329f32773cfc2442852ca37 (diff)
downloadlibvpx-8be3056c457f5eda9660cc732b2808a8a72dfedd.tar
libvpx-8be3056c457f5eda9660cc732b2808a8a72dfedd.tar.gz
libvpx-8be3056c457f5eda9660cc732b2808a8a72dfedd.tar.bz2
libvpx-8be3056c457f5eda9660cc732b2808a8a72dfedd.zip
Change buffer update rules on ARF overlay.
When coding the frame that corresponds to the midpoint frame defining an ARF, do not update the last reference frame buffer. Previously this buffer was updated meaning that when coding the next ARF all the reference buffers were the same (or nearly so). Turning the update off means that the frame before is still available as an alternative predictor and for use in compound prediction. Also fixed inconsistency in test for mismatch (patch from JK). Net average gains (derf 0.049, yt 0.163, yt-hd 0.207, std-hd 0.286) Change-Id: Ifee21da21ccbb1648ac2eafe890d3ce60562c7bc
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_onyx_if.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index ce91fb2f5..1403f506c 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -3492,7 +3492,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
// in this frame.
update_base_skip_probs(cpi);
-#if 0// 1 && CONFIG_INTERNAL_STATS
+#if 0 // 1 && CONFIG_INTERNAL_STATS
{
FILE *f = fopen("tmp.stt", "a");
int recon_err;
@@ -3505,13 +3505,13 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
if (cpi->twopass.total_left_stats->coded_error != 0.0)
fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d"
"%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f"
- "%6d %5d %5d %5d %8.2f %10d %10.3f"
+ "%6d %6d %5d %5d %5d %8.2f %10d %10.3f"
"%10.3f %8d %10d %10d %10d\n",
cpi->common.current_video_frame, cpi->this_frame_target,
cpi->projected_frame_size, 0, //loop_size_estimate,
(cpi->projected_frame_size - cpi->this_frame_target),
(int)cpi->total_target_vs_actual,
- (cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
+ (int)(cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
(int)cpi->total_actual_bits,
vp9_convert_qindex_to_q(cm->base_qindex),
(double)vp9_dc_quant(cm->base_qindex, 0) / 4.0,
@@ -3520,6 +3520,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
cpi->avg_q,
vp9_convert_qindex_to_q(cpi->ni_av_qi),
vp9_convert_qindex_to_q(cpi->cq_target_quality),
+ cpi->refresh_last_frame,
cpi->refresh_golden_frame, cpi->refresh_alt_ref_frame,
cm->frame_type, cpi->gfu_boost,
cpi->twopass.est_max_qcorrection_factor,
@@ -3532,14 +3533,14 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
else
fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d"
"%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f"
- "%5d %5d %8d %8d %8.2f %10d %10.3f"
+ "%5d %5d %5d %8d %8d %8.2f %10d %10.3f"
"%8d %10d %10d %10d\n",
cpi->common.current_video_frame,
cpi->this_frame_target, cpi->projected_frame_size,
0, //loop_size_estimate,
(cpi->projected_frame_size - cpi->this_frame_target),
(int)cpi->total_target_vs_actual,
- (cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
+ (int)(cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
(int)cpi->total_actual_bits,
vp9_convert_qindex_to_q(cm->base_qindex),
(double)vp9_dc_quant(cm->base_qindex, 0) / 4.0,
@@ -3548,6 +3549,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
cpi->avg_q,
vp9_convert_qindex_to_q(cpi->ni_av_qi),
vp9_convert_qindex_to_q(cpi->cq_target_quality),
+ cpi->refresh_last_frame,
cpi->refresh_golden_frame, cpi->refresh_alt_ref_frame,
cm->frame_type, cpi->gfu_boost,
cpi->twopass.est_max_qcorrection_factor,
@@ -3791,8 +3793,10 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
cpi->is_src_frame_alt_ref = cpi->alt_ref_source
&& (cpi->source == cpi->alt_ref_source);
- if (cpi->is_src_frame_alt_ref)
+ if (cpi->is_src_frame_alt_ref) {
+ cpi->refresh_last_frame = 0;
cpi->alt_ref_source = NULL;
+ }
}
}
@@ -3915,8 +3919,8 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
sizeof(cm->fc));
}
- // if its a dropped frame honor the requests on subsequent frames
if (*size > 0) {
+ // if its a dropped frame honor the requests on subsequent frames
cpi->droppable = !frame_is_reference(cpi);
// return to normal state