diff mbox series

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

Message ID 20200707233013.2796832-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, 11:30 p.m. UTC
add block type field to AVVideoBlockParams so we could either export or visualize it later.
---
 libavutil/video_enc_params.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/libavutil/video_enc_params.h b/libavutil/video_enc_params.h
index 43fa443154..8bf5f240c9 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 AVVideoBlockFlags {
+    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,20 @@  typedef struct AVVideoBlockParams {
      * corresponding per-frame value.
      */
     int32_t delta_qp;
+
+    /**
+     * Type flag of the block
+     * Each bit field indicates a type flag
+     */
+    enum AVVideoBlockFlags flags;
+
+    /**
+     * Reference frames used for prediction
+     * Each entry specifies the first/second/third/etc. reference frame the current frame uses.
+     * The value at each entry specifies the index inside the reference frame array for that current frame.
+     * Any entry that is unused will be set to -1
+     */
+    int8_t ref[8];
 } AVVideoBlockParams;
 
 /*