diff --git a/driver/variant/iris3/inc/hfi_buffer_iris3.h b/driver/variant/iris3/inc/hfi_buffer_iris3.h index 8064b47833..4043d09a49 100644 --- a/driver/variant/iris3/inc/hfi_buffer_iris3.h +++ b/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);\ } \