diff options
author | Henrik Lundin <hlundin@google.com> | 2010-12-16 16:46:31 +0100 |
---|---|---|
committer | Henrik Lundin <hlundin@google.com> | 2011-01-19 09:53:21 +0100 |
commit | 67fb3a5155bd7dcb6aacbc7e3bb05be308040367 (patch) | |
tree | be4013600755cd05a0cbad5433c7e6a0eb02e376 /vp8/decoder/onyxd_if.c | |
parent | 2a87491fb07221886c8c570e6b0b48f56855a2c7 (diff) | |
download | libvpx-67fb3a5155bd7dcb6aacbc7e3bb05be308040367.tar libvpx-67fb3a5155bd7dcb6aacbc7e3bb05be308040367.tar.gz libvpx-67fb3a5155bd7dcb6aacbc7e3bb05be308040367.tar.bz2 libvpx-67fb3a5155bd7dcb6aacbc7e3bb05be308040367.zip |
Implement error tracking in the decoder
A new vpx_codec_control called VP8D_GET_FRAME_CORRUPTED. The output
from the function is non-zero if the last decoded frame contains
corruption due to packet losses.
The decoder is also modified to accept encoded frames of zero length.
A zero length frame indicates to the decoder that one or more frames
have been completely lost. This will mark the last decoded reference
buffer as corrupted. The data pointer can be NULL if the length is
zero.
Change-Id: Ic5902c785a281c6e05329deea958554b7a6c75ce
Diffstat (limited to 'vp8/decoder/onyxd_if.c')
-rw-r--r-- | vp8/decoder/onyxd_if.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c index aa2709f5b..d32b8cd65 100644 --- a/vp8/decoder/onyxd_if.c +++ b/vp8/decoder/onyxd_if.c @@ -334,6 +334,23 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign pbi->common.error.error_code = VPX_CODEC_OK; + if (size == 0) + { + /* This is used to signal that we are missing frames. + * We do not know if the missing frame(s) was supposed to update + * any of the reference buffers, but we act conservative and + * mark only the last buffer as corrupted. + */ + cm->yv12_fb[cm->lst_fb_idx].corrupted = 1; + + /* Signal that we have no frame to show. */ + cm->show_frame = 0; + + /* Nothing more to do. */ + return 0; + } + + #if HAVE_ARMV7 #if CONFIG_RUNTIME_CPU_DETECT if (cm->rtcd.flags & HAS_NEON) @@ -356,6 +373,13 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign } #endif pbi->common.error.setjmp = 0; + + /* We do not know if the missing frame(s) was supposed to update + * any of the reference buffers, but we act conservative and + * mark only the last buffer as corrupted. + */ + cm->yv12_fb[cm->lst_fb_idx].corrupted = 1; + if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0) cm->fb_idx_ref_cnt[cm->new_fb_idx]--; return -1; |