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

Yongle Lin yonglel at google.com
Wed Jul 8 00:47:50 EEST 2020


On Tue, Jul 7, 2020 at 2:09 PM Lynne <dev at lynne.ee> wrote:

> Jul 7, 2020, 21:25 by yongle.lin.94 at gmail.com:
>
> > add block type field to AVVideoBlockParams so we could either export or
> visualize it later.
> > ---
> >  libavutil/video_enc_params.h | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
> > index 43fa443154..bff5354a8d 100644
> > --- a/libavutil/video_enc_params.h
> > +++ b/libavutil/video_enc_params.h
> > @@ -126,6 +126,21 @@ typedef struct AVVideoBlockParams {
> >  * corresponding per-frame value.
> >  */
> >  int32_t delta_qp;
> > +
> > +    /**
> > +     * Type of block
> > +     * Each bit field indicates a type flag:
> > +     * - (1 << 0) Intra prediction flag for the block
> > +     *   1 indicates that prediction type is intra, otherwise inter
> > +     * - (1 << 1) Skip flag for the block
> > +     *   1 indicates that a block has no residual coefficients, 0
> otherwise
> > +     */
> > +     uint64_t type;
> >
>
> You also need to define the flags by an enum or a define.
>
> enum AVVideoBlockFlags {
>     AV_VIDEO_ENC_BLOCK_INTRA = 1ULL <<  0, /* Indicates block uses
> intraprediction */
>     AV_VIDEO_ENC_BLOCK_SKIP = 1ULL <<  1, /* Indicates block is not coded
> (skipped) */
> };
>
> Using 1ULL forces the enum to be 64-bit unsigned, so you can specify it in
> the struct like:
> enum AVVideoBlockFlags flags;
> Rather than just a uint64_t.
>
Thank you so much for the suggestion. It makes much more sense. I will
change the patch accordingly.

> _______________________________________________
> 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