Index: source/libvpx/vp9/decoder/vp9_decoder.c |
=================================================================== |
--- source/libvpx/vp9/decoder/vp9_decoder.c (revision 278778) |
+++ source/libvpx/vp9/decoder/vp9_decoder.c (working copy) |
@@ -32,7 +32,7 @@ |
#include "vp9/decoder/vp9_detokenize.h" |
#include "vp9/decoder/vp9_dthread.h" |
-void vp9_initialize_dec() { |
+static void initialize_dec() { |
static int init_done = 0; |
if (!init_done) { |
@@ -58,7 +58,7 @@ |
} |
cm->error.setjmp = 1; |
- vp9_initialize_dec(); |
+ initialize_dec(); |
vp9_rtcd(); |
@@ -67,7 +67,6 @@ |
cm->current_video_frame = 0; |
pbi->ready_for_new_data = 1; |
- pbi->decoded_key_frame = 0; |
// vp9_init_dequantizer() is first called here. Add check in |
// frame_init_dequantizer() to avoid unnecessary calling of |
@@ -90,6 +89,7 @@ |
vp9_remove_common(cm); |
vp9_worker_end(&pbi->lf_worker); |
vpx_free(pbi->lf_worker.data1); |
+ vpx_free(pbi->tile_data); |
for (i = 0; i < pbi->num_tile_workers; ++i) { |
VP9Worker *const worker = &pbi->tile_workers[i]; |
vp9_worker_end(worker); |
@@ -211,16 +211,18 @@ |
} |
cm->frame_to_show = get_frame_new_buffer(cm); |
- cm->frame_bufs[cm->new_fb_idx].ref_count--; |
+ if (!pbi->frame_parallel_decode || !cm->show_frame) { |
+ --cm->frame_bufs[cm->new_fb_idx].ref_count; |
+ } |
+ |
// Invalidate these references until the next frame starts. |
for (ref_index = 0; ref_index < 3; ref_index++) |
cm->frame_refs[ref_index].idx = INT_MAX; |
} |
int vp9_receive_compressed_data(VP9Decoder *pbi, |
- size_t size, const uint8_t **psource, |
- int64_t time_stamp) { |
+ size_t size, const uint8_t **psource) { |
VP9_COMMON *const cm = &pbi->common; |
const uint8_t *source = *psource; |
int retcode = 0; |
@@ -241,7 +243,9 @@ |
} |
// 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) |
+ // Release frame buffer if not decoding in frame parallel mode. |
+ if (!pbi->frame_parallel_decode && 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); |
@@ -267,16 +271,8 @@ |
cm->error.setjmp = 1; |
- retcode = vp9_decode_frame(pbi, source, source + size, psource); |
+ vp9_decode_frame(pbi, source, source + size, psource); |
- if (retcode < 0) { |
- cm->error.error_code = VPX_CODEC_ERROR; |
- cm->error.setjmp = 0; |
- if (cm->frame_bufs[cm->new_fb_idx].ref_count > 0) |
- cm->frame_bufs[cm->new_fb_idx].ref_count--; |
- return retcode; |
- } |
- |
swap_frame_buffers(pbi); |
vp9_clear_system_state(); |
@@ -294,14 +290,12 @@ |
} |
pbi->ready_for_new_data = 0; |
- pbi->last_time_stamp = time_stamp; |
cm->error.setjmp = 0; |
return retcode; |
} |
int vp9_get_raw_frame(VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd, |
- int64_t *time_stamp, int64_t *time_end_stamp, |
vp9_ppflags_t *flags) { |
int ret = -1; |
#if !CONFIG_VP9_POSTPROC |
@@ -316,8 +310,6 @@ |
return ret; |
pbi->ready_for_new_data = 1; |
- *time_stamp = pbi->last_time_stamp; |
- *time_end_stamp = 0; |
#if CONFIG_VP9_POSTPROC |
ret = vp9_post_proc_frame(&pbi->common, sd, flags); |