[FFmpeg-devel] [PATCH] lavc/qsvenc: set pict_type to be I for IDR frames.
Li, Zhong
zhong.li at intel.com
Wed Dec 12 08:13:31 EET 2018
> > 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 ...
More information about the ffmpeg-devel
mailing list