[FFmpeg-devel] [PATCH 13/17] lavc/mjpeg: Add profiles for MJPEG using SOF marker codes

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Nov 24 14:05:32 EET 2017


2017-11-24 12:35 GMT+01:00 Mark Thompson <sw at jkqxz.net>:
> On 24/11/17 11:27, Carl Eugen Hoyos wrote:
>> 2017-11-24 1:51 GMT+01:00 Mark Thompson <sw at jkqxz.net>:
>>> 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.
>>> ---
>>>  libavcodec/avcodec.h  | 6 ++++++
>>>  libavcodec/mjpegdec.c | 7 +++++++
>>>  2 files changed, 13 insertions(+)
>>>
>>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>>> index 0972df0bde..c1e68b1d13 100644
>>> --- a/libavcodec/avcodec.h
>>> +++ b/libavcodec/avcodec.h
>>> @@ -2897,6 +2897,12 @@ typedef struct AVCodecContext {
>>>  #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE          3
>>>  #define FF_PROFILE_HEVC_REXT                        4
>>>
>>> +#define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT            0xc0
>>> +#define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
>>> +#define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT         0xc2
>>> +#define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS                0xc3
>>> +#define FF_PROFILE_MJPEG_JPEG_LS                         0xf7
>>
>> Sorry if I misread the code:
>> If you (thankfully) define these as in the specification, why don't you
>> simply set them without the "if()"'s?
>
> They have to be set inside the switch because there are
> other non-SOF markers there.

Of course, thank you!

> In each case they could then be set from start_code, but it
> seemed clearer to write the profile out properly?

See other thread: What is unreadable to one developer
is clearer to another;-)

Carl Eugen


More information about the ffmpeg-devel mailing list