Przeglądaj źródła

video: driver: enclosed macros with complex values within bracket

This is resolve some of this kind of checker err.

Change-Id: Ief665e17045c3b6a6ff636ab6404c6e0c93e9460
Signed-off-by: Ankush Mitra <[email protected]>
Ankush Mitra 2 lat temu
rodzic
commit
542b9f9736

+ 13 - 24
driver/platform/kalama/inc/kalama_technology.h

@@ -11,8 +11,7 @@
  * Chipset Generation Technology: SW/FW overhead profiling
  * need update with new numbers
  */
-static u32 frequency_table_kalama[2][6] =
-{
+static u32 frequency_table_kalama[2][6] = {
 	/* //make lowsvs_D1 as invalid; */
 	{533, 444, 366, 338, 240, 0},
 	{800, 666, 549, 507, 360, 0},
@@ -31,13 +30,13 @@ static u32 frequency_table_kalama[2][6] =
 #define DECODER_VPPVSP1STAGE_FW_OVERHEAD_KALAMA                                         93000
 
 #define DECODER_VSP_FW_OVERHEAD_KALAMA \
-	DECODER_VPPVSP1STAGE_FW_OVERHEAD_KALAMA - DECODER_VPP_FW_OVERHEAD_KALAMA
+	(DECODER_VPPVSP1STAGE_FW_OVERHEAD_KALAMA - DECODER_VPP_FW_OVERHEAD_KALAMA)
 
 /* Tensilica cycles; encoder has ARP register */
 #define ENCODER_VPP_FW_OVERHEAD_KALAMA                                                  48405
 
 #define ENCODER_VPPVSP1STAGE_FW_OVERHEAD_KALAMA \
-	ENCODER_VPP_FW_OVERHEAD_KALAMA + DECODER_VSP_FW_OVERHEAD_KALAMA
+	(ENCODER_VPP_FW_OVERHEAD_KALAMA + DECODER_VSP_FW_OVERHEAD_KALAMA)
 
 #define DECODER_SW_OVERHEAD_KALAMA                                                      489583
 #define ENCODER_SW_OVERHEAD_KALAMA                                                      489583
@@ -50,8 +49,7 @@ static u32 decoder_vpp_target_clk_per_mb_kalama = 200;
  * These pipe penalty numbers only applies to 4 pipe
  * For 2pipe and 1pipe, these numbers need recalibrate
  */
-static u32 pipe_penalty_kalama[3][3] =
-{
+static u32 pipe_penalty_kalama[3][3] = {
 	/* NON AV1 */
 	{1059, 1059, 1059},
 	/* AV1 RECOMMENDED TILE 1080P_V2XH1, UHD_V2X2, 8KUHD_V8X2 */
@@ -65,8 +63,7 @@ static u32 pipe_penalty_kalama[3][3] =
  * HW limit bitrate table (these values are measured end to end fw/sw impacts are also considered)
  * TODO Can we convert to Cycles/MB? This will remove DIVISION.
  */
-static u32 bitrate_table_kalama_2stage_fp[5][10] =
-{
+static u32 bitrate_table_kalama_2stage_fp[5][10] = {
 	/* h264 cavlc */
 	{0, 220, 220, 220, 220, 220, 220, 220, 220, 220},
 	/* h264 cabac */
@@ -80,8 +77,7 @@ static u32 bitrate_table_kalama_2stage_fp[5][10] =
 };
 
 /* HW limit bitrate table (these values are measured end to end fw/sw impacts are also considered) */
-static u32 bitrate_table_kalama_1stage_fp[5][10] = /* 1-stage assume IPPP */
-{
+static u32 bitrate_table_kalama_1stage_fp[5][10] = { /* 1-stage assume IPPP */
 	/* h264 cavlc */
 	{0, 220, 220, 220, 220, 220, 220, 220, 220, 220},
 	/* h264 cabac */
@@ -95,8 +91,7 @@ static u32 bitrate_table_kalama_1stage_fp[5][10] = /* 1-stage assume IPPP */
 };
 
 /* rec pwc and power bitrate table */
-static u32 bitrate_table_kalama_rec_fp[5][10] =
-{
+static u32 bitrate_table_kalama_rec_fp[5][10] = {
 	/* rec. worst bitrate based on bitrate table */
 #if ENABLE_FINEBITRATE_SUBUHD60
 	/* h264 cavlc */
@@ -149,8 +144,7 @@ static u32 fp_pixel_count_bar9 = 1280 * 720 * 30;
 static u32 codec_encoder_gop_complexity_table_fp[8][3];
 static u32 codec_mbspersession_kalama;
 
-static u32 cr_table_basic_kalama[7][4] =
-{
+static u32 cr_table_basic_kalama[7][4] = {
 	{1920, 1080, 20, 40},
 	{3840, 2160, 42, 84},
 	{4096, 2160, 44, 88},
@@ -161,8 +155,7 @@ static u32 cr_table_basic_kalama[7][4] =
 };
 
 /* 100x */
-static u32 dpbopb_ubwc30_cr_table_cratio_kalama[7][12] =
-{
+static u32 dpbopb_ubwc30_cr_table_cratio_kalama[7][12] = {
 	{237, 399, 272, 137, 225, 158, 185, 259, 203, 138, 167, 152},
 	{269, 404, 302, 202, 367, 238, 210, 299, 232, 134, 181, 149},
 	{269, 404, 302, 202, 367, 238, 210, 299, 232, 134, 181, 149},
@@ -173,8 +166,7 @@ static u32 dpbopb_ubwc30_cr_table_cratio_kalama[7][12] =
 };
 
 /* 100x */
-static u32 rpb_ubwc30_cr_table_cratio_kalama[7][12] =
-{
+static u32 rpb_ubwc30_cr_table_cratio_kalama[7][12] = {
 	{193, 294, 218, 135, 214, 155, 175, 241, 191, 139, 162, 149},
 	{285, 406, 316, 207, 373, 243, 201, 280, 221, 139, 177, 152},
 	{285, 406, 316, 207, 373, 243, 201, 280, 221, 139, 177, 152},
@@ -185,8 +177,7 @@ static u32 rpb_ubwc30_cr_table_cratio_kalama[7][12] =
 };
 
 /* 100x */
-static u32 ipblossy_ubwc30_cr_table_cratio_kalama[7][12] =
-{
+static u32 ipblossy_ubwc30_cr_table_cratio_kalama[7][12] = {
 	{215, 215, 215, 174, 174, 174, 266, 266, 266, 231, 231, 231},
 	{254, 254, 254, 219, 219, 219, 292, 292, 292, 249, 249, 249},
 	{254, 254, 254, 219, 219, 219, 292, 292, 292, 249, 249, 249},
@@ -197,8 +188,7 @@ static u32 ipblossy_ubwc30_cr_table_cratio_kalama[7][12] =
 };
 
 /* 100x */
-static u32 ipblossless_ubwc30_cr_table_cratio_kalama[7][12] =
-{
+static u32 ipblossless_ubwc30_cr_table_cratio_kalama[7][12] = {
 	{185, 215, 194, 147, 178, 159, 162, 181, 169, 138, 161, 146},
 	{186, 217, 195, 151, 183, 161, 164, 182, 170, 140, 168, 148},
 	{186, 217, 195, 151, 183, 161, 164, 182, 170, 140, 168, 148},
@@ -213,8 +203,7 @@ static u32 en_original_compression_factor_rgba_pwd_kalama = 243;
 /* 100x */
 static u32 en_original_compression_factor_rgba_avg_kalama = 454;
 
-static u32 av1_num_tiles_kalama[7][3] =
-{
+static u32 av1_num_tiles_kalama[7][3] = {
 	{2, 1, 1},
 	{4, 2, 2},
 	{4, 2, 2},

+ 13 - 24
driver/platform/pineapple/inc/pineapple_technology.h

@@ -11,8 +11,7 @@
  * Chipset Generation Technology: SW/FW overhead profiling
  * need update with new numbers
  */
-static u32 frequency_table_pineapple[2][6] =
-{
+static u32 frequency_table_pineapple[2][6] = {
 	/* //make lowsvs_D1 as invalid; */
 	{533, 480, 435, 380, 300, 196},
 	{840, 720, 652, 570, 450, 294},
@@ -35,13 +34,13 @@ static u32 frequency_table_pineapple[2][6] =
 #define DECODER_VPPVSP1STAGE_FW_OVERHEAD_PINEAPPLE                                         (93000)
 
 #define DECODER_VSP_FW_OVERHEAD_PINEAPPLE \
-	DECODER_VPPVSP1STAGE_FW_OVERHEAD_PINEAPPLE - DECODER_VPP_FW_OVERHEAD_PINEAPPLE
+	(DECODER_VPPVSP1STAGE_FW_OVERHEAD_PINEAPPLE - DECODER_VPP_FW_OVERHEAD_PINEAPPLE)
 
 /* Tensilica cycles; encoder has ARP register */
 #define ENCODER_VPP_FW_OVERHEAD_PINEAPPLE                                                  (69000*3/2)
 
 #define ENCODER_VPPVSP1STAGE_FW_OVERHEAD_PINEAPPLE \
-	ENCODER_VPP_FW_OVERHEAD_PINEAPPLE + DECODER_VSP_FW_OVERHEAD_PINEAPPLE
+	(ENCODER_VPP_FW_OVERHEAD_PINEAPPLE + DECODER_VSP_FW_OVERHEAD_PINEAPPLE)
 
 #define DECODER_SW_OVERHEAD_PINEAPPLE                                                      (489583)
 #define ENCODER_SW_OVERHEAD_PINEAPPLE                                                      (489583)
@@ -54,8 +53,7 @@ static u32 decoder_vpp_target_clk_per_mb_pineapple = 200;
  * These pipe penalty numbers only applies to 4 pipe
  * For 2pipe and 1pipe, these numbers need recalibrate
  */
-static u32 pipe_penalty_pineapple[3][3] =
-{
+static u32 pipe_penalty_pineapple[3][3] = {
 	/* NON AV1 */
 	{1059, 1059, 1059},
 	/* AV1 RECOMMENDED TILE 1080P_V2XH1, UHD_V2X2, 8KUHD_V8X2 */
@@ -69,8 +67,7 @@ static u32 pipe_penalty_pineapple[3][3] =
  * HW limit bitrate table (these values are measured end to end fw/sw impacts are also considered)
  * TODO Can we convert to Cycles/MB? This will remove DIVISION.
  */
-static u32 bitrate_table_pineapple_2stage_fp[5][10] =
-{
+static u32 bitrate_table_pineapple_2stage_fp[5][10] = {
 	/* h264 cavlc */
 	{0, 220, 220, 220, 220, 220, 220, 220, 220, 220},
 	/* h264 cabac */
@@ -84,8 +81,7 @@ static u32 bitrate_table_pineapple_2stage_fp[5][10] =
 };
 
 /* HW limit bitrate table (these values are measured end to end fw/sw impacts are also considered) */
-static u32 bitrate_table_pineapple_1stage_fp[5][10] = /* 1-stage assume IPPP */
-{
+static u32 bitrate_table_pineapple_1stage_fp[5][10] = { /* 1-stage assume IPPP */
 	/* h264 cavlc */
 	{0, 220, 220, 220, 220, 220, 220, 220, 220, 220},
 	/* h264 cabac */
@@ -99,8 +95,7 @@ static u32 bitrate_table_pineapple_1stage_fp[5][10] = /* 1-stage assume IPPP */
 };
 
 /* rec pwc and power bitrate table */
-static u32 bitrate_table_pineapple_rec_fp[5][10] =
-{
+static u32 bitrate_table_pineapple_rec_fp[5][10] = {
 	/* rec. worst bitrate based on bitrate table */
 #if ENABLE_FINEBITRATE_SUBUHD60
 	/* h264 cavlc */
@@ -153,8 +148,7 @@ static u32 fp_pixel_count_bar9 = 1280 * 720 * 30;
 static u32 codec_encoder_gop_complexity_table_fp[8][3];
 static u32 codec_mbspersession_pineaple;
 
-static u32 cr_table_basic_pineapple[7][4] =
-{
+static u32 cr_table_basic_pineapple[7][4] = {
 	{1920, 1080, 20, 40},
 	{3840, 2160, 42, 84},
 	{4096, 2160, 44, 88},
@@ -165,8 +159,7 @@ static u32 cr_table_basic_pineapple[7][4] =
 };
 
 /* 100x */
-static u32 dpbopb_ubwc30_cr_table_cratio_pineapple[7][12] =
-{
+static u32 dpbopb_ubwc30_cr_table_cratio_pineapple[7][12] = {
 	{237, 399, 272, 137, 225, 158, 185, 259, 203, 138, 167, 152},
 	{269, 404, 302, 202, 367, 238, 210, 299, 232, 134, 181, 149},
 	{269, 404, 302, 202, 367, 238, 210, 299, 232, 134, 181, 149},
@@ -177,8 +170,7 @@ static u32 dpbopb_ubwc30_cr_table_cratio_pineapple[7][12] =
 };
 
 /* 100x */
-static u32 rpb_ubwc30_cr_table_cratio_pineapple[7][12] =
-{
+static u32 rpb_ubwc30_cr_table_cratio_pineapple[7][12] = {
 	{193, 294, 218, 135, 214, 155, 175, 241, 191, 139, 162, 149},
 	{285, 406, 316, 207, 373, 243, 201, 280, 221, 139, 177, 152},
 	{285, 406, 316, 207, 373, 243, 201, 280, 221, 139, 177, 152},
@@ -189,8 +181,7 @@ static u32 rpb_ubwc30_cr_table_cratio_pineapple[7][12] =
 };
 
 /* 100x */
-static u32 ipblossy_ubwc30_cr_table_cratio_pineapple[7][12] =
-{
+static u32 ipblossy_ubwc30_cr_table_cratio_pineapple[7][12] = {
 	{215, 215, 215, 174, 174, 174, 266, 266, 266, 231, 231, 231},
 	{254, 254, 254, 219, 219, 219, 292, 292, 292, 249, 249, 249},
 	{254, 254, 254, 219, 219, 219, 292, 292, 292, 249, 249, 249},
@@ -201,8 +192,7 @@ static u32 ipblossy_ubwc30_cr_table_cratio_pineapple[7][12] =
 };
 
 /* 100x */
-static u32 ipblossless_ubwc30_cr_table_cratio_pineapple[7][12] =
-{
+static u32 ipblossless_ubwc30_cr_table_cratio_pineapple[7][12] = {
 	{185, 215, 194, 147, 178, 159, 162, 181, 169, 138, 161, 146},
 	{186, 217, 195, 151, 183, 161, 164, 182, 170, 140, 168, 148},
 	{186, 217, 195, 151, 183, 161, 164, 182, 170, 140, 168, 148},
@@ -217,8 +207,7 @@ static u32 en_original_compression_factor_rgba_pwd_pineapple = 243;
 /* 100x */
 static u32 en_original_compression_factor_rgba_avg_pineapple = 454;
 
-static u32 av1_num_tiles_pineapple[7][3] =
-{
+static u32 av1_num_tiles_pineapple[7][3] = {
 	{2, 1, 1},
 	{4, 2, 2},
 	{4, 2, 2},

+ 59 - 91
driver/variant/iris2/inc/hfi_buffer_iris2.h

@@ -58,18 +58,18 @@ typedef HFI_U32 HFI_BOOL;
 #define HFI_COLOR_FORMAT_RGBA8888_UBWC_TILE_WIDTH (16)
 
 #define HFI_NV12_IL_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width, stride_multiple)
+	(stride = HFI_ALIGN(frame_width, stride_multiple))
 
 #define HFI_NV12_IL_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
-	min_buf_height_multiple) buf_height = HFI_ALIGN(frame_height, \
-	min_buf_height_multiple)
+	min_buf_height_multiple) (buf_height = HFI_ALIGN(frame_height, \
+	min_buf_height_multiple))
 
 #define HFI_NV12_IL_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width, stride_multiple)
+	(stride = HFI_ALIGN(frame_width, stride_multiple))
 
 #define HFI_NV12_IL_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
-	min_buf_height_multiple) buf_height = HFI_ALIGN(((frame_height + 1) \
-	 >> 1),	min_buf_height_multiple)
+	min_buf_height_multiple) (buf_height = HFI_ALIGN(((frame_height + 1) \
+	 >> 1),	min_buf_height_multiple))
 
 #define HFI_NV12_IL_CALC_BUF_SIZE(buf_size, y_bufSize, y_stride, y_buf_height, \
 	uv_buf_size, uv_stride, uv_buf_height) \
@@ -78,11 +78,11 @@ typedef HFI_U32 HFI_BOOL;
 	buf_size = HFI_ALIGN(y_bufSize + uv_buf_size, HFI_ALIGNMENT_4096)
 
 #define HFI_NV12_UBWC_IL_CALC_Y_BUF_SIZE(y_bufSize, y_stride, y_buf_height) \
-	y_bufSize = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096)
+	(y_bufSize = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_UV_BUF_SIZE(uv_buf_size, \
 	uv_stride, uv_buf_height) \
-	uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096)
+	(uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(buf_size,\
 	frame_width, frame_height, y_stride_multiple,\
@@ -130,7 +130,7 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_YUV420_TP10_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
 	stride = HFI_ALIGN(frame_width, 192); \
@@ -138,8 +138,8 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
-			min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
+			min_buf_height_multiple))
 
 #define HFI_YUV420_TP10_CALC_BUF_SIZE(buf_size, y_buf_size, y_stride,\
 		y_buf_height, uv_buf_size, uv_stride, uv_buf_height) \
@@ -149,11 +149,11 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_UBWC_CALC_Y_BUF_SIZE(y_buf_size, y_stride, \
 					y_buf_height) \
-	y_buf_size = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096)
+	(y_buf_size = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_YUV420_TP10_UBWC_CALC_UV_BUF_SIZE(uv_buf_size, uv_stride, \
 					uv_buf_height) \
-	uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096)
+	(uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(buf_size, y_stride, y_buf_height, \
 	uv_stride, uv_buf_height, y_md_stride, y_md_height, uv_md_stride, \
@@ -173,19 +173,19 @@ typedef HFI_U32 HFI_BOOL;
 	} while (0)
 
 #define HFI_YUV420_P010_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width * 2, stride_multiple)
+	(stride = HFI_ALIGN(frame_width * 2, stride_multiple))
 
 #define HFI_YUV420_P010_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_YUV420_P010_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width * 2, stride_multiple)
+	(stride = HFI_ALIGN(frame_width * 2, stride_multiple))
 
 #define HFI_YUV420_P010_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
-			min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
+			min_buf_height_multiple))
 
 #define HFI_YUV420_P010_CALC_BUF_SIZE(buf_size, y_data_size, y_stride, \
 	y_buf_height, uv_data_size, uv_stride, uv_buf_height) \
@@ -198,30 +198,30 @@ typedef HFI_U32 HFI_BOOL;
 	} while (0)
 
 #define HFI_RGB888_CALC_STRIDE(stride, frame_width, stride_multiple) \
-	stride = ((frame_width * 3) + stride_multiple - 1) & \
-			 (0xffffffff - (stride_multiple - 1))
+	(stride = ((frame_width * 3) + stride_multiple - 1) & \
+			 (0xffffffff - (stride_multiple - 1)))
 
 #define HFI_RGB888_CALC_BUFHEIGHT(buf_height, frame_height, \
 			min_buf_height_multiple) \
-	buf_height = ((frame_height + min_buf_height_multiple - 1) & \
-			(0xffffffff - (min_buf_height_multiple - 1)))
+	(buf_height = ((frame_height + min_buf_height_multiple - 1) & \
+			(0xffffffff - (min_buf_height_multiple - 1))))
 
 #define HFI_RGB888_CALC_BUF_SIZE(buf_size, stride, buf_height) \
-	buf_size = ((stride) * (buf_height))
+	(buf_size = ((stride) * (buf_height)))
 
 #define HFI_RGBA8888_CALC_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN((frame_width << 2), stride_multiple)
+	(stride = HFI_ALIGN((frame_width << 2), stride_multiple))
 
 #define HFI_RGBA8888_CALC_BUFHEIGHT(buf_height, frame_height, \
 			min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_RGBA8888_CALC_BUF_SIZE(buf_size, stride, buf_height) \
 	buf_size = (stride) * (buf_height)
 
 #define HFI_RGBA8888_UBWC_CALC_DATA_PLANE_BUF_SIZE(buf_size, stride, \
 				buf_height) \
-	buf_size = HFI_ALIGN((stride) * (buf_height), HFI_ALIGNMENT_4096)
+	(buf_size = HFI_ALIGN((stride) * (buf_height), HFI_ALIGNMENT_4096))
 
 #define HFI_RGBA8888_UBWC_BUF_SIZE(buf_size, data_buf_size, \
 	metadata_buffer_size, stride, buf_height, _metadata_tride, \
@@ -447,8 +447,7 @@ typedef HFI_U32 HFI_BOOL;
 			VENUS_DMA_ALIGNMENT) * 2 + HFI_ALIGN(SIZE_H264D_QP\
 			(frame_width, frame_height), VENUS_DMA_ALIGNMENT); \
 		_size = HFI_ALIGN(_size, VENUS_DMA_ALIGNMENT); \
-		if (is_opb) \
-		{ \
+		if (is_opb) { \
 			SIZE_VPSS_LB(vpss_lb_size, frame_width, frame_height, \
 						num_vpp_pipes); \
 		} \
@@ -487,8 +486,7 @@ typedef HFI_U32 HFI_BOOL;
 				BUFFER_ALIGNMENT_16_BYTES);\
 		HFI_U32 n_aligned_h = HFI_ALIGN(frame_height, \
 				BUFFER_ALIGNMENT_16_BYTES); \
-		if (!is_interlaced)  \
-		{ \
+		if (!is_interlaced)  { \
 			SIZE_H264D_HW_BIN_BUFFER(_size, n_aligned_w, \
 				n_aligned_h, delay, num_vpp_pipes); \
 		}     \
@@ -684,13 +682,11 @@ typedef HFI_U32 HFI_BOOL;
 				BUFFER_ALIGNMENT_16_BYTES); \
 		HFI_U32 n_aligned_h = HFI_ALIGN(frame_height, \
 				BUFFER_ALIGNMENT_16_BYTES); \
-		if (!is_interlaced) \
-		{ \
+		if (!is_interlaced) { \
 			SIZE_H265D_HW_BIN_BUFFER(_size, n_aligned_w, \
 			n_aligned_h, delay, num_vpp_pipes); \
 		} \
-		else \
-		{ \
+		else { \
 			_size = 0; \
 		} \
 	} while (0)
@@ -848,8 +844,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		VENUS_DMA_ALIGNMENT) + \
 		HFI_ALIGN(SIZE_MP2D_LB_FE_TOP_DATA(frame_width, frame_height), \
 		VENUS_DMA_ALIGNMENT); \
-		if (is_opb) \
-		{ \
+		if (is_opb) { \
 			SIZE_VPSS_LB(vpss_lb_size, frame_width, frame_height, \
 						num_vpp_pipes); \
 		} \
@@ -870,24 +865,19 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		aligned_width = HFI_ALIGN(frame_width, 32); \
 		aligned_height = HFI_ALIGN(frame_height, 32); \
 		bitstream_size = aligned_width * aligned_height * 3; \
-		if (aligned_width * aligned_height > (4096 * 2176)) \
-		{ \
+		if (aligned_width * aligned_height > (4096 * 2176)) { \
 			bitstream_size = (bitstream_size >> 3); \
 		} \
-		else if (bitstream_size > (1280 * 720)) \
-		{ \
+		else if (bitstream_size > (1280 * 720)) { \
 			bitstream_size = (bitstream_size >> 2); \
 		} \
-		else \
-		{ \
+		else { \
 			bitstream_size = (bitstream_size << 1);\
 		} \
-		if ((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF))  \
-		{ \
+		if ((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF))  { \
 			bitstream_size = (bitstream_size << 1);\
 		} \
-		if (is_ten_bit) \
-		{ \
+		if (is_ten_bit) { \
 			bitstream_size = (bitstream_size) + \
 					(bitstream_size >> 2); \
 		} \
@@ -912,8 +902,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				is_roi_enabled, lcu_size) \
 	do { \
 		HFI_U32 roi_size = 0; \
-		if (is_roi_enabled) \
-		{ \
+		if (is_roi_enabled) { \
 			SIZE_ROI_METADATA_ENC(roi_size, frame_width, \
 				frame_height, lcu_size); \
 		} \
@@ -960,8 +949,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 num_ref = 1; \
 		if (n_bframe) \
 			num_ref = 2; \
-		if (_total_hp_layers > 1) \
-		{ \
+		if (_total_hp_layers > 1) { \
 			if (hybrid_hp) \
 				num_ref = (_total_hp_layers + 1) >> 1; \
 			else if (codec_standard == HFI_CODEC_ENCODE_HEVC) \
@@ -974,8 +962,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		} \
 		if (ltr_count) \
 			num_ref = num_ref + ltr_count; \
-		if (_total_hb_layers > 1) \
-		{ \
+		if (_total_hb_layers > 1) { \
 			if (codec_standard == HFI_CODEC_ENCODE_HEVC) \
 				num_ref = (_total_hb_layers); \
 			else if (codec_standard == HFI_CODEC_ENCODE_AVC) \
@@ -991,8 +978,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 bitstream_size_eval = 0; \
 		size_aligned_width = HFI_ALIGN((frame_width), lcu_size); \
 		size_aligned_height = HFI_ALIGN((frame_height), lcu_size); \
-		if (work_mode == HFI_WORKMODE_2) \
-		{ \
+		if (work_mode == HFI_WORKMODE_2) { \
 			if ((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) \
 			{ \
 				bitstream_size_eval = (((size_aligned_width) * \
@@ -1002,27 +988,23 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			{ \
 				bitstream_size_eval = ((size_aligned_width) * \
 							(size_aligned_height) * 3); \
-				if (rc_type == HFI_RC_LOSSLESS) \
-				{ \
+				if (rc_type == HFI_RC_LOSSLESS) { \
 					bitstream_size_eval = (bitstream_size_eval * 3 >> 2); \
 				} \
 				else if ((size_aligned_width * size_aligned_height) > \
-					(4096 * 2176)) \
-				{ \
+					(4096 * 2176)) { \
 					bitstream_size_eval >>= 3; \
 				} \
-				else if ((size_aligned_width * size_aligned_height) > (480 * 320)) \
-				{ \
+				else if ((size_aligned_width * size_aligned_height) > \
+					(480 * 320)) { \
 					bitstream_size_eval >>= 2; \
 				} \
-				if (lcu_size == 32) \
-				{ \
+				if (lcu_size == 32) { \
 					bitstream_size_eval = (bitstream_size_eval * 5 >> 2); \
 				} \
 			} \
 		} \
-		else \
-		{ \
+		else { \
 			bitstream_size_eval = size_aligned_width * \
 					size_aligned_height * 3; \
 		} \
@@ -1038,20 +1020,16 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		size_aligned_width = HFI_ALIGN((frame_width), lcu_size); \
 		size_aligned_height = HFI_ALIGN((frame_height), lcu_size); \
 		if ((size_aligned_width * size_aligned_height) > \
-			(3840 * 2160)) \
-		{ \
+			(3840 * 2160)) { \
 			size_single_pipe_eval = (bitbin_size / num_vpp_pipes); \
 		} \
-		else if (num_vpp_pipes > 2) \
-		{ \
+		else if (num_vpp_pipes > 2) { \
 			size_single_pipe_eval = bitbin_size / 2; \
 		} \
-		else \
-		{ \
+		else { \
 			size_single_pipe_eval = bitbin_size; \
 		} \
-		if (rc_type == HFI_RC_LOSSLESS) \
-		{ \
+		if (rc_type == HFI_RC_LOSSLESS) { \
 			size_single_pipe_eval = (size_single_pipe_eval << 1); \
 		} \
 		sao_bin_buffer_size = (64 * ((((frame_width) + \
@@ -1072,20 +1050,17 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			size_single_pipe = 0, bitbin_size = 0; \
 		SIZE_BIN_BITSTREAM_ENC(bitstream_size, rc_type, frame_width, \
 			frame_height, work_mode, lcu_size);         \
-		if (work_mode == HFI_WORKMODE_2) \
-		{ \
+		if (work_mode == HFI_WORKMODE_2) { \
 			total_bitbin_buffers = 3; \
 			bitbin_size = bitstream_size * 17 / 10; \
 			bitbin_size = HFI_ALIGN(bitbin_size, \
 				VENUS_DMA_ALIGNMENT); \
 		} \
-		else if ((lcu_size == 16) || (num_vpp_pipes > 1)) \
-		{ \
+		else if ((lcu_size == 16) || (num_vpp_pipes > 1)) { \
 			total_bitbin_buffers = 1; \
 			bitbin_size = bitstream_size; \
 		} \
-		if (total_bitbin_buffers > 0) \
-		{ \
+		if (total_bitbin_buffers > 0) { \
 			SIZE_ENC_SINGLE_PIPE(size_single_pipe, rc_type, bitbin_size, \
 				num_vpp_pipes, frame_width, frame_height, lcu_size); \
 			bitbin_size = size_single_pipe * num_vpp_pipes; \
@@ -1093,10 +1068,8 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 					total_bitbin_buffers + 512; \
 		} \
 		else \
-		/* Avoid 512 Bytes allocation in case of 1Pipe HEVC Direct Mode*/\
-		{ \
+			/* Avoid 512 Bytes allocation in case of 1Pipe HEVC Direct Mode*/ \
 			_size = 0; \
-		} \
 	} while (0)
 
 #define HFI_BUFFER_BIN_H264E(_size, rc_type, frame_width, frame_height, \
@@ -1142,8 +1115,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			(((frame_height_coded) + \
 			(BUF_SIZE_ALIGN_32)) / BUF_SIZE_ALIGN_32 * 4 * 16) : \
 			(((frame_height_coded) + 15) / 16 * 5 * 16); \
-		if ((num_vpp_pipes_enc) > 1) \
-		{ \
+		if ((num_vpp_pipes_enc) > 1) { \
 			_size += BUFFER_ALIGNMENT_512_BYTES; \
 			_size = HFI_ALIGN(_size, BUFFER_ALIGNMENT_512_BYTES) *\
 				(num_vpp_pipes_enc); \
@@ -1208,8 +1180,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			(14 + ((((frame_height_coded) >> 5) + 7) >> 3))) : \
 			(256 + 16 * (14 + ((((frame_height_coded) >> 4) + 7) >> 3))); \
 		_size *= 11; \
-		if (num_vpp_pipes_enc > 1) \
-		{ \
+		if (num_vpp_pipes_enc > 1) { \
 			_size = HFI_ALIGN(_size, VENUS_DMA_ALIGNMENT) * \
 					num_vpp_pipes_enc;\
 		} \
@@ -1425,8 +1396,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 metadata_stride, metadata_buf_height, meta_size_y, \
 			meta_size_c; \
 		HFI_U32 ten_bit_ref_buf_size = 0, ref_buf_size = 0; \
-		if (!is_ten_bit) \
-		{ \
+		if (!is_ten_bit) { \
 			SIZE_ENC_REF_BUFFER(ref_buf_size, frame_width, \
 				frame_height); \
 			HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, \
@@ -1441,8 +1411,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				metadata_stride, metadata_buf_height); \
 			_size = ref_buf_size + meta_size_y + meta_size_c; \
 		} \
-		else \
-		{ \
+		else { \
 			SIZE_ENC_TEN_BIT_REF_BUFFER(ten_bit_ref_buf_size, \
 				frame_width, frame_height); \
 			HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, \
@@ -1473,8 +1442,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 #define HFI_BUFFER_VPSS_ENC(vpss_size, dswidth, dsheight, ds_enable, blur, is_ten_bit) \
 	do { \
 		vpss_size = 0; \
-		if (ds_enable || blur) \
-		{ \
+		if (ds_enable || blur) { \
 			HFI_BUFFER_DPB_ENC(vpss_size, dswidth, dsheight, is_ten_bit); \
 		} \
 	} while (0)

+ 78 - 116
driver/variant/iris3/inc/hfi_buffer_iris3.h

@@ -58,31 +58,31 @@ typedef HFI_U32 HFI_BOOL;
 #define HFI_COLOR_FORMAT_RGBA8888_UBWC_TILE_WIDTH (16)
 
 #define HFI_NV12_IL_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width, stride_multiple)
+	(stride = HFI_ALIGN(frame_width, stride_multiple))
 
 #define HFI_NV12_IL_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
-	min_buf_height_multiple) buf_height = HFI_ALIGN(frame_height, \
-	min_buf_height_multiple)
+	min_buf_height_multiple) (buf_height = HFI_ALIGN(frame_height, \
+	min_buf_height_multiple))
 
 #define HFI_NV12_IL_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
 	stride = HFI_ALIGN(frame_width, stride_multiple)
 
 #define HFI_NV12_IL_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
-	min_buf_height_multiple) buf_height = HFI_ALIGN(((frame_height + 1) \
-	 >> 1),	min_buf_height_multiple)
+	min_buf_height_multiple) (buf_height = HFI_ALIGN(((frame_height + 1) \
+	 >> 1),	min_buf_height_multiple))
 
 #define HFI_NV12_IL_CALC_BUF_SIZE(buf_size, y_bufSize, y_stride, y_buf_height, \
 	uv_buf_size, uv_stride, uv_buf_height) \
 	y_bufSize = (y_stride * y_buf_height); \
 	uv_buf_size = (uv_stride * uv_buf_height); \
-	buf_size = HFI_ALIGN(y_bufSize + uv_buf_size, HFI_ALIGNMENT_4096)
+	(buf_size = HFI_ALIGN(y_bufSize + uv_buf_size, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_Y_BUF_SIZE(y_bufSize, y_stride, y_buf_height) \
-	y_bufSize = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096)
+	(y_bufSize = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_UV_BUF_SIZE(uv_buf_size, \
 	uv_stride, uv_buf_height) \
-	uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096)
+	(uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(buf_size,\
 	frame_width, frame_height, y_stride_multiple,\
@@ -130,7 +130,7 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_YUV420_TP10_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
 	stride = HFI_ALIGN(frame_width, 192); \
@@ -138,8 +138,8 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
-			min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
+			min_buf_height_multiple))
 
 #define HFI_YUV420_TP10_CALC_BUF_SIZE(buf_size, y_buf_size, y_stride,\
 		y_buf_height, uv_buf_size, uv_stride, uv_buf_height) \
@@ -149,11 +149,11 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_UBWC_CALC_Y_BUF_SIZE(y_buf_size, y_stride, \
 					y_buf_height) \
-	y_buf_size = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096)
+	(y_buf_size = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_YUV420_TP10_UBWC_CALC_UV_BUF_SIZE(uv_buf_size, uv_stride, \
 					uv_buf_height) \
-	uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096)
+	(uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(buf_size, y_stride, y_buf_height, \
 	uv_stride, uv_buf_height, y_md_stride, y_md_height, uv_md_stride, \
@@ -173,19 +173,19 @@ typedef HFI_U32 HFI_BOOL;
 	} while (0)
 
 #define HFI_YUV420_P010_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width * 2, stride_multiple)
+	(stride = HFI_ALIGN(frame_width * 2, stride_multiple))
 
 #define HFI_YUV420_P010_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_YUV420_P010_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width * 2, stride_multiple)
+	(stride = HFI_ALIGN(frame_width * 2, stride_multiple))
 
 #define HFI_YUV420_P010_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
-			min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
+			min_buf_height_multiple))
 
 #define HFI_YUV420_P010_CALC_BUF_SIZE(buf_size, y_data_size, y_stride, \
 	y_buf_height, uv_data_size, uv_stride, uv_buf_height) \
@@ -198,30 +198,30 @@ typedef HFI_U32 HFI_BOOL;
 	} while (0)
 
 #define HFI_RGB888_CALC_STRIDE(stride, frame_width, stride_multiple) \
-	stride = ((frame_width * 3) + stride_multiple - 1) & \
-			 (0xffffffff - (stride_multiple - 1))
+	(stride = ((frame_width * 3) + stride_multiple - 1) & \
+			 (0xffffffff - (stride_multiple - 1)))
 
 #define HFI_RGB888_CALC_BUFHEIGHT(buf_height, frame_height, \
 			min_buf_height_multiple) \
-	buf_height = ((frame_height + min_buf_height_multiple - 1) & \
-			(0xffffffff - (min_buf_height_multiple - 1)))
+	(buf_height = ((frame_height + min_buf_height_multiple - 1) & \
+			(0xffffffff - (min_buf_height_multiple - 1))))
 
 #define HFI_RGB888_CALC_BUF_SIZE(buf_size, stride, buf_height) \
-	buf_size = ((stride) * (buf_height))
+	(buf_size = ((stride) * (buf_height)))
 
 #define HFI_RGBA8888_CALC_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN((frame_width << 2), stride_multiple)
+	(stride = HFI_ALIGN((frame_width << 2), stride_multiple))
 
 #define HFI_RGBA8888_CALC_BUFHEIGHT(buf_height, frame_height, \
 			min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_RGBA8888_CALC_BUF_SIZE(buf_size, stride, buf_height) \
-	buf_size = (stride) * (buf_height)
+	(buf_size = (stride) * (buf_height))
 
 #define HFI_RGBA8888_UBWC_CALC_DATA_PLANE_BUF_SIZE(buf_size, stride, \
 				buf_height) \
-	buf_size = HFI_ALIGN((stride) * (buf_height), HFI_ALIGNMENT_4096)
+	(buf_size = HFI_ALIGN((stride) * (buf_height), HFI_ALIGNMENT_4096))
 
 #define HFI_RGBA8888_UBWC_BUF_SIZE(buf_size, data_buf_size, \
 	metadata_buffer_size, stride, buf_height, _metadata_tride, \
@@ -234,31 +234,31 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, frame_width,\
 	metadata_stride_multiple, tile_width_in_pels) \
-	metadata_stride = HFI_ALIGN(((frame_width + (tile_width_in_pels - 1)) /\
-	tile_width_in_pels), metadata_stride_multiple)
+	(metadata_stride = HFI_ALIGN(((frame_width + (tile_width_in_pels - 1)) /\
+	tile_width_in_pels), metadata_stride_multiple))
 
 #define HFI_UBWC_METADATA_PLANE_BUFHEIGHT(metadata_buf_height, frame_height, \
 	metadata_height_multiple, tile_height_in_pels) \
-	metadata_buf_height = HFI_ALIGN(((frame_height + \
+	(metadata_buf_height = HFI_ALIGN(((frame_height + \
 	(tile_height_in_pels - 1)) / tile_height_in_pels), \
-	metadata_height_multiple)
+	metadata_height_multiple))
 
 #define HFI_UBWC_UV_METADATA_PLANE_STRIDE(metadata_stride, frame_width, \
 	metadata_stride_multiple, tile_width_in_pels) \
-	metadata_stride = HFI_ALIGN(((((frame_width + 1) >> 1) +\
+	(metadata_stride = HFI_ALIGN(((((frame_width + 1) >> 1) +\
 	(tile_width_in_pels - 1)) / tile_width_in_pels), \
-	metadata_stride_multiple)
+	metadata_stride_multiple))
 
 #define HFI_UBWC_UV_METADATA_PLANE_BUFHEIGHT(metadata_buf_height, frame_height,\
 	metadata_height_multiple, tile_height_in_pels) \
-	metadata_buf_height = HFI_ALIGN(((((frame_height + 1) >> 1) + \
+	(metadata_buf_height = HFI_ALIGN(((((frame_height + 1) >> 1) + \
 	(tile_height_in_pels - 1)) / tile_height_in_pels), \
-	metadata_height_multiple)
+	metadata_height_multiple))
 
 #define HFI_UBWC_METADATA_PLANE_BUFFER_SIZE(buffer_size, _metadata_tride, \
 					_metadata_buf_height) \
-	buffer_size = HFI_ALIGN(_metadata_tride * _metadata_buf_height, \
-					HFI_ALIGNMENT_4096)
+	(buffer_size = HFI_ALIGN(_metadata_tride * _metadata_buf_height, \
+					HFI_ALIGNMENT_4096))
 
 #define BUFFER_ALIGNMENT_512_BYTES 512
 #define BUFFER_ALIGNMENT_256_BYTES 256
@@ -447,8 +447,7 @@ typedef HFI_U32 HFI_BOOL;
 			VENUS_DMA_ALIGNMENT) * 2 + HFI_ALIGN(SIZE_H264D_QP\
 			(frame_width, frame_height), VENUS_DMA_ALIGNMENT); \
 		_size = HFI_ALIGN(_size, VENUS_DMA_ALIGNMENT); \
-		if (is_opb) \
-		{ \
+		if (is_opb) { \
 			SIZE_VPSS_LB(vpss_lb_size, frame_width, frame_height, \
 						num_vpp_pipes); \
 		} \
@@ -487,8 +486,7 @@ typedef HFI_U32 HFI_BOOL;
 				BUFFER_ALIGNMENT_16_BYTES);\
 		HFI_U32 n_aligned_h = HFI_ALIGN(frame_height, \
 				BUFFER_ALIGNMENT_16_BYTES); \
-		if (!is_interlaced)  \
-		{ \
+		if (!is_interlaced)  { \
 			SIZE_H264D_HW_BIN_BUFFER(_size, n_aligned_w, \
 				n_aligned_h, delay, num_vpp_pipes); \
 		}     \
@@ -684,13 +682,11 @@ typedef HFI_U32 HFI_BOOL;
 				BUFFER_ALIGNMENT_16_BYTES); \
 		HFI_U32 n_aligned_h = HFI_ALIGN(frame_height, \
 				BUFFER_ALIGNMENT_16_BYTES); \
-		if (!is_interlaced) \
-		{ \
+		if (!is_interlaced) { \
 			SIZE_H265D_HW_BIN_BUFFER(_size, n_aligned_w, \
 			n_aligned_h, delay, num_vpp_pipes); \
 		} \
-		else \
-		{ \
+		else { \
 			_size = 0; \
 		} \
 	} while (0)
@@ -848,8 +844,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		VENUS_DMA_ALIGNMENT) + \
 		HFI_ALIGN(SIZE_MP2D_LB_FE_TOP_DATA(frame_width, frame_height), \
 		VENUS_DMA_ALIGNMENT); \
-		if (is_opb) \
-		{ \
+		if (is_opb) { \
 			SIZE_VPSS_LB(vpss_lb_size, frame_width, frame_height, \
 						num_vpp_pipes); \
 		} \
@@ -1054,8 +1049,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		SIZE_AV1D_LB_OPB_WR1_TP10_UBWC(opbwr10, frame_width, frame_height); \
 		opbwr1BufSize = MAX(opbwr8, opbwr10); \
 		_size = HFI_ALIGN((_size + opbwr1BufSize), VENUS_DMA_ALIGNMENT); \
-		if (isOPB) \
-		{ \
+		if (isOPB) { \
 			SIZE_VPSS_LB(vpssLBSize, frame_width, frame_height, num_vpp_pipes); \
 			_size = HFI_ALIGN((_size + vpssLBSize), VENUS_DMA_ALIGNMENT); \
 		} \
@@ -1098,13 +1092,11 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 	do { \
 		HFI_U32 nAlignedW = HFI_ALIGN(frame_width, BUFFER_ALIGNMENT_16_BYTES); \
 		HFI_U32 nAlignedH = HFI_ALIGN(frame_height, BUFFER_ALIGNMENT_16_BYTES); \
-		if (!isInterlaced) \
-		{ \
+		if (!isInterlaced) { \
 			SIZE_AV1D_HW_BIN_BUFFER(_size, nAlignedW, nAlignedH, \
 						delay, num_vpp_pipes); \
 		} \
-		else \
-		{ \
+		else { \
 			_size = 0; \
 		} \
 	} while (0)
@@ -1148,26 +1140,22 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		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)) \
-		{ \
+		if (aligned_width * aligned_height > (4096 * 2176)) { \
 		    /* bitstream_size = 0.25 * yuv_size; */ \
 			bitstream_size = (bitstream_size >> 3); \
 		} \
-		else if (aligned_width * aligned_height > (1280 * 720)) \
-		{ \
+		else if (aligned_width * aligned_height > (1280 * 720)) { \
 		    /* bitstream_size = 0.5 * yuv_size; */ \
 			bitstream_size = (bitstream_size >> 2); \
 		} \
-		else \
-		{ \
+		else { \
 		    /* bitstream_size = 2 * yuv_size; */ \
 		} \
-		if (((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) && (bitstream_size < yuv_size))  \
-		{ \
+		if (((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) \
+			&& (bitstream_size < yuv_size))  { \
 			bitstream_size = (bitstream_size << 1);\
 		} \
-		if (is_ten_bit) \
-		{ \
+		if (is_ten_bit) { \
 			bitstream_size = (bitstream_size) + \
 					(bitstream_size >> 2); \
 		} \
@@ -1181,8 +1169,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 min_tile_size = 352, fixed_tile_width = 960; \
 		without_tile_enc_width = min_tile_size + fixed_tile_width; \
 		if ((codec_standard == HFI_CODEC_ENCODE_HEVC) && \
-			(frame_width_coded > without_tile_enc_width)) \
-		{ \
+			(frame_width_coded > without_tile_enc_width)) { \
 			tile_size = fixed_tile_width; \
 			tile_count = (frame_width_coded + tile_size - 1) / tile_size; \
 			last_tile_size = (frame_width_coded - (tile_size * (tile_count - 1))); \
@@ -1192,8 +1179,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				last_tile_size = (tile_size + min_tile_size); \
 			} \
 		} \
-		else \
-		{ \
+		else { \
 			tile_size = frame_width_coded; \
 			tile_count = 1; \
 			last_tile_size = 0; \
@@ -1215,8 +1201,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		mbs_in_one_tile = (tile_size * frame_height_coded) / (lcu_size * lcu_size); \
 		slice_count_per_tile = \
 			(mbs_in_one_tile + multi_slice_max_mb_count - 1) / (multi_slice_max_mb_count); \
-		if (last_tile_size) \
-		{ \
+		if (last_tile_size) { \
 			mbs_in_last_tile = \
 				(last_tile_size * frame_height_coded) / (lcu_size * lcu_size); \
 			slice_count_in_last_tile = \
@@ -1224,8 +1209,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			total_slice_count = \
 				(slice_count_per_tile * (tile_count - 1)) + slice_count_in_last_tile; \
 		} \
-		else \
-		{ \
+		else { \
 			total_slice_count = (slice_count_per_tile * tile_count); \
 		} \
 	} while (0)
@@ -1248,8 +1232,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				is_roi_enabled, lcu_size) \
 	do { \
 		HFI_U32 roi_size = 0; \
-		if (is_roi_enabled) \
-		{ \
+		if (is_roi_enabled) { \
 			SIZE_ROI_METADATA_ENC(roi_size, frame_width, \
 				frame_height, lcu_size); \
 		} \
@@ -1296,8 +1279,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 num_ref = 1; \
 		if (n_bframe) \
 			num_ref = 2; \
-		if (_total_hp_layers > 1) \
-		{ \
+		if (_total_hp_layers > 1) { \
 			if (hybrid_hp) \
 				num_ref = (_total_hp_layers + 1) >> 1; \
 			else if (codec_standard == HFI_CODEC_ENCODE_HEVC) \
@@ -1310,8 +1292,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		} \
 		if (ltr_count) \
 			num_ref = num_ref + ltr_count; \
-		if (_total_hb_layers > 1) \
-		{ \
+		if (_total_hb_layers > 1) { \
 			if (codec_standard == HFI_CODEC_ENCODE_HEVC) \
 				num_ref = (_total_hb_layers); \
 			else if (codec_standard == HFI_CODEC_ENCODE_AVC) \
@@ -1327,8 +1308,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 bitstream_size_eval = 0; \
 		size_aligned_width = HFI_ALIGN((frame_width), lcu_size); \
 		size_aligned_height = HFI_ALIGN((frame_height), lcu_size); \
-		if (work_mode == HFI_WORKMODE_2) \
-		{ \
+		if (work_mode == HFI_WORKMODE_2) { \
 			if ((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) \
 			{ \
 				bitstream_size_eval = (((size_aligned_width) * \
@@ -1338,28 +1318,24 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			{ \
 				bitstream_size_eval = ((size_aligned_width) * \
 							(size_aligned_height) * 3); \
-				if (rc_type == HFI_RC_LOSSLESS) \
-				{ \
+				if (rc_type == HFI_RC_LOSSLESS) { \
 					bitstream_size_eval = (bitstream_size_eval * 3 >> 2); \
 				} \
 				else if ((size_aligned_width * size_aligned_height) > \
-					(4096 * 2176)) \
-				{ \
+					(4096 * 2176)) { \
 					bitstream_size_eval >>= 3; \
 				} \
-				else if ((size_aligned_width * size_aligned_height) > (480 * 320)) \
-				{ \
+				else if ((size_aligned_width * size_aligned_height) > \
+					(480 * 320)) { \
 					bitstream_size_eval >>= 2; \
 				} \
 				if (profile == HFI_H265_PROFILE_MAIN_10 || \
-					profile == HFI_H265_PROFILE_MAIN_10_STILL_PICTURE) \
-				{ \
+					profile == HFI_H265_PROFILE_MAIN_10_STILL_PICTURE) { \
 					bitstream_size_eval = (bitstream_size_eval * 5 >> 2); \
 				} \
 			} \
 		} \
-		else \
-		{ \
+		else { \
 			bitstream_size_eval = size_aligned_width * \
 					size_aligned_height * 3; \
 		} \
@@ -1375,20 +1351,16 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		size_aligned_width = HFI_ALIGN((frame_width), lcu_size); \
 		size_aligned_height = HFI_ALIGN((frame_height), lcu_size); \
 		if ((size_aligned_width * size_aligned_height) > \
-			(3840 * 2160)) \
-		{ \
+			(3840 * 2160)) { \
 			size_single_pipe_eval = (bitbin_size / num_vpp_pipes); \
 		} \
-		else if (num_vpp_pipes > 2) \
-		{ \
+		else if (num_vpp_pipes > 2) { \
 			size_single_pipe_eval = bitbin_size / 2; \
 		} \
-		else \
-		{ \
+		else { \
 			size_single_pipe_eval = bitbin_size; \
 		} \
-		if (rc_type == HFI_RC_LOSSLESS) \
-		{ \
+		if (rc_type == HFI_RC_LOSSLESS) { \
 			size_single_pipe_eval = (size_single_pipe_eval << 1); \
 		} \
 		sao_bin_buffer_size = (64 * ((((frame_width) + \
@@ -1409,20 +1381,17 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			size_single_pipe = 0, bitbin_size = 0; \
 		SIZE_BIN_BITSTREAM_ENC(bitstream_size, rc_type, frame_width, \
 			frame_height, work_mode, lcu_size, profile);         \
-		if (work_mode == HFI_WORKMODE_2) \
-		{ \
+		if (work_mode == HFI_WORKMODE_2) { \
 			total_bitbin_buffers = 3; \
 			bitbin_size = bitstream_size * 12 / 10; \
 			bitbin_size = HFI_ALIGN(bitbin_size, \
 				VENUS_DMA_ALIGNMENT); \
 		} \
-		else if ((lcu_size == 16) || (num_vpp_pipes > 1)) \
-		{ \
+		else if ((lcu_size == 16) || (num_vpp_pipes > 1)) { \
 			total_bitbin_buffers = 1; \
 			bitbin_size = bitstream_size; \
 		} \
-		if (total_bitbin_buffers > 0) \
-		{ \
+		if (total_bitbin_buffers > 0) { \
 			SIZE_ENC_SINGLE_PIPE(size_single_pipe, rc_type, bitbin_size, \
 				num_vpp_pipes, frame_width, frame_height, lcu_size); \
 			bitbin_size = size_single_pipe * num_vpp_pipes; \
@@ -1430,10 +1399,8 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 					total_bitbin_buffers + 512; \
 		} \
 		else \
-		/* Avoid 512 Bytes allocation in case of 1Pipe HEVC Direct Mode*/\
-		{ \
+			/* Avoid 512 Bytes allocation in case of 1Pipe HEVC Direct Mode*/ \
 			_size = 0; \
-		} \
 	} while (0)
 
 #define HFI_BUFFER_BIN_H264E(_size, rc_type, frame_width, frame_height, \
@@ -1479,8 +1446,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			(((frame_height_coded) + \
 			(BUF_SIZE_ALIGN_32)) / BUF_SIZE_ALIGN_32 * 4 * 16) : \
 			(((frame_height_coded) + 15) / 16 * 5 * 16); \
-		if ((num_vpp_pipes_enc) > 1) \
-		{ \
+		if ((num_vpp_pipes_enc) > 1) { \
 			_size += BUFFER_ALIGNMENT_512_BYTES; \
 			_size = HFI_ALIGN(_size, BUFFER_ALIGNMENT_512_BYTES) *\
 				(num_vpp_pipes_enc); \
@@ -1545,8 +1511,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			(14 + ((((frame_height_coded) >> 5) + 7) >> 3))) : \
 			(256 + 16 * (14 + ((((frame_height_coded) >> 4) + 7) >> 3))); \
 		_size *= 11; \
-		if (num_vpp_pipes_enc > 1) \
-		{ \
+		if (num_vpp_pipes_enc > 1) { \
 			_size = HFI_ALIGN(_size, VENUS_DMA_ALIGNMENT) * \
 					num_vpp_pipes_enc;\
 		} \
@@ -1762,8 +1727,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 metadata_stride, metadata_buf_height, meta_size_y, \
 			meta_size_c; \
 		HFI_U32 ten_bit_ref_buf_size = 0, ref_buf_size = 0; \
-		if (!is_ten_bit) \
-		{ \
+		if (!is_ten_bit) { \
 			SIZE_ENC_REF_BUFFER(ref_buf_size, frame_width, \
 				frame_height); \
 			HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, \
@@ -1778,8 +1742,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				metadata_stride, metadata_buf_height); \
 			_size = ref_buf_size + meta_size_y + meta_size_c; \
 		} \
-		else \
-		{ \
+		else { \
 			SIZE_ENC_TEN_BIT_REF_BUFFER(ten_bit_ref_buf_size, \
 				frame_width, frame_height); \
 			HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, \
@@ -1810,8 +1773,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 #define HFI_BUFFER_VPSS_ENC(vpss_size, dswidth, dsheight, ds_enable, blur, is_ten_bit) \
 	do { \
 		vpss_size = 0; \
-		if (ds_enable || blur) \
-		{ \
+		if (ds_enable || blur) { \
 			HFI_BUFFER_DPB_ENC(vpss_size, dswidth, dsheight, is_ten_bit); \
 		} \
 	} while (0)

+ 77 - 115
driver/variant/iris33/inc/hfi_buffer_iris33.h

@@ -58,18 +58,18 @@ typedef HFI_U32 HFI_BOOL;
 #define HFI_COLOR_FORMAT_RGBA8888_UBWC_TILE_WIDTH (16)
 
 #define HFI_NV12_IL_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width, stride_multiple)
+	(stride = HFI_ALIGN(frame_width, stride_multiple))
 
 #define HFI_NV12_IL_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
-	min_buf_height_multiple) buf_height = HFI_ALIGN(frame_height, \
-	min_buf_height_multiple)
+	min_buf_height_multiple) (buf_height = HFI_ALIGN(frame_height, \
+	min_buf_height_multiple))
 
 #define HFI_NV12_IL_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
 	stride = HFI_ALIGN(frame_width, stride_multiple)
 
 #define HFI_NV12_IL_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
-	min_buf_height_multiple) buf_height = HFI_ALIGN(((frame_height + 1) \
-	 >> 1),	min_buf_height_multiple)
+	min_buf_height_multiple) (buf_height = HFI_ALIGN(((frame_height + 1) \
+	 >> 1),	min_buf_height_multiple))
 
 #define HFI_NV12_IL_CALC_BUF_SIZE(buf_size, y_bufSize, y_stride, y_buf_height, \
 	uv_buf_size, uv_stride, uv_buf_height) \
@@ -78,11 +78,11 @@ typedef HFI_U32 HFI_BOOL;
 	buf_size = HFI_ALIGN(y_bufSize + uv_buf_size, HFI_ALIGNMENT_4096)
 
 #define HFI_NV12_UBWC_IL_CALC_Y_BUF_SIZE(y_bufSize, y_stride, y_buf_height) \
-	y_bufSize = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096)
+	(y_bufSize = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_UV_BUF_SIZE(uv_buf_size, \
 	uv_stride, uv_buf_height) \
-	uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096)
+	(uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_NV12_UBWC_IL_CALC_BUF_SIZE_V2(buf_size,\
 	frame_width, frame_height, y_stride_multiple,\
@@ -130,7 +130,7 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_YUV420_TP10_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
 	stride = HFI_ALIGN(frame_width, 192); \
@@ -138,8 +138,8 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
-			min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
+			min_buf_height_multiple))
 
 #define HFI_YUV420_TP10_CALC_BUF_SIZE(buf_size, y_buf_size, y_stride,\
 		y_buf_height, uv_buf_size, uv_stride, uv_buf_height) \
@@ -149,11 +149,11 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_YUV420_TP10_UBWC_CALC_Y_BUF_SIZE(y_buf_size, y_stride, \
 					y_buf_height) \
-	y_buf_size = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096)
+	(y_buf_size = HFI_ALIGN(y_stride * y_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_YUV420_TP10_UBWC_CALC_UV_BUF_SIZE(uv_buf_size, uv_stride, \
 					uv_buf_height) \
-	uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096)
+	(uv_buf_size = HFI_ALIGN(uv_stride * uv_buf_height, HFI_ALIGNMENT_4096))
 
 #define HFI_YUV420_TP10_UBWC_CALC_BUF_SIZE(buf_size, y_stride, y_buf_height, \
 	uv_stride, uv_buf_height, y_md_stride, y_md_height, uv_md_stride, \
@@ -173,19 +173,19 @@ typedef HFI_U32 HFI_BOOL;
 	} while (0)
 
 #define HFI_YUV420_P010_CALC_Y_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width * 2, stride_multiple)
+	(stride = HFI_ALIGN(frame_width * 2, stride_multiple))
 
 #define HFI_YUV420_P010_CALC_Y_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_YUV420_P010_CALC_UV_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN(frame_width * 2, stride_multiple)
+	(stride = HFI_ALIGN(frame_width * 2, stride_multiple))
 
 #define HFI_YUV420_P010_CALC_UV_BUFHEIGHT(buf_height, frame_height, \
 				min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
-			min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(((frame_height + 1) >> 1), \
+			min_buf_height_multiple))
 
 #define HFI_YUV420_P010_CALC_BUF_SIZE(buf_size, y_data_size, y_stride, \
 	y_buf_height, uv_data_size, uv_stride, uv_buf_height) \
@@ -198,30 +198,30 @@ typedef HFI_U32 HFI_BOOL;
 	} while (0)
 
 #define HFI_RGB888_CALC_STRIDE(stride, frame_width, stride_multiple) \
-	stride = ((frame_width * 3) + stride_multiple - 1) & \
-			 (0xffffffff - (stride_multiple - 1))
+	(stride = ((frame_width * 3) + stride_multiple - 1) & \
+			 (0xffffffff - (stride_multiple - 1)))
 
 #define HFI_RGB888_CALC_BUFHEIGHT(buf_height, frame_height, \
 			min_buf_height_multiple) \
-	buf_height = ((frame_height + min_buf_height_multiple - 1) & \
-			(0xffffffff - (min_buf_height_multiple - 1)))
+	(buf_height = ((frame_height + min_buf_height_multiple - 1) & \
+			(0xffffffff - (min_buf_height_multiple - 1))))
 
 #define HFI_RGB888_CALC_BUF_SIZE(buf_size, stride, buf_height) \
-	buf_size = ((stride) * (buf_height))
+	(buf_size = ((stride) * (buf_height)))
 
 #define HFI_RGBA8888_CALC_STRIDE(stride, frame_width, stride_multiple) \
-	stride = HFI_ALIGN((frame_width << 2), stride_multiple)
+	(stride = HFI_ALIGN((frame_width << 2), stride_multiple))
 
 #define HFI_RGBA8888_CALC_BUFHEIGHT(buf_height, frame_height, \
 			min_buf_height_multiple) \
-	buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple)
+	(buf_height = HFI_ALIGN(frame_height, min_buf_height_multiple))
 
 #define HFI_RGBA8888_CALC_BUF_SIZE(buf_size, stride, buf_height) \
-	buf_size = (stride) * (buf_height)
+	(buf_size = (stride) * (buf_height))
 
 #define HFI_RGBA8888_UBWC_CALC_DATA_PLANE_BUF_SIZE(buf_size, stride, \
 				buf_height) \
-	buf_size = HFI_ALIGN((stride) * (buf_height), HFI_ALIGNMENT_4096)
+	(buf_size = HFI_ALIGN((stride) * (buf_height), HFI_ALIGNMENT_4096))
 
 #define HFI_RGBA8888_UBWC_BUF_SIZE(buf_size, data_buf_size, \
 	metadata_buffer_size, stride, buf_height, _metadata_tride, \
@@ -234,31 +234,31 @@ typedef HFI_U32 HFI_BOOL;
 
 #define HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, frame_width,\
 	metadata_stride_multiple, tile_width_in_pels) \
-	metadata_stride = HFI_ALIGN(((frame_width + (tile_width_in_pels - 1)) /\
-	tile_width_in_pels), metadata_stride_multiple)
+	(metadata_stride = HFI_ALIGN(((frame_width + (tile_width_in_pels - 1)) /\
+	tile_width_in_pels), metadata_stride_multiple))
 
 #define HFI_UBWC_METADATA_PLANE_BUFHEIGHT(metadata_buf_height, frame_height, \
 	metadata_height_multiple, tile_height_in_pels) \
-	metadata_buf_height = HFI_ALIGN(((frame_height + \
+	(metadata_buf_height = HFI_ALIGN(((frame_height + \
 	(tile_height_in_pels - 1)) / tile_height_in_pels), \
-	metadata_height_multiple)
+	metadata_height_multiple))
 
 #define HFI_UBWC_UV_METADATA_PLANE_STRIDE(metadata_stride, frame_width, \
 	metadata_stride_multiple, tile_width_in_pels) \
-	metadata_stride = HFI_ALIGN(((((frame_width + 1) >> 1) +\
+	(metadata_stride = HFI_ALIGN(((((frame_width + 1) >> 1) +\
 	(tile_width_in_pels - 1)) / tile_width_in_pels), \
-	metadata_stride_multiple)
+	metadata_stride_multiple))
 
 #define HFI_UBWC_UV_METADATA_PLANE_BUFHEIGHT(metadata_buf_height, frame_height,\
 	metadata_height_multiple, tile_height_in_pels) \
-	metadata_buf_height = HFI_ALIGN(((((frame_height + 1) >> 1) + \
+	(metadata_buf_height = HFI_ALIGN(((((frame_height + 1) >> 1) + \
 	(tile_height_in_pels - 1)) / tile_height_in_pels), \
-	metadata_height_multiple)
+	metadata_height_multiple))
 
 #define HFI_UBWC_METADATA_PLANE_BUFFER_SIZE(buffer_size, _metadata_tride, \
 					_metadata_buf_height) \
-	buffer_size = HFI_ALIGN(_metadata_tride * _metadata_buf_height, \
-					HFI_ALIGNMENT_4096)
+	(buffer_size = HFI_ALIGN(_metadata_tride * _metadata_buf_height, \
+					HFI_ALIGNMENT_4096))
 
 #define BUFFER_ALIGNMENT_512_BYTES 512
 #define BUFFER_ALIGNMENT_256_BYTES 256
@@ -447,8 +447,7 @@ typedef HFI_U32 HFI_BOOL;
 			VENUS_DMA_ALIGNMENT) * 2 + HFI_ALIGN(SIZE_H264D_QP\
 			(frame_width, frame_height), VENUS_DMA_ALIGNMENT); \
 		_size = HFI_ALIGN(_size, VENUS_DMA_ALIGNMENT); \
-		if (is_opb) \
-		{ \
+		if (is_opb) { \
 			SIZE_VPSS_LB(vpss_lb_size, frame_width, frame_height, \
 						num_vpp_pipes); \
 		} \
@@ -487,8 +486,7 @@ typedef HFI_U32 HFI_BOOL;
 				BUFFER_ALIGNMENT_16_BYTES);\
 		HFI_U32 n_aligned_h = HFI_ALIGN(frame_height, \
 				BUFFER_ALIGNMENT_16_BYTES); \
-		if (!is_interlaced)  \
-		{ \
+		if (!is_interlaced)  { \
 			SIZE_H264D_HW_BIN_BUFFER(_size, n_aligned_w, \
 				n_aligned_h, delay, num_vpp_pipes); \
 		}     \
@@ -684,13 +682,11 @@ typedef HFI_U32 HFI_BOOL;
 				BUFFER_ALIGNMENT_16_BYTES); \
 		HFI_U32 n_aligned_h = HFI_ALIGN(frame_height, \
 				BUFFER_ALIGNMENT_16_BYTES); \
-		if (!is_interlaced) \
-		{ \
+		if (!is_interlaced) { \
 			SIZE_H265D_HW_BIN_BUFFER(_size, n_aligned_w, \
 			n_aligned_h, delay, num_vpp_pipes); \
 		} \
-		else \
-		{ \
+		else { \
 			_size = 0; \
 		} \
 	} while (0)
@@ -848,8 +844,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		VENUS_DMA_ALIGNMENT) + \
 		HFI_ALIGN(SIZE_MP2D_LB_FE_TOP_DATA(frame_width, frame_height), \
 		VENUS_DMA_ALIGNMENT); \
-		if (is_opb) \
-		{ \
+		if (is_opb) { \
 			SIZE_VPSS_LB(vpss_lb_size, frame_width, frame_height, \
 						num_vpp_pipes); \
 		} \
@@ -1054,8 +1049,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		SIZE_AV1D_LB_OPB_WR1_TP10_UBWC(opbwr10, frame_width, frame_height); \
 		opbwr1BufSize = MAX(opbwr8, opbwr10); \
 		_size = HFI_ALIGN((_size + opbwr1BufSize), VENUS_DMA_ALIGNMENT); \
-		if (isOPB) \
-		{ \
+		if (isOPB) { \
 			SIZE_VPSS_LB(vpssLBSize, frame_width, frame_height, num_vpp_pipes); \
 			_size = HFI_ALIGN((_size + vpssLBSize), VENUS_DMA_ALIGNMENT); \
 		} \
@@ -1098,13 +1092,11 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 	do { \
 		HFI_U32 nAlignedW = HFI_ALIGN(frame_width, BUFFER_ALIGNMENT_16_BYTES); \
 		HFI_U32 nAlignedH = HFI_ALIGN(frame_height, BUFFER_ALIGNMENT_16_BYTES); \
-		if (!isInterlaced) \
-		{ \
+		if (!isInterlaced) { \
 			SIZE_AV1D_HW_BIN_BUFFER(_size, nAlignedW, nAlignedH, \
 						delay, num_vpp_pipes); \
 		} \
-		else \
-		{ \
+		else { \
 			_size = 0; \
 		} \
 	} while (0)
@@ -1148,26 +1140,22 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		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)) \
-		{ \
+		if (aligned_width * aligned_height > (4096 * 2176)) { \
 		    /* bitstream_size = 0.25 * yuv_size; */ \
 			bitstream_size = (bitstream_size >> 3); \
 		} \
-		else if (aligned_width * aligned_height > (1280 * 720)) \
-		{ \
+		else if (aligned_width * aligned_height > (1280 * 720)) { \
 		    /* bitstream_size = 0.5 * yuv_size; */ \
 			bitstream_size = (bitstream_size >> 2); \
 		} \
-		else \
-		{ \
+		else { \
 		    /* bitstream_size = 2 * yuv_size; */ \
 		} \
-		if (((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) && (bitstream_size < yuv_size))  \
-		{ \
+		if (((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) \
+			&& (bitstream_size < yuv_size))  { \
 			bitstream_size = (bitstream_size << 1);\
 		} \
-		if (is_ten_bit) \
-		{ \
+		if (is_ten_bit) { \
 			bitstream_size = (bitstream_size) + \
 					(bitstream_size >> 2); \
 		} \
@@ -1181,8 +1169,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 min_tile_size = 352, fixed_tile_width = 960; \
 		without_tile_enc_width = min_tile_size + fixed_tile_width; \
 		if ((codec_standard == HFI_CODEC_ENCODE_HEVC) && \
-			(frame_width_coded > without_tile_enc_width)) \
-		{ \
+			(frame_width_coded > without_tile_enc_width)) { \
 			tile_size = fixed_tile_width; \
 			tile_count = (frame_width_coded + tile_size - 1) / tile_size; \
 			last_tile_size = (frame_width_coded - (tile_size * (tile_count - 1))); \
@@ -1192,8 +1179,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				last_tile_size = (tile_size + min_tile_size); \
 			} \
 		} \
-		else \
-		{ \
+		else { \
 			tile_size = frame_width_coded; \
 			tile_count = 1; \
 			last_tile_size = 0; \
@@ -1215,8 +1201,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		mbs_in_one_tile = (tile_size * frame_height_coded) / (lcu_size * lcu_size); \
 		slice_count_per_tile = \
 			(mbs_in_one_tile + multi_slice_max_mb_count - 1) / (multi_slice_max_mb_count); \
-		if (last_tile_size) \
-		{ \
+		if (last_tile_size) { \
 			mbs_in_last_tile = \
 				(last_tile_size * frame_height_coded) / (lcu_size * lcu_size); \
 			slice_count_in_last_tile = \
@@ -1224,8 +1209,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			total_slice_count = \
 				(slice_count_per_tile * (tile_count - 1)) + slice_count_in_last_tile; \
 		} \
-		else \
-		{ \
+		else { \
 			total_slice_count = (slice_count_per_tile * tile_count); \
 		} \
 	} while (0)
@@ -1248,8 +1232,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				is_roi_enabled, lcu_size) \
 	do { \
 		HFI_U32 roi_size = 0; \
-		if (is_roi_enabled) \
-		{ \
+		if (is_roi_enabled) { \
 			SIZE_ROI_METADATA_ENC(roi_size, frame_width, \
 				frame_height, lcu_size); \
 		} \
@@ -1296,8 +1279,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 num_ref = 1; \
 		if (n_bframe) \
 			num_ref = 2; \
-		if (_total_hp_layers > 1) \
-		{ \
+		if (_total_hp_layers > 1) { \
 			if (hybrid_hp) \
 				num_ref = (_total_hp_layers + 1) >> 1; \
 			else if (codec_standard == HFI_CODEC_ENCODE_HEVC) \
@@ -1310,8 +1292,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		} \
 		if (ltr_count) \
 			num_ref = num_ref + ltr_count; \
-		if (_total_hb_layers > 1) \
-		{ \
+		if (_total_hb_layers > 1) { \
 			if (codec_standard == HFI_CODEC_ENCODE_HEVC) \
 				num_ref = (_total_hb_layers); \
 			else if (codec_standard == HFI_CODEC_ENCODE_AVC) \
@@ -1327,8 +1308,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 bitstream_size_eval = 0; \
 		size_aligned_width = HFI_ALIGN((frame_width), lcu_size); \
 		size_aligned_height = HFI_ALIGN((frame_height), lcu_size); \
-		if (work_mode == HFI_WORKMODE_2) \
-		{ \
+		if (work_mode == HFI_WORKMODE_2) { \
 			if ((rc_type == HFI_RC_CQ) || (rc_type == HFI_RC_OFF)) \
 			{ \
 				bitstream_size_eval = (((size_aligned_width) * \
@@ -1338,28 +1318,24 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			{ \
 				bitstream_size_eval = ((size_aligned_width) * \
 							(size_aligned_height) * 3); \
-				if (rc_type == HFI_RC_LOSSLESS) \
-				{ \
+				if (rc_type == HFI_RC_LOSSLESS) { \
 					bitstream_size_eval = (bitstream_size_eval * 3 >> 2); \
 				} \
 				else if ((size_aligned_width * size_aligned_height) > \
-					(4096 * 2176)) \
-				{ \
+					(4096 * 2176)) { \
 					bitstream_size_eval >>= 3; \
 				} \
-				else if ((size_aligned_width * size_aligned_height) > (480 * 320)) \
-				{ \
+				else if ((size_aligned_width * size_aligned_height) > \
+					(480 * 320)) { \
 					bitstream_size_eval >>= 2; \
 				} \
 				if (profile == HFI_H265_PROFILE_MAIN_10 || \
-					profile == HFI_H265_PROFILE_MAIN_10_STILL_PICTURE) \
-				{ \
+					profile == HFI_H265_PROFILE_MAIN_10_STILL_PICTURE) { \
 					bitstream_size_eval = (bitstream_size_eval * 5 >> 2); \
 				} \
 			} \
 		} \
-		else \
-		{ \
+		else { \
 			bitstream_size_eval = size_aligned_width * \
 					size_aligned_height * 3; \
 		} \
@@ -1375,20 +1351,16 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		size_aligned_width = HFI_ALIGN((frame_width), lcu_size); \
 		size_aligned_height = HFI_ALIGN((frame_height), lcu_size); \
 		if ((size_aligned_width * size_aligned_height) > \
-			(3840 * 2160)) \
-		{ \
+			(3840 * 2160)) { \
 			size_single_pipe_eval = (bitbin_size / num_vpp_pipes); \
 		} \
-		else if (num_vpp_pipes > 2) \
-		{ \
+		else if (num_vpp_pipes > 2) { \
 			size_single_pipe_eval = bitbin_size / 2; \
 		} \
-		else \
-		{ \
+		else { \
 			size_single_pipe_eval = bitbin_size; \
 		} \
-		if (rc_type == HFI_RC_LOSSLESS) \
-		{ \
+		if (rc_type == HFI_RC_LOSSLESS) { \
 			size_single_pipe_eval = (size_single_pipe_eval << 1); \
 		} \
 		sao_bin_buffer_size = (64 * ((((frame_width) + \
@@ -1409,20 +1381,17 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			size_single_pipe = 0, bitbin_size = 0; \
 		SIZE_BIN_BITSTREAM_ENC(bitstream_size, rc_type, frame_width, \
 			frame_height, work_mode, lcu_size, profile);         \
-		if (work_mode == HFI_WORKMODE_2) \
-		{ \
+		if (work_mode == HFI_WORKMODE_2) { \
 			total_bitbin_buffers = (ring_buf_count > 3) ? ring_buf_count : 3; \
 			bitbin_size = bitstream_size * 17 / 10; \
 			bitbin_size = HFI_ALIGN(bitbin_size, \
 				VENUS_DMA_ALIGNMENT); \
 		} \
-		else if ((lcu_size == 16) || (num_vpp_pipes > 1)) \
-		{ \
+		else if ((lcu_size == 16) || (num_vpp_pipes > 1)) { \
 			total_bitbin_buffers = 1; \
 			bitbin_size = bitstream_size; \
 		} \
-		if (total_bitbin_buffers > 0) \
-		{ \
+		if (total_bitbin_buffers > 0) { \
 			SIZE_ENC_SINGLE_PIPE(size_single_pipe, rc_type, bitbin_size, \
 				num_vpp_pipes, frame_width, frame_height, lcu_size); \
 			bitbin_size = size_single_pipe * num_vpp_pipes; \
@@ -1430,10 +1399,8 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 					total_bitbin_buffers + 512; \
 		} \
 		else \
-		/* Avoid 512 Bytes allocation in case of 1Pipe HEVC Direct Mode*/\
-		{ \
+			/* Avoid 512 Bytes allocation in case of 1Pipe HEVC Direct Mode*/ \
 			_size = 0; \
-		} \
 	} while (0)
 
 #define HFI_BUFFER_BIN_H264E(_size, rc_type, frame_width, frame_height, \
@@ -1479,8 +1446,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			(((frame_height_coded) + \
 			(BUF_SIZE_ALIGN_32)) / BUF_SIZE_ALIGN_32 * 4 * 16) : \
 			(((frame_height_coded) + 15) / 16 * 5 * 16); \
-		if ((num_vpp_pipes_enc) > 1) \
-		{ \
+		if ((num_vpp_pipes_enc) > 1) { \
 			_size += BUFFER_ALIGNMENT_512_BYTES; \
 			_size = HFI_ALIGN(_size, BUFFER_ALIGNMENT_512_BYTES) *\
 				(num_vpp_pipes_enc); \
@@ -1545,8 +1511,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 			(14 + ((((frame_height_coded) >> 5) + 7) >> 3))) : \
 			(256 + 16 * (14 + ((((frame_height_coded) >> 4) + 7) >> 3))); \
 		_size *= 11; \
-		if (num_vpp_pipes_enc > 1) \
-		{ \
+		if (num_vpp_pipes_enc > 1) { \
 			_size = HFI_ALIGN(_size, VENUS_DMA_ALIGNMENT) * \
 					num_vpp_pipes_enc;\
 		} \
@@ -1764,8 +1729,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 		HFI_U32 metadata_stride, metadata_buf_height, meta_size_y, \
 			meta_size_c; \
 		HFI_U32 ten_bit_ref_buf_size = 0, ref_buf_size = 0; \
-		if (!is_ten_bit) \
-		{ \
+		if (!is_ten_bit) { \
 			SIZE_ENC_REF_BUFFER(ref_buf_size, frame_width, \
 				frame_height); \
 			HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, \
@@ -1780,8 +1744,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 				metadata_stride, metadata_buf_height); \
 			_size = ref_buf_size + meta_size_y + meta_size_c; \
 		} \
-		else \
-		{ \
+		else { \
 			SIZE_ENC_TEN_BIT_REF_BUFFER(ten_bit_ref_buf_size, \
 				frame_width, frame_height); \
 			HFI_UBWC_CALC_METADATA_PLANE_STRIDE(metadata_stride, \
@@ -1812,8 +1775,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes)           \
 #define HFI_BUFFER_VPSS_ENC(vpss_size, dswidth, dsheight, ds_enable, blur, is_ten_bit) \
 	do { \
 		vpss_size = 0; \
-		if (ds_enable || blur) \
-		{ \
+		if (ds_enable || blur) { \
 			HFI_BUFFER_DPB_ENC(vpss_size, dswidth, dsheight, is_ten_bit); \
 		} \
 	} while (0)