|
@@ -3,10 +3,90 @@
|
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
*/
|
|
*/
|
|
|
|
|
|
-#include "pineapple_technology.h"
|
|
|
|
|
|
+#include "perf_static_model.h"
|
|
#include "msm_vidc_debug.h"
|
|
#include "msm_vidc_debug.h"
|
|
|
|
|
|
-u32 calculate_number_lcus_pineapple(u32 width, u32 height, u32 lcu_size)
|
|
|
|
|
|
+/* 100x */
|
|
|
|
+static u32 dpbopb_ubwc30_cr_table_cratio_iris33[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},
|
|
|
|
+ {269, 404, 302, 202, 367, 238, 210, 299, 232, 134, 181, 149},
|
|
|
|
+ {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},
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* 100x */
|
|
|
|
+static u32 rpb_ubwc30_cr_table_cratio_iris33[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},
|
|
|
|
+ {285, 406, 316, 207, 373, 243, 201, 280, 221, 139, 177, 152},
|
|
|
|
+ {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},
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* 100x */
|
|
|
|
+static u32 ipblossy_ubwc30_cr_table_cratio_iris33[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},
|
|
|
|
+ {254, 254, 254, 219, 219, 219, 292, 292, 292, 249, 249, 249},
|
|
|
|
+ {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},
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* 100x */
|
|
|
|
+static u32 ipblossless_ubwc30_cr_table_cratio_iris33[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},
|
|
|
|
+ {186, 217, 195, 151, 183, 161, 164, 182, 170, 140, 168, 148},
|
|
|
|
+ {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},
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* 100x */
|
|
|
|
+static u32 en_original_compression_factor_rgba_pwd_iris33 = 243;
|
|
|
|
+/* 100x */
|
|
|
|
+static u32 en_original_compression_factor_rgba_avg_iris33 = 454;
|
|
|
|
+
|
|
|
|
+static u32 av1_num_tiles_iris33[7][3] = {
|
|
|
|
+ {2, 1, 1},
|
|
|
|
+ {4, 2, 2},
|
|
|
|
+ {4, 2, 2},
|
|
|
|
+ {4, 2, 2},
|
|
|
|
+ {1, 1, 1},
|
|
|
|
+ {2, 1, 1},
|
|
|
|
+ {16, 4, 4},
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* H I J K L M N O P
|
|
|
|
+ * TotalW Total R Frequency Write Read
|
|
|
|
+ * Name B b P B b P B b P
|
|
|
|
+ * I3B4b1P 0.5 1.875 3 4 1 1 0 1 2 2 1
|
|
|
|
+ * I1B2b1P 0.5 1.75 1 2 1 1 0 1 2 2 1
|
|
|
|
+ * IbP 0.5 1.5 0 1 1 1 0 1 2 2 1
|
|
|
|
+ * IPP 1 1 0 0 1 1 0 1 2 2 1
|
|
|
|
+ * P 1 1 0 0 1 1 0 1 2 2 1
|
|
|
|
+ * smallB 0 2 0 1 0 1 0 1 2 2 1
|
|
|
|
+ * bigB 1 2 1 0 0 1 0 1 2 2 1
|
|
|
|
+ *
|
|
|
|
+ * Total W = SUMPRODUCT(H16:J16, K16 : M16) / SUM(H16:J16)
|
|
|
|
+ * Total R = SUMPRODUCT(H16:J16, N16 : P16) / SUM(H16:J16)
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/* 1000x */
|
|
|
|
+static u32 pineapple_en_readfactor[8] = {1000, 1500, 1750, 1875, 1000, 2000, 2000, 1000};
|
|
|
|
+/* 1000x */
|
|
|
|
+static u32 pineapple_en_writefactor[8] = {1000, 500, 500, 500, 1000, 0, 1000, 1000};
|
|
|
|
+static u32 pineapple_en_frame_num_parallel = 1;
|
|
|
|
+
|
|
|
|
+u32 calculate_number_lcus_iris33(u32 width, u32 height, u32 lcu_size)
|
|
{
|
|
{
|
|
u32 mbs_width = (width % lcu_size) ?
|
|
u32 mbs_width = (width % lcu_size) ?
|
|
(width / lcu_size + 1) : (width / lcu_size);
|
|
(width / lcu_size + 1) : (width / lcu_size);
|
|
@@ -16,7 +96,7 @@ u32 calculate_number_lcus_pineapple(u32 width, u32 height, u32 lcu_size)
|
|
return mbs_width * mbs_height;
|
|
return mbs_width * mbs_height;
|
|
}
|
|
}
|
|
|
|
|
|
-u32 calculate_number_ubwctiles_pineapple(
|
|
|
|
|
|
+u32 calculate_number_ubwctiles_iris33(
|
|
u32 width, u32 height, u32 tile_w, u32 tile_h)
|
|
u32 width, u32 height, u32 tile_w, u32 tile_h)
|
|
{
|
|
{
|
|
u32 tiles_width = (width % tile_w) ?
|
|
u32 tiles_width = (width % tile_w) ?
|
|
@@ -76,11 +156,11 @@ u32 get_compression_factors(struct compression_factors *compression_factor,
|
|
|
|
|
|
if (codec_input.decoder_or_encoder == CODEC_DECODER) {
|
|
if (codec_input.decoder_or_encoder == CODEC_DECODER) {
|
|
compression_factor->dpb_cf_y =
|
|
compression_factor->dpb_cf_y =
|
|
- dpbopb_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_y];
|
|
|
|
|
|
+ dpbopb_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_y];
|
|
compression_factor->dpb_cf_cbcr =
|
|
compression_factor->dpb_cf_cbcr =
|
|
- dpbopb_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_c];
|
|
|
|
|
|
+ dpbopb_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_c];
|
|
compression_factor->opb_cf_ycbcr =
|
|
compression_factor->opb_cf_ycbcr =
|
|
- dpbopb_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_uni];
|
|
|
|
|
|
+ dpbopb_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_uni];
|
|
|
|
|
|
if ((codec_input.regression_mode == 3) &&
|
|
if ((codec_input.regression_mode == 3) &&
|
|
/* input cr numbers from interface */
|
|
/* input cr numbers from interface */
|
|
@@ -97,21 +177,21 @@ u32 get_compression_factors(struct compression_factors *compression_factor,
|
|
*/
|
|
*/
|
|
if (frame_width < 3840) {
|
|
if (frame_width < 3840) {
|
|
compression_factor->ipb_cr =
|
|
compression_factor->ipb_cr =
|
|
- ipblossless_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_uni];
|
|
|
|
|
|
+ ipblossless_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_uni];
|
|
compression_factor->ipb_cr_y =
|
|
compression_factor->ipb_cr_y =
|
|
- ipblossless_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_y];
|
|
|
|
|
|
+ ipblossless_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_y];
|
|
} else {
|
|
} else {
|
|
compression_factor->ipb_cr =
|
|
compression_factor->ipb_cr =
|
|
- ipblossy_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_uni];
|
|
|
|
|
|
+ ipblossy_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_uni];
|
|
compression_factor->ipb_cr_y =
|
|
compression_factor->ipb_cr_y =
|
|
- ipblossy_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_y];
|
|
|
|
|
|
+ ipblossy_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_y];
|
|
}
|
|
}
|
|
|
|
|
|
compression_factor->dpb_cf_y =
|
|
compression_factor->dpb_cf_y =
|
|
- rpb_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_y];
|
|
|
|
|
|
+ rpb_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_y];
|
|
|
|
|
|
compression_factor->dpb_cf_cbcr =
|
|
compression_factor->dpb_cf_cbcr =
|
|
- rpb_ubwc30_cr_table_cratio_pineapple[cr_index_entry][cr_index_c];
|
|
|
|
|
|
+ rpb_ubwc30_cr_table_cratio_iris33[cr_index_entry][cr_index_c];
|
|
|
|
|
|
if ((codec_input.regression_mode == 3) &&
|
|
if ((codec_input.regression_mode == 3) &&
|
|
/* input cr from interface */
|
|
/* input cr from interface */
|
|
@@ -246,7 +326,7 @@ static int calculate_bandwidth_decoder_iris33(
|
|
}
|
|
}
|
|
|
|
|
|
lcu_per_frame =
|
|
lcu_per_frame =
|
|
- calculate_number_lcus_pineapple(frame_width, frame_height, frame_lcu_size);
|
|
|
|
|
|
+ calculate_number_lcus_iris33(frame_width, frame_height, frame_lcu_size);
|
|
|
|
|
|
target_bitrate = (u32)(codec_input.bitrate_mbps); /* Mbps */
|
|
target_bitrate = (u32)(codec_input.bitrate_mbps); /* Mbps */
|
|
|
|
|
|
@@ -254,11 +334,11 @@ static int calculate_bandwidth_decoder_iris33(
|
|
ubwc_tile_h = (codec_input.bitdepth == CODEC_BITDEPTH_8) ? 8 : 4;
|
|
ubwc_tile_h = (codec_input.bitdepth == CODEC_BITDEPTH_8) ? 8 : 4;
|
|
|
|
|
|
frame420_y_bw_linear_8bpp =
|
|
frame420_y_bw_linear_8bpp =
|
|
- ((calculate_number_ubwctiles_pineapple(frame_width, frame_height, 32, 8) *
|
|
|
|
|
|
+ ((calculate_number_ubwctiles_iris33(frame_width, frame_height, 32, 8) *
|
|
256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
|
|
|
|
frame420_y_bw_no_ubwc_tile_10bpp =
|
|
frame420_y_bw_no_ubwc_tile_10bpp =
|
|
- ((calculate_number_ubwctiles_pineapple(frame_width, frame_height, 48, 4) *
|
|
|
|
|
|
+ ((calculate_number_ubwctiles_iris33(frame_width, frame_height, 48, 4) *
|
|
256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
frame420_y_bw_linear_10bpp = ((frame_width * frame_height *
|
|
frame420_y_bw_linear_10bpp = ((frame_width * frame_height *
|
|
codec_input.frame_rate * 2 + 999) / 1000 + 999) / 1000;
|
|
codec_input.frame_rate * 2 + 999) / 1000 + 999) / 1000;
|
|
@@ -304,7 +384,7 @@ static int calculate_bandwidth_decoder_iris33(
|
|
else
|
|
else
|
|
av1tile_complexity = 0;
|
|
av1tile_complexity = 0;
|
|
|
|
|
|
- av1_tile_numbers = av1_num_tiles_pineapple[av1tile_index_entry][av1tile_complexity];
|
|
|
|
|
|
+ av1_tile_numbers = av1_num_tiles_iris33[av1tile_index_entry][av1tile_complexity];
|
|
|
|
|
|
/* these bw can be ignored */
|
|
/* these bw can be ignored */
|
|
av1_collated_seg_buffer_rd_wr =
|
|
av1_collated_seg_buffer_rd_wr =
|
|
@@ -618,7 +698,7 @@ static int calculate_bandwidth_encoder_iris33(
|
|
}
|
|
}
|
|
|
|
|
|
lcu_per_frame =
|
|
lcu_per_frame =
|
|
- calculate_number_lcus_pineapple(frame_width, frame_height, frame_lcu_size);
|
|
|
|
|
|
+ calculate_number_lcus_iris33(frame_width, frame_height, frame_lcu_size);
|
|
|
|
|
|
bse_tlb_byte_per_lcu = 16; /* TODO Should be in common declaration */
|
|
bse_tlb_byte_per_lcu = 16; /* TODO Should be in common declaration */
|
|
|
|
|
|
@@ -630,16 +710,16 @@ static int calculate_bandwidth_encoder_iris33(
|
|
/* yuv */
|
|
/* yuv */
|
|
if (codec_input.ipb_yuvrgb == 0) {
|
|
if (codec_input.ipb_yuvrgb == 0) {
|
|
frame420_y_bw_linear_8bpp =
|
|
frame420_y_bw_linear_8bpp =
|
|
- ((calculate_number_ubwctiles_pineapple(frame_width, frame_height,
|
|
|
|
|
|
+ ((calculate_number_ubwctiles_iris33(frame_width, frame_height,
|
|
32, 8) * 256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
32, 8) * 256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
} else { /* RGBA */
|
|
} else { /* RGBA */
|
|
frame420_y_bw_linear_8bpp =
|
|
frame420_y_bw_linear_8bpp =
|
|
- ((calculate_number_ubwctiles_pineapple(frame_width, frame_height,
|
|
|
|
|
|
+ ((calculate_number_ubwctiles_iris33(frame_width, frame_height,
|
|
6, 4) * 256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
6, 4) * 256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
}
|
|
}
|
|
|
|
|
|
frame420_y_bw_no_ubwc_tile_10bpp =
|
|
frame420_y_bw_no_ubwc_tile_10bpp =
|
|
- ((calculate_number_ubwctiles_pineapple(frame_width, frame_height, 48, 4) *
|
|
|
|
|
|
+ ((calculate_number_ubwctiles_iris33(frame_width, frame_height, 48, 4) *
|
|
256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
256 * codec_input.frame_rate + 999) / 1000 + 999) / 1000;
|
|
|
|
|
|
frame420_y_bw_linear_10bpp = ((frame_width * frame_height *
|
|
frame420_y_bw_linear_10bpp = ((frame_width * frame_height *
|
|
@@ -854,13 +934,13 @@ static int calculate_bandwidth_encoder_iris33(
|
|
if (codec_input.complexity_setting == 0) /* pwc */
|
|
if (codec_input.complexity_setting == 0) /* pwc */
|
|
codec_output->ipb_rd_total_noc =
|
|
codec_output->ipb_rd_total_noc =
|
|
(large_bw_calculation_fp * 100 +
|
|
(large_bw_calculation_fp * 100 +
|
|
- en_original_compression_factor_rgba_pwd_pineapple - 1) /
|
|
|
|
- en_original_compression_factor_rgba_pwd_pineapple;
|
|
|
|
|
|
+ en_original_compression_factor_rgba_pwd_iris33 - 1) /
|
|
|
|
+ en_original_compression_factor_rgba_pwd_iris33;
|
|
else
|
|
else
|
|
codec_output->ipb_rd_total_noc =
|
|
codec_output->ipb_rd_total_noc =
|
|
(large_bw_calculation_fp * 100 +
|
|
(large_bw_calculation_fp * 100 +
|
|
- en_original_compression_factor_rgba_avg_pineapple - 1) /
|
|
|
|
- en_original_compression_factor_rgba_avg_pineapple;
|
|
|
|
|
|
+ en_original_compression_factor_rgba_avg_iris33 - 1) /
|
|
|
|
+ en_original_compression_factor_rgba_avg_iris33;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|