summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorKieran Kunhya <kierank@obe.tv>2017-12-29 15:42:14 +0000
committerKieran Kunhya <kierank@obe.tv>2018-04-02 13:06:23 +0100
commitf9d3841ae6147eaa51c57c574cd81e9ce9566e3a (patch)
treedd24a952bd115ed8596b952999aad07dcc36742e /libavcodec/h263dec.c
parent699fa8f382704acdbdf720042dd7b21df2eb7558 (diff)
mpeg4video: Add support for MPEG-4 Simple Studio Profile.
This is a profile supporting > 8-bit video and has a higher quality DCT
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 5608b63245..484bf39578 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);