From af8b0e2dad051343a8acbf4ff5b8ed0c01874dd5 Mon Sep 17 00:00:00 2001 From: "Yao, Leyu" Date: Mon, 28 Aug 2023 16:27:31 +0800 Subject: [PATCH] encode segmentation map refine Signed-off-by: Yao, Leyu --- va/va.h | 8 ++++++++ va/va_enc_av1.h | 3 ++- va/va_enc_vp9.h | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/va/va.h b/va/va.h index 49979f1ed..72f605c5f 100644 --- a/va/va.h +++ b/va/va.h @@ -1036,6 +1036,14 @@ typedef enum { * The value returned uses the VAConfigAttribValEncPerBlockControl type. */ VAConfigAttribEncPerBlockControl = 55, + /** + * \brief VP9 encoding attribute. Read-only. + * + * This attribute exposes a number of capabilities of the underlying + * VP9 implementation. The attribute value is partitioned into fields as defined in the + * VAConfigAttribValEncVP9 union. + */ + VAConfigAttribEncVP9 = 56, /**@}*/ VAConfigAttribTypeMax } VAConfigAttribType; diff --git a/va/va_enc_av1.h b/va/va_enc_av1.h index e47836b63..82463d058 100644 --- a/va/va_enc_av1.h +++ b/va/va_enc_av1.h @@ -666,7 +666,8 @@ typedef struct _VAEncPictureParameterBufferAV1 { * 0: 16x16 block size, default value; * 1: 32x32 block size; * 2: 64x64 block size; - * 3: 8x8 block size. + * 3: 8x8 block size; + * 4: 4x4 block size. */ uint8_t seg_id_block_size; diff --git a/va/va_enc_vp9.h b/va/va_enc_vp9.h index 107ab0c9c..d4c79a1bd 100644 --- a/va/va_enc_vp9.h +++ b/va/va_enc_vp9.h @@ -507,8 +507,19 @@ typedef struct _VAEncPictureParameterBufferVP9 { */ uint32_t skip_frames_size; + /** \brief Block size for each Segment ID in Segment Map. + * This specify the granularity of media driver of reading and processing the segment map. + * 0: 16x16 block size, default value; + * 1: 32x32 block size; + * 2: 64x64 block size; + * 3: 8x8 block size. + */ + uint8_t seg_id_block_size; + + uint8_t va_reserved8[3]; + /** \brief Reserved bytes for future use, must be zero */ - uint32_t va_reserved[VA_PADDING_MEDIUM]; + uint32_t va_reserved[7]; } VAEncPictureParameterBufferVP9; @@ -594,6 +605,30 @@ typedef struct _VAEncMiscParameterTypeVP9PerSegmantParam { */ +/** \brief Attribute value for VAConfigAttribEncVP9. */ +typedef union _VAConfigAttribValEncVP9 { + struct { + /** + * \brief Min segmentId block size accepted. + * This is the granularity of segmentation map. + */ + uint32_t min_segid_block_size_accepted : 8; + + /** + * \brief Type of segment feature supported. + * (segment_feature_support & 0x01) == 1: SEG_LVL_ALT_Q is supported, 0: not. + * (segment_feature_support & 0x02) == 1: SEG_LVL_ALT_L is supported, 0: not. + * (segment_feature_support & 0x04) == 1: SEG_LVL_REF_FRAME is supported, 0: not. + * (segment_feature_support & 0x08) == 1: SEG_LVL_SKIP is supported, 0: not. + */ + uint32_t segment_feature_support : 4; + + /** \brief Reserved bits for future, must be zero. */ + uint32_t reserved : 20; + } bits; + uint32_t value; +} VAConfigAttribValEncVP9; + /**@}*/ #ifdef __cplusplus