Commit 21c95299 authored by melanson's avatar melanson

smarten up the SVQ3 extradata decoder without changing the external API


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2878 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8f33154c
...@@ -766,6 +766,7 @@ static int svq3_decode_frame (AVCodecContext *avctx, ...@@ -766,6 +766,7 @@ static int svq3_decode_frame (AVCodecContext *avctx,
MpegEncContext *const s = avctx->priv_data; MpegEncContext *const s = avctx->priv_data;
H264Context *const h = avctx->priv_data; H264Context *const h = avctx->priv_data;
int m, mb_type; int m, mb_type;
unsigned char *extradata;
*data_size = 0; *data_size = 0;
...@@ -790,13 +791,20 @@ static int svq3_decode_frame (AVCodecContext *avctx, ...@@ -790,13 +791,20 @@ static int svq3_decode_frame (AVCodecContext *avctx,
alloc_tables (h); alloc_tables (h);
if (avctx->extradata && avctx->extradata_size >= 0x64 /* prowl for the "SEQH" marker in the extradata */
&& !memcmp (avctx->extradata, "SVQ3", 4)) { extradata = (unsigned char *)avctx->extradata;
for (m = 0; m < avctx->extradata_size; m++) {
if (!memcmp (extradata, "SEQH", 4))
break;
extradata++;
}
/* if a match was found, parse the extra data */
if (!memcmp (extradata, "SEQH", 4)) {
GetBitContext gb; GetBitContext gb;
init_get_bits (&gb, (uint8_t *) avctx->extradata + 0x62, init_get_bits (&gb, extradata + 0x8, 8*8);
8*(avctx->extradata_size - 0x62));
/* 'frame size code' and optional 'width, height' */ /* 'frame size code' and optional 'width, height' */
if (get_bits (&gb, 3) == 7) { if (get_bits (&gb, 3) == 7) {
......
Markdown is supported
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