[FFmpeg-devel] [PATCH] mpeg2_hwaccel: always submit twice for a frame with two fileds.

Li, Zhong zhong.li at intel.com
Thu Sep 21 08:14:07 EEST 2017


> -----Original Message-----
> From: Jun Zhao [mailto:mypopydev at gmail.com]
> Sent: Thursday, September 21, 2017 1:01 PM
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at ffmpeg.org>; Li, Zhong <zhong.li at intel.com>
> Cc: sw at jkqxz.net; Zhao, Jun <jun.zhao at intel.com>; nfxjfg at googlemail.com
> Subject: Re: [FFmpeg-devel] [PATCH] mpeg2_hwaccel: always submit twice
> for a frame with two fileds.
> 
> 
> 
> On 2017/9/21 11:26, Zhong Li wrote:
> > Though this patch to fix https://trac.ffmpeg.org/ticket/6668, and
> > allows to set the slice_flags option to decoder, I belive it is
> > unnecessary to set SLICE_FLAG_ALLOW_FIELD flag to other hwaccels(dxva,
> vdpau, etc).
> >
> > Signed-off-by: Zhong Li <zhong.li at intel.com>
> > ---
> >  libavcodec/mpeg12dec.c     | 3 +--
> >  libavcodec/options_table.h | 2 +-
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index
> > 22c29c1505..701845a46c 100644
> > --- a/libavcodec/mpeg12dec.c
> > +++ b/libavcodec/mpeg12dec.c
> > @@ -1689,8 +1689,7 @@ static int mpeg_field_start(MpegEncContext *s,
> const uint8_t *buf, int buf_size)
> >              return AVERROR_INVALIDDATA;
> >          }
> >
> > -        if (s->avctx->hwaccel &&
> > -            (s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
> > +        if (s->avctx->hwaccel) {
> >              if ((ret = s->avctx->hwaccel->end_frame(s->avctx)) < 0) {
> >                  av_log(avctx, AV_LOG_ERROR,
> >                         "hardware accelerator failed to decode first
> > field\n"); diff --git a/libavcodec/options_table.h
> > b/libavcodec/options_table.h index 12712fb541..5b9e344554 100644
> > --- a/libavcodec/options_table.h
> > +++ b/libavcodec/options_table.h
> > @@ -340,7 +340,7 @@ static const AVOption avcodec_options[] = {  #if
> > FF_API_PRIVATE_OPT  {"context", "context model",
> > OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN,
> > INT_MAX, V|E},  #endif -{"slice_flags", NULL, OFFSET(slice_flags),
> > AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
> > +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 =
> > +DEFAULT }, INT_MIN, INT_MAX, V|D},
> >  #if FF_API_XVMC
> >  {"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration),
> > AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},  #endif /*
> > FF_API_XVMC */
> I think need to split 2 patches
> 1. enable the option "slice_flags" for decoder 2. fix ticket 6668
Ok, it makes sense, will update it later. 




More information about the ffmpeg-devel mailing list