Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encode segmentation map refine #744

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions va/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion va/va_enc_av1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any value is ok? or backend driver only accept part of them? if so , may need a capability attributes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Av1 does have a caps report for it. https://github.com/intel/libva/blob/02eed8a57faadcd7f0e5e999723286ed160bd2bd/va/va_enc_av1.h#L154C18-L154C47
This change in comment is for interface completeness. In av1 spec, 4x4 block is allowed.
From av1 spec: Segmentation map
A 3-bit number containing the segment affiliation for each 4x4 block in the image.

*/
uint8_t seg_id_block_size;

Expand Down
37 changes: 36 additions & 1 deletion va/va_enc_vp9.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
leyu-yao marked this conversation as resolved.
Show resolved Hide resolved

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;


Expand Down Expand Up @@ -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;
leyu-yao marked this conversation as resolved.
Show resolved Hide resolved

/**@}*/

#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 @@ -149,6 +149,7 @@ const char *vaConfigAttribTypeStr(VAConfigAttribType configAttribType)
TOSTR(VAConfigAttribEncAV1Ext1);
TOSTR(VAConfigAttribEncAV1Ext2);
TOSTR(VAConfigAttribEncPerBlockControl);
TOSTR(VAConfigAttribEncVP9);
case VAConfigAttribTypeMax:
break;
}
Expand Down