Author: aurel Date: Mon Oct 23 01:19:42 2006 New Revision: 6770 Modified: trunk/libavcodec/vp6.c trunk/libavformat/flvdec.c Log: use the adjustment value present in FLV to crop VP6 video Modified: trunk/libavcodec/vp6.c ============================================================================== --- trunk/libavcodec/vp6.c (original) +++ trunk/libavcodec/vp6.c Mon Oct 23 01:19:42 2006 @@ -64,6 +64,10 @@ if (16*cols != s->avctx->coded_width || 16*rows != s->avctx->coded_height) { avcodec_set_dimensions(s->avctx, 16*cols, 16*rows); + if (s->avctx->extradata_size == 1) { + s->avctx->width -= s->avctx->extradata[0] >> 4; + s->avctx->height -= s->avctx->extradata[0] & 0x0F; + } res = 2; } Modified: trunk/libavformat/flvdec.c ============================================================================== --- trunk/libavformat/flvdec.c (original) +++ trunk/libavformat/flvdec.c Mon Oct 23 01:19:42 2006 @@ -193,7 +193,12 @@ case 3: st->codec->codec_id = CODEC_ID_FLASHSV; break; case 4: st->codec->codec_id = CODEC_ID_VP6F; - get_byte(&s->pb); /* width and height adjustment */ + if (st->codec->extradata_size != 1) { + st->codec->extradata_size = 1; + st->codec->extradata = av_malloc(1); + } + /* width and height adjustment */ + st->codec->extradata[0] = get_byte(&s->pb); size--; break; default:
Hi,
Modified: trunk/libavformat/flvdec.c ===================================================================== ========= --- trunk/libavformat/flvdec.c (original) +++ trunk/libavformat/flvdec.c Mon Oct 23 01:19:42 2006 @@ -193,7 +193,12 @@ case 3: st->codec->codec_id = CODEC_ID_FLASHSV; break; case 4: st->codec->codec_id = CODEC_ID_VP6F; - get_byte(&s->pb); /* width and height adjustment */ + if (st->codec->extradata_size != 1) { + st->codec->extradata_size = 1; + st->codec->extradata = av_malloc(1); + } + /* width and height adjustment */ + st->codec->extradata[0] = get_byte(&s->pb);
Is it possible in FLV that the adjusment values change between frames? -- Alex Beregszaszi | alex at fsn.hu
On Sun, 12 Nov 2006 13:43:19 +0100 Alex Beregszaszi <alex at fsn.hu> wrote:
Hi,
Modified: trunk/libavformat/flvdec.c ===================================================================== ========= --- trunk/libavformat/flvdec.c (original) +++ trunk/libavformat/flvdec.c Mon Oct 23 01:19:42 2006 @@ -193,7 +193,12 @@ case 3: st->codec->codec_id = CODEC_ID_FLASHSV; break; case 4: st->codec->codec_id = CODEC_ID_VP6F; - get_byte(&s->pb); /* width and height adjustment */ + if (st->codec->extradata_size != 1) { + st->codec->extradata_size = 1; + st->codec->extradata = av_malloc(1); + } + /* width and height adjustment */ + st->codec->extradata[0] = get_byte(&s->pb);
Is it possible in FLV that the adjusment values change between frames?
The adjustment values are present in every frames, so in practice, it might change between frames. But I don't know if the FLV spec allows this. Anyway, this is very unlikely to see such a file in the wild. Aurel
participants (3)
-
alex@fsn.hu -
aurel@gnuage.org -
subversion@mplayerhq.hu