Commit 1604ad21 authored by Frank Galligan's avatar Frank Galligan
Browse files

Fix frames that have no references to them.

BasicRateTargeting3TemporalLayers found an error with
the get/release frame buffer management.

Change-Id: Iccff25cba1d2f276f2a0d0fb7b20cf99b4405549
Showing with 8 additions and 1 deletion
......@@ -489,7 +489,7 @@ TEST_P(DatarateTestVP9, BasicRateTargeting2TemporalLayers) {
}
// 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;
......
......@@ -342,6 +342,10 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
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)) {
......
......@@ -303,6 +303,9 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
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");
......
Supports Markdown
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