Skip to content

Commit

Permalink
va: encode segmentation map refine
Browse files Browse the repository at this point in the history
Signed-off-by: Yao, Leyu <[email protected]>
Signed-off-by: Zhang,Carl <[email protected]>
  • Loading branch information
leyu-yao authored and XinfengZhang committed Jun 26, 2024
1 parent 194ad5a commit 85a180c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
8 changes: 8 additions & 0 deletions va/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,14 @@ typedef enum {
* columns supported for encoding with tile support.
*/
VAConfigAttribEncMaxTileCols = 57,
/**
* \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 = 58,
/**@}*/
VAConfigAttribTypeMax
} VAConfigAttribType;
Expand Down
9 changes: 4 additions & 5 deletions va/va_enc_av1.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ typedef union _VAConfigAttribValEncAV1Ext1 {
*/
uint32_t interpolation_filter : 5;
/**
* \brief Min segmentId block size accepted.
* \brief segmentId block size accepted.
* Application need to send seg_id_block_size in PPS equal or larger than this value.
* one bit represent one block size defined as VA_SEGID_BLOCKXXXX
* should be (1 << VA_SEGID_BLOCKXXX | 1 << VA_SEGID_BLOCKXXX ... )
*/
uint32_t min_segid_block_size_accepted : 8;
/**
Expand Down Expand Up @@ -667,10 +669,7 @@ typedef struct _VAEncPictureParameterBufferAV1 {
} picture_flags;

/** \brief Block size for each Segment ID in Segment Map.
* 0: 16x16 block size, default value;
* 1: 32x32 block size;
* 2: 64x64 block size;
* 3: 8x8 block size.
* should be \c VA_SEGID_BLOCK_XXXX;
*/
uint8_t seg_id_block_size;

Expand Down
36 changes: 35 additions & 1 deletion va/va_enc_vp9.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,16 @@ 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.
* value should be VA_SEGID_BLOCK_XXX
*/
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[VA_PADDING_MEDIUM - 1];
} VAEncPictureParameterBufferVP9;


Expand Down Expand Up @@ -594,6 +602,32 @@ typedef struct _VAEncMiscParameterTypeVP9PerSegmantParam {
*/


/** \brief Attribute value for VAConfigAttribEncVP9. */
typedef union _VAConfigAttribValEncVP9 {
struct {
/**
* \brief segmentId block size accepted.
* This is the granularity of segmentation map.
* one bit represent one block size defined as VA_SEGID_BLOCKXXXX
* should be (1 << VA_SEGID_BLOCKXXX | 1 << VA_SEGID_BLOCKXXX ... )
*/
uint32_t seg_id_block_size : 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
Expand Down
1 change: 1 addition & 0 deletions va/va_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const char *vaConfigAttribTypeStr(VAConfigAttribType configAttribType)
TOSTR(VAConfigAttribEncPerBlockControl);
TOSTR(VAConfigAttribEncMaxTileRows);
TOSTR(VAConfigAttribEncMaxTileCols);
TOSTR(VAConfigAttribEncVP9);
case VAConfigAttribTypeMax:
break;
}
Expand Down

0 comments on commit 85a180c

Please sign in to comment.