video: driver: fix encoder output buffer size requirement
For some resolutions memory requirement was coming as 4 * yuv_size and for CQ/RC_OFF it was 8 * yuv_size. With this fix it will be max 2 * yuv_size (+ 25% for 10 bit). Fix typo in 720P resolution check. Change-Id: Ib5908f1eef8dca92dac46c5c195cd47ba28a4df4 Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
This commit is contained in:

committed by
Ashish Patil

parent
ec161663ce
commit
7d00efc5dc
@@ -1177,23 +1177,26 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes) \
|
||||
rc_type, is_ten_bit) \
|
||||
do \
|
||||
{ \
|
||||
HFI_U32 aligned_width, aligned_height, bitstream_size; \
|
||||
HFI_U32 aligned_width, aligned_height, bitstream_size, yuv_size; \
|
||||
aligned_width = HFI_ALIGN(frame_width, 32); \
|
||||
aligned_height = HFI_ALIGN(frame_height, 32); \
|
||||
bitstream_size = aligned_width * aligned_height * 3; \
|
||||
yuv_size = (aligned_width * aligned_height * 3) >> 1; \
|
||||
if (aligned_width * aligned_height > (4096 * 2176)) \
|
||||
{ \
|
||||
/* bitstream_size = 0.25 * yuv_size; */ \
|
||||
bitstream_size = (bitstream_size >> 3); \
|
||||
} \
|
||||
else if (bitstream_size > (1280 * 720)) \
|
||||
else if (aligned_width * aligned_height > (1280 * 720)) \
|
||||
{ \
|
||||
/* bitstream_size = 0.5 * yuv_size; */ \
|
||||
bitstream_size = (bitstream_size >> 2); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
bitstream_size = (bitstream_size << 1);\
|
||||
/* bitstream_size = 2 * yuv_size; */ \
|
||||
} \
|
||||
if ((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) \
|
||||
if (((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) && (bitstream_size < yuv_size)) \
|
||||
{ \
|
||||
bitstream_size = (bitstream_size << 1);\
|
||||
} \
|
||||
|
Reference in New Issue
Block a user