diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-11-24 01:44:27 +0300 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-02-22 02:37:58 +0300 |
commit | 9ca79784e9e640829645b0b28201cf9cdfbfc0f4 (patch) | |
tree | a6341f074c06c25e4825112483598b319858ff93 /libavcodec/mjpegdec.c | |
parent | ae2eb04648839bfc6c61c32cb0f124e91bb7ff8e (diff) |
lavc/mjpeg: Add profiles for MJPEG using SOF marker codes
This is needed by later hwaccel code to tell which encoding process was
used for a particular frame, because hardware decoders may only support a
subset of possible methods.
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 5055ee2826..29f99373cc 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2288,6 +2288,10 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, break; case SOF0: case SOF1: + if (start_code == SOF0) + s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; + else + s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; s->lossless = 0; s->ls = 0; s->progressive = 0; @@ -2295,6 +2299,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, goto fail; break; case SOF2: + s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; s->lossless = 0; s->ls = 0; s->progressive = 1; @@ -2302,6 +2307,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, goto fail; break; case SOF3: + s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 0; @@ -2310,6 +2316,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, goto fail; break; case SOF48: + s->avctx->profile = FF_PROFILE_MJPEG_JPEG_LS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 1; |