[FFmpeg-devel] [PATCH 14/17] mjpegdec: Add hwaccel hooks

Mark Thompson sw at jkqxz.net
Fri Nov 24 13:23:18 EET 2017


On 24/11/17 11:17, Carl Eugen Hoyos wrote:
> 2017-11-24 1:51 GMT+01:00 Mark Thompson <sw at jkqxz.net>:
>> Also adds some extra fields to the main context structure
>> that may be needed by a hwaccel decoder.
>> ---
>> The YUVJ formats really mess with this.  This patch hacks
>> them out so that the hwaccel works, suggestions welcome
>> on what to actually do about them.
> 
>> +    if (s->avctx->pix_fmt == AV_PIX_FMT_YUVJ420P)
>> +        s->avctx->pix_fmt = AV_PIX_FMT_YUV420P;
>> +    if (s->avctx->pix_fmt == AV_PIX_FMT_YUVJ422P)
>> +        s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
> 
> The hardware decoders output mpeg-scaled frames?

I think some do, though I haven't seen it myself.  Those that don't (like VAAPI) will use the color_range metadata - I think don't it is sensible to add lots of extra paths to support YUVJ formats in AVHWFramesContext.sw_format.

Thanks,

- Mark


More information about the ffmpeg-devel mailing list