ref: 1604ad21491c3982e68395a7d43961781f111e8c
parent: 9453c6472630cf1485161ef7499e658f5c378ceb
author: Frank Galligan <[email protected]>
date: Tue Feb 11 13:33:02 EST 2014
Fix frames that have no references to them. BasicRateTargeting3TemporalLayers found an error with the get/release frame buffer management. Change-Id: Iccff25cba1d2f276f2a0d0fb7b20cf99b4405549
--- a/test/datarate_test.cc
+++ b/test/datarate_test.cc
@@ -489,7 +489,7 @@
}
// Check basic rate targeting for 3 temporal layers.
-TEST_P(DatarateTestVP9, DISABLED_BasicRateTargeting3TemporalLayers) {
+TEST_P(DatarateTestVP9, BasicRateTargeting3TemporalLayers) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
--- a/vp9/decoder/vp9_onyxd_if.c
+++ b/vp9/decoder/vp9_onyxd_if.c
@@ -342,6 +342,10 @@
cm->frame_refs[0].buf->corrupted = 1;
}
+ // Check if the previous frame was a frame without any references to it.
+ if (cm->new_fb_idx >= 0 && cm->frame_bufs[cm->new_fb_idx].ref_count == 0)
+ cm->release_fb_cb(cm->cb_priv,
+ &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer);
cm->new_fb_idx = get_free_fb(cm);
if (setjmp(cm->error.jmp)) {
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -303,6 +303,9 @@
cm->get_fb_cb = vp9_get_frame_buffer;
cm->release_fb_cb = vp9_release_frame_buffer;
+ // Set index to not initialized.
+ cm->new_fb_idx = -1;
+
if (vp9_alloc_internal_frame_buffers(&cm->int_frame_buffers))
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to initialize internal frame buffers");