video: driver: Add HFI and internal buffer changes for AV1 DRAP
Add changes for AV1 DRAP (Delayed Random Access Point) handling: 1) Add config in kalama database to control DRAP and the HFI property to set DRAP config. 2) Update buffer calculations: - When DRAP is disabled, COMV buffer must be allocated and PERSIST buffer must be allocated with total_ref_count = 0 - When DRAP is enabled, COMV buffer must not be allocated - it is part of PERSIST buffer. Persist buffer must be allocated with the max_width, max_height and total_ref_count configured for DRAP. Change-Id: I2d2e8fd3f63ea8f9fc2845acd0b4e16ba4776a6b Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
This commit is contained in:
@@ -880,6 +880,17 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes) \
|
||||
#define AV1D_LCU_MIN_SIZE_PELS 64
|
||||
#define AV1D_MAX_TILE_COLS 64
|
||||
|
||||
#define HFI_BUFFER_COMV_AV1D(_size, frame_width, frame_height, \
|
||||
_yuv_bufcount_min) \
|
||||
do { \
|
||||
_size = 2 * HFI_ALIGN(MAX(((frame_width + 63) / 64) * \
|
||||
((frame_height + 63) / 64) * 512, \
|
||||
((frame_width + 127) / 128) * \
|
||||
((frame_height + 127) / 128) * 2816), \
|
||||
VENUS_DMA_ALIGNMENT); \
|
||||
_size *= _yuv_bufcount_min; \
|
||||
} while (0)
|
||||
|
||||
#define SIZE_AV1D_LB_FE_TOP_DATA(frame_width, frame_height) \
|
||||
(HFI_ALIGN(frame_width, AV1D_LCU_MAX_SIZE_PELS) * ((16 * 10) >> 3) + \
|
||||
HFI_ALIGN(frame_width, AV1D_LCU_MAX_SIZE_PELS) / 2 * ((16 * 6) >> 3) * 2)
|
||||
@@ -1135,15 +1146,18 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes) \
|
||||
(((8192 + 127) / 128) * ((4352 + 127) / 128) * \
|
||||
AV1D_SIZE_BSE_COL_MV_128x128))
|
||||
|
||||
#define HFI_BUFFER_PERSIST_AV1D(_size) \
|
||||
#define HFI_BUFFER_PERSIST_AV1D(_size, max_width, max_height, total_ref_count) \
|
||||
do \
|
||||
{ \
|
||||
_size = HFI_ALIGN(SIZE_AV1D_SEQUENCE_HEADER * 2 + \
|
||||
SIZE_AV1D_METADATA + \
|
||||
HFI_U32 comv_size; \
|
||||
HFI_BUFFER_COMV_AV1D(comv_size, max_width, max_height, total_ref_count); \
|
||||
_size = \
|
||||
HFI_ALIGN((SIZE_AV1D_SEQUENCE_HEADER * 2 + \
|
||||
SIZE_AV1D_METADATA + \
|
||||
AV1D_NUM_HW_PIC_BUF * (SIZE_AV1D_TILE_OFFSET + SIZE_AV1D_QM) + \
|
||||
AV1D_NUM_FRAME_HEADERS * (SIZE_AV1D_FRAME_HEADER + \
|
||||
2 * SIZE_AV1D_PROB_TABLE) + \
|
||||
AV1D_NUM_HW_PIC_BUF * 2 * SIZE_AV1D_COL_MV, VENUS_DMA_ALIGNMENT); \
|
||||
2 * SIZE_AV1D_PROB_TABLE) + \
|
||||
comv_size), VENUS_DMA_ALIGNMENT); \
|
||||
} while (0)
|
||||
|
||||
#define HFI_BUFFER_BITSTREAM_ENC(size, frame_width, frame_height, \
|
||||
|
Reference in New Issue
Block a user