X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh263dec.c;h=484bf39578a0f002f044d7bbc44d25c5cd462c33;hb=9ae2845b1c0a358f8585634f443283d560715580;hp=5608b6324564f347aa84f49e5491956bd074698c;hpb=b668a1c8b35d7b45eb32cba465fb99b99355998c;p=ffmpeg diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 5608b632456..484bf39578a 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -47,6 +47,12 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) { + /* MPEG-4 Studio Profile only, not supported by hardware */ + if (avctx->bits_per_raw_sample > 8) { + av_assert1(avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO); + return avctx->pix_fmt; + } + if (avctx->codec->id == AV_CODEC_ID_MSS2) return AV_PIX_FMT_YUV420P; @@ -197,6 +203,11 @@ static int decode_slice(MpegEncContext *s) ff_set_qscale(s, s->qscale); + if (s->studio_profile) { + if ((ret = ff_mpeg4_decode_studio_slice_header(s->avctx->priv_data)) < 0) + return ret; + } + if (s->avctx->hwaccel) { const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8; ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start);