[FFmpeg-devel] [PATCH] libavutil/video_enc_params: add block type

Yongle Lin yonglel at google.com
Tue Jul 7 21:12:53 EEST 2020


On Mon, Jul 6, 2020 at 3:08 PM Mark Thompson <sw at jkqxz.net> wrote:

> On 06/07/2020 22:08, Yongle Lin wrote:
> > add block type field to AVVideoBlockParams so we could either export or
> visualize it later.
> > ---
> >   libavutil/video_enc_params.h | 20 ++++++++++++++++++++
> >   1 file changed, 20 insertions(+)
> >
> > diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
> > index 43fa443154..55b9fc4031 100644
> > --- a/libavutil/video_enc_params.h
> > +++ b/libavutil/video_enc_params.h
> > @@ -101,6 +101,21 @@ typedef struct AVVideoEncParams {
> >       int32_t delta_qp[4][2];
> >   } AVVideoEncParams;
> >
> > +typedef struct MacroBlockType {
> > +    /**
> > +     * Is intra prediction
> > +     */
> > +    int intra;
> > +    /**
> > +     * Skip flag
> > +     */
> > +    int skip;
> > +    /**
> > +     * Reference to the past or future
> > +     */
> > +    int ref[2];
>
> Please can you define carefully in the documentation exactly what each of
> these fields mean, as is done for the QP values above?
>
> (That is, there should be enough information to determine what exactly is
> meant if I am given one of these structures with, say, intra = 3, skip = 7,
> ref = { 5, 1 }.)
>
I will add more detailed explanation to the comment. These fields are all
boolean and I will add bit fields to minimize the size.

>
> > +} MacroBlockType;
>
> Structures in the public API need to carry the "AV" namespace prefix.
>
> I'm not sure that "macroblock" is a good word to use here: many codecs
> have no concept called a "macroblock", and invoking a word with a specific
> definition in only some contexts seems unhelpful.
>
I will change the name to make it more meaningful.

>
> > +
> >   /**
> >    * Data structure for storing block-level encoding information.
> >    * It is allocated as a part of AVVideoEncParams and should be
> retrieved with
> > @@ -126,6 +141,11 @@ typedef struct AVVideoBlockParams {
> >        * corresponding per-frame value.
> >        */
> >       int32_t delta_qp;
> > +
> > +    /**
> > +     * Type of block
> > +     */
> > +    MacroBlockType mb_type;
> >   } AVVideoBlockParams;
> >
> >   /*
> >
>
> - Mark
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list