소스 검색

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 <[email protected]>
Mahesh Kumar Sharma 2 년 전
부모
커밋
7d00efc5dc
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      driver/variant/iris3/inc/hfi_buffer_iris3.h

+ 7 - 4
driver/variant/iris3/inc/hfi_buffer_iris3.h

@@ -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);\
 		} \