summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/vl/vp8/vp8_decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/vl/vp8/vp8_decoder.c')
-rw-r--r--src/gallium/auxiliary/vl/vp8/vp8_decoder.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/gallium/auxiliary/vl/vp8/vp8_decoder.c b/src/gallium/auxiliary/vl/vp8/vp8_decoder.c
index 4aff049dd6..8a54ab4166 100644
--- a/src/gallium/auxiliary/vl/vp8/vp8_decoder.c
+++ b/src/gallium/auxiliary/vl/vp8/vp8_decoder.c
@@ -140,33 +140,37 @@ int vp8_decoder_start(VP8_COMMON *common,
const unsigned char *data, unsigned data_size)
{
int retcode = 0;
+ int bitstreambuffer_offset = 0;
- common->error.error_code = VPX_CODEC_OK;
-
- {
- common->data = data;
- common->data_size = data_size;
+ if (frame_header->key_frame == 0)
+ bitstreambuffer_offset = 10;
+ else
+ bitstreambuffer_offset = 3;
- common->new_fb_idx = get_free_fb(common);
+ common->data = data + bitstreambuffer_offset;
+ common->data_size = data_size - bitstreambuffer_offset;
+ common->new_fb_idx = get_free_fb(common);
- if (setjmp(common->error.jmp))
- {
- common->error.setjmp = 0;
+ common->error.error_code = VPX_CODEC_OK;
- /* 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. */
- common->yv12_fb[common->lst_fb_idx].corrupted = 1;
+ if (setjmp(common->error.jmp))
+ {
+ common->error.setjmp = 0;
- if (common->fb_idx_ref_cnt[common->new_fb_idx] > 0)
- common->fb_idx_ref_cnt[common->new_fb_idx]--;
+ /* 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. */
+ common->yv12_fb[common->lst_fb_idx].corrupted = 1;
- return -1;
- }
+ if (common->fb_idx_ref_cnt[common->new_fb_idx] > 0)
+ common->fb_idx_ref_cnt[common->new_fb_idx]--;
- common->error.setjmp = 1;
+ return -1;
}
+ common->error.setjmp = 1;
+
+ // Frame decoding
retcode = vp8_frame_decode(common, frame_header);
if (retcode < 0)
@@ -179,6 +183,7 @@ int vp8_decoder_start(VP8_COMMON *common,
return retcode;
}
+ // Software frame buffer handling
{
if (swap_frame_buffers(common))
{