[FFmpeg-devel] [PATCH] lavc/qsvenc: set pict_type to be I for IDR frames.
mypopy at gmail.com
mypopy at gmail.com
Wed Dec 12 08:40:22 EET 2018
On Wed, Dec 12, 2018 at 2:13 PM Li, Zhong <zhong.li at intel.com> wrote:
>
> > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
> > > aa7f347..8289a32 100644
> > > --- a/libavcodec/qsvenc.c
> > > +++ b/libavcodec/qsvenc.c
> > > @@ -1378,10 +1378,11 @@ int ff_qsv_encode(AVCodecContext *avctx,
> > > QSVEncContext *q,
> > > new_pkt.size = bs->DataLength;
> > >
> > > if (bs->FrameType & MFX_FRAMETYPE_IDR ||
> > > - bs->FrameType & MFX_FRAMETYPE_xIDR)
> > > + bs->FrameType & MFX_FRAMETYPE_xIDR) {
> > > new_pkt.flags |= AV_PKT_FLAG_KEY;
> > > -
> > > - if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType &
> > > MFX_FRAMETYPE_xI)
> > > + pict_type = AV_PICTURE_TYPE_I;
> >
> > > + }
> > > + else if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType
> > &
> > > MFX_FRAMETYPE_xI)
> >
> > Please merge these lines.
> >
> > Carl Eugen
>
> Sorry, I haven't seen any line can be merged.
> The only way I think something like this:
> If (MFX_FRAMETYPE_I || MFX_FRAMETYPE_xI || MFX_FRAMETYPE_IDR || MFX_FRAMETYPE_xIDR)
> pict_type = AV_PICTURE_TYPE_I;
> if (MFX_FRAMETYPE_IDR || MFX_FRAMETYPE_xIDR)
> new_pkt.flags |= AV_PKT_FLAG_KEY;
> else if ...
I think carl's comment means mege:
> + }
> + else if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType &
like } else if (xxx)
More information about the ffmpeg-devel
mailing list