Message ID | AS8P250MB0744D820C32C092D0595473C8FC8A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/7] avcodec/wmv2dec: Parse extradata during init | expand |
On Sat, Oct 07, 2023 at 02:40:26AM +0200, Andreas Rheinhardt wrote: > They are generally set in ff_mpv_init_context_frame() > (mostly called by ff_mpv_common_init()); setting them > somewhere else should be avoided. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> > --- > libavcodec/h261dec.c | 6 ------ > libavcodec/vc1dec.c | 3 --- > 2 files changed, 9 deletions(-) This seems to break several vc1 files like vlcticket/5887/Cruise\ 2012_07_29_19_02_16.wmv I think its there: https://streams.videolan.org/issues/5887/ thx [...]
Michael Niedermayer: > On Sat, Oct 07, 2023 at 02:40:26AM +0200, Andreas Rheinhardt wrote: >> They are generally set in ff_mpv_init_context_frame() >> (mostly called by ff_mpv_common_init()); setting them >> somewhere else should be avoided. >> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> >> --- >> libavcodec/h261dec.c | 6 ------ >> libavcodec/vc1dec.c | 3 --- >> 2 files changed, 9 deletions(-) > > This seems to break several vc1 files like > vlcticket/5887/Cruise\ 2012_07_29_19_02_16.wmv > > I think its there: > https://streams.videolan.org/issues/5887/ > Thanks for testing, much appreciated. The reason for this is line 968, where mb_height is used before ff_mpv_common_init() is called. This actually points to a potential bug: On frame size changes (can happen in ff_vc1_decode_entry_point()), this line would still use the old value of mb_height. But I don't want to deal with this at the moment, so I'll simply drop the vc1dec.c stuff from this patch and apply only h261dec.c. - Andreas
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 447e168c4f..a4e0bf9cf2 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -530,17 +530,11 @@ static int h261_decode_picture_header(H261DecContext *h) if (format == 0) { // QCIF s->width = 176; s->height = 144; - s->mb_width = 11; - s->mb_height = 9; } else { // CIF s->width = 352; s->height = 288; - s->mb_width = 22; - s->mb_height = 18; } - s->mb_num = s->mb_width * s->mb_height; - skip_bits1(&s->gb); /* still image mode off */ skip_bits1(&s->gb); /* Reserved */ diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 534128d6ee..58a50f085d 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -741,9 +741,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (v->matrix_coef == 1 || v->matrix_coef == 6 || v->matrix_coef == 7) avctx->colorspace = v->matrix_coef; - s->mb_width = (avctx->coded_width + 15) >> 4; - s->mb_height = (avctx->coded_height + 15) >> 4; - if (v->profile == PROFILE_ADVANCED || v->res_fasttx) { ff_vc1_init_transposed_scantables(v); } else {
They are generally set in ff_mpv_init_context_frame() (mostly called by ff_mpv_common_init()); setting them somewhere else should be avoided. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/h261dec.c | 6 ------ libavcodec/vc1dec.c | 3 --- 2 files changed, 9 deletions(-)