[FFmpeg-devel] [PATCH 1/3] lavc/mjpegdec: add function ff_mjpeg_decode_header

Li, Zhong zhong.li at intel.com
Fri Jun 28 06:41:13 EEST 2019


> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Carl Eugen Hoyos
> Sent: Friday, June 28, 2019 2:56 AM
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 1/3] lavc/mjpegdec: add function
> ff_mjpeg_decode_header
> 
> Am Do., 27. Juni 2019 um 14:59 Uhr schrieb Zhong Li <zhong.li at intel.com>:
> 
> > -        if (s->avctx->pix_fmt == s->hwaccel_sw_pix_fmt
> && !size_change) {
> > +    if (!(s->got_picture && s->interlaced && (s->bottom_field
> == !s->interlace_polarity))) {
> > +        if (s->avctx->pix_fmt == s->hwaccel_sw_pix_fmt &&
> > + !s->size_change) {
> 
> Is this an (unrelated) bug fix or only vaapi-related?
> I wonder if it should be in this patch for both cases.

Hi Carl:
  This is not to fix any issue, just a tailing after refact with ff_mjpeg_decode_header():

Original code: 
    if (s->got_picture && s->interlaced && (s->bottom_field == !s->interlace_polarity)) {
        if (s->progressive) {
            avpriv_request_sample(s->avctx, "progressively coded interlaced picture");
            return AVERROR_INVALIDDATA;
        }
    } else {
      ... 

        if (s->avctx->pix_fmt == s->hwaccel_sw_pix_fmt && !size_change) {
            s->avctx->pix_fmt = s->hwaccel_pix_fmt;
        } else {
            enum AVPixelFormat pix_fmts[] = {
#if CONFIG_MJPEG_NVDEC_HWACCEL
                AV_PIX_FMT_CUDA,
#endif
#if CONFIG_MJPEG_VAAPI_HWACCEL
                AV_PIX_FMT_VAAPI,
#endif
                s->avctx->pix_fmt,
                AV_PIX_FMT_NONE,
            };
            s->hwaccel_pix_fmt = ff_get_format(s->avctx, pix_fmts);

     ...
   }

Thanks
Zhong 


More information about the ffmpeg-devel mailing list