diff mbox series

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

Message ID 20200707221133.2781953-1-yonglel@google.com
State Superseded
Headers show
Series [FFmpeg-devel] libavutil/video_enc_params: add block type | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Yongle Lin July 7, 2020, 10:11 p.m. UTC
add block type field to AVVideoBlockParams so we could either export or visualize it later.
---
 libavutil/video_enc_params.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Lynne July 7, 2020, 10:33 p.m. UTC | #1
Jul 7, 2020, 23:11 by yongle.lin.94@gmail.com:

> add block type field to AVVideoBlockParams so we could either export or visualize it later.
> ---
>  libavutil/video_enc_params.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
> index 43fa443154..c18dba7879 100644
> --- a/libavutil/video_enc_params.h
> +++ b/libavutil/video_enc_params.h
> @@ -57,6 +57,11 @@ enum AVVideoEncParamsType {
>  AV_VIDEO_ENC_PARAMS_H264,
>  };
>  
> +enum AVVideoBlockType {
> +    AV_VIDEO_ENC_BLOCK_INTRA = 1ULL <<  0,  /* Indicates block uses intra prediction */
> +    AV_VIDEO_ENC_BLOCK_SKIP = 1ULL <<  1,   /* Indicates block is not coded (skipped) */
> +};
> +
>  /**
>  * Video encoding parameters for a given frame. This struct is allocated along
>  * with an optional array of per-block AVVideoBlockParams descriptors.
> @@ -126,6 +131,17 @@ typedef struct AVVideoBlockParams {
>  * corresponding per-frame value.
>  */
>  int32_t delta_qp;
> +
> +    /**
> +     * Type of block
> +     * Each bit field indicates a type flag
> +     */
> +    enum AVVideoBlockType type;
>

I would like to have the name "type" reserved for the future when we might have to
specify a block type using a specific type rather than using flags.
So could you rename this to "flags" instead?

Apart from that, this looks fine to me.
Yongle Lin July 7, 2020, 10:38 p.m. UTC | #2
On Tue, Jul 7, 2020 at 3:33 PM Lynne <dev@lynne.ee> wrote:

> Jul 7, 2020, 23:11 by yongle.lin.94@gmail.com:
>
> > add block type field to AVVideoBlockParams so we could either export or
> visualize it later.
> > ---
> >  libavutil/video_enc_params.h | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
> > index 43fa443154..c18dba7879 100644
> > --- a/libavutil/video_enc_params.h
> > +++ b/libavutil/video_enc_params.h
> > @@ -57,6 +57,11 @@ enum AVVideoEncParamsType {
> >  AV_VIDEO_ENC_PARAMS_H264,
> >  };
> >
> > +enum AVVideoBlockType {
> > +    AV_VIDEO_ENC_BLOCK_INTRA = 1ULL <<  0,  /* Indicates block uses
> intra prediction */
> > +    AV_VIDEO_ENC_BLOCK_SKIP = 1ULL <<  1,   /* Indicates block is not
> coded (skipped) */
> > +};
> > +
> >  /**
> >  * Video encoding parameters for a given frame. This struct is allocated
> along
> >  * with an optional array of per-block AVVideoBlockParams descriptors.
> > @@ -126,6 +131,17 @@ typedef struct AVVideoBlockParams {
> >  * corresponding per-frame value.
> >  */
> >  int32_t delta_qp;
> > +
> > +    /**
> > +     * Type of block
> > +     * Each bit field indicates a type flag
> > +     */
> > +    enum AVVideoBlockType type;
> >
>
> I would like to have the name "type" reserved for the future when we might
> have to
> specify a block type using a specific type rather than using flags.
> So could you rename this to "flags" instead?


> Apart from that, this looks fine to me.
>
I see.
Sure. I will change it to flags. Thanks.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
index 43fa443154..c18dba7879 100644
--- a/libavutil/video_enc_params.h
+++ b/libavutil/video_enc_params.h
@@ -57,6 +57,11 @@  enum AVVideoEncParamsType {
     AV_VIDEO_ENC_PARAMS_H264,
 };
 
+enum AVVideoBlockType {
+    AV_VIDEO_ENC_BLOCK_INTRA = 1ULL <<  0,  /* Indicates block uses intra prediction */
+    AV_VIDEO_ENC_BLOCK_SKIP = 1ULL <<  1,   /* Indicates block is not coded (skipped) */
+};
+
 /**
  * Video encoding parameters for a given frame. This struct is allocated along
  * with an optional array of per-block AVVideoBlockParams descriptors.
@@ -126,6 +131,17 @@  typedef struct AVVideoBlockParams {
      * corresponding per-frame value.
      */
     int32_t delta_qp;
+
+    /**
+     * Type of block
+     * Each bit field indicates a type flag
+     */
+    enum AVVideoBlockType type;
+
+    /**
+     * Reference frames used for prediction
+     */
+    uint8_t ref[8];
 } AVVideoBlockParams;
 
 /*