From 7d9c257e5781c5eb849bec81611627dbe1b6dfe1 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 30 Apr 2025 14:35:09 +0530 Subject: [PATCH 1/2] Fix for 3GPP issue 1525: Second channel of BASOP decoder MASA format output to FOA has missing energy or wrong signal - 2 Link #1525 --- lib_rend/ivas_dirac_decorr_dec_fx.c | 75 +++++++++++++++-------------- lib_rend/ivas_rom_rend.h | 8 +-- lib_rend/ivas_rom_rend_fx.c | 9 ++-- lib_rend/ivas_stat_rend.h | 4 +- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/lib_rend/ivas_dirac_decorr_dec_fx.c b/lib_rend/ivas_dirac_decorr_dec_fx.c index 1afac99c4..4db9cd09a 100644 --- a/lib_rend/ivas_dirac_decorr_dec_fx.c +++ b/lib_rend/ivas_dirac_decorr_dec_fx.c @@ -63,8 +63,8 @@ * Local function prototypes *------------------------------------------------------------------------*/ -static void get_lattice_coeffs_fx( const Word16 band_index, const Word16 channel_index, Word16 *lattice_coeffs ); -static void lattice2allpass_fx( const Word16 filter_length, const Word16 *lattice_coeffs_fx, Word16 *filter_coeffs_num_real_fx, Word16 *filter_coeffs_den_real_fx ); +static void get_lattice_coeffs_fx( const Word16 band_index, const Word16 channel_index, Word32 *lattice_coeffs ); +static void lattice2allpass_fx( const Word16 filter_length, const Word32 *lattice_coeffs_fx, Word32 *filter_coeffs_num_real_fx, Word32 *filter_coeffs_den_real_fx ); /*------------------------------------------------------------------------- * ivas_dirac_dec_decorr_open() @@ -90,7 +90,8 @@ ivas_error ivas_dirac_dec_decorr_open_fx( Word16 split_frequencies_bands[DIRAC_DECORR_NUM_SPLIT_BANDS + 1] = { 0, 0, 0, 23768 }; move16(); Word16 *split_freq_ptr; - Word16 cur_lattice_delta_phi_fx, lattice_coeffs_fx[2 * DIRAC_MAX_DECORR_FILTER_LEN]; + Word16 cur_lattice_delta_phi_fx; + Word32 lattice_coeffs_fx[2 * DIRAC_MAX_DECORR_FILTER_LEN]; ivas_error error; @@ -277,12 +278,12 @@ ivas_error ivas_dirac_dec_decorr_open_fx( freq_domain_decorr_ap_state->q_decorr_buffer = Q31; move16(); - IF( ( freq_domain_decorr_ap_params->filter_coeff_num_real_fx = (Word16 *) malloc( sizeof( Word16 ) * imult1616( add( ap_filter_length[split_band_index_start], 1 ), imult1616( freq_domain_decorr_ap_params->max_band_decorr, num_outputs_diff ) ) ) ) == NULL ) + IF( ( freq_domain_decorr_ap_params->filter_coeff_num_real_fx = (Word32 *) malloc( sizeof( Word32 ) * imult1616( add( ap_filter_length[split_band_index_start], 1 ), imult1616( freq_domain_decorr_ap_params->max_band_decorr, num_outputs_diff ) ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD decorrelator\n" ) ); } - IF( ( freq_domain_decorr_ap_params->filter_coeff_den_real_fx = (Word16 *) malloc( sizeof( Word16 ) * imult1616( add( ap_filter_length[split_band_index_start], 1 ), imult1616( freq_domain_decorr_ap_params->max_band_decorr, num_outputs_diff ) ) ) ) == NULL ) + IF( ( freq_domain_decorr_ap_params->filter_coeff_den_real_fx = (Word32 *) malloc( sizeof( Word32 ) * imult1616( add( ap_filter_length[split_band_index_start], 1 ), imult1616( freq_domain_decorr_ap_params->max_band_decorr, num_outputs_diff ) ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD decorrelator\n" ) ); } @@ -414,7 +415,7 @@ void ivas_dirac_dec_decorr_process_fx( Word32 frame_ma_fx[2 * ( DIRAC_MAX_DECORR_FILTER_LEN + 1 )]; Word32 *p_frame_dec_fx, *decorr_buffer_fx; Word16 *phase_coeff_real_fx, *phase_coeff_imag_fx; - Word16 *filter_coeff_num_real_fx, *filter_coeff_den_real_fx; + Word32 *filter_coeff_num_real_fx, *filter_coeff_den_real_fx; Word32 *decorr_buffer_start_ptr_fx, *decorr_buffer_ptr_fx; Word32 input_real_fx, input_imag_fx, filter_frame_imag_fx, filter_frame_real_fx; Word16 q_aux_buffer, q_onset_dec, q_frame_f; @@ -666,8 +667,8 @@ void ivas_dirac_dec_decorr_process_fx( /* MA part of filter impulse response */ FOR( l = 0; l < filter_length; l++ ) { - frame_ma_fx[2 * l] = Mpy_32_16_1( input_real_fx, filter_coeff_num_real_fx[l] ); // Q_qux -3 = q_deorr - frame_ma_fx[2 * l + 1] = Mpy_32_16_1( input_imag_fx, filter_coeff_num_real_fx[l] ); // Q_qux - 3 = q_deorr + frame_ma_fx[2 * l] = Mpy_32_32( input_real_fx, filter_coeff_num_real_fx[l] ); // Q_qux -3 = q_deorr + frame_ma_fx[2 * l + 1] = Mpy_32_32( input_imag_fx, filter_coeff_num_real_fx[l] ); // Q_qux - 3 = q_deorr move32(); move32(); } @@ -691,12 +692,12 @@ void ivas_dirac_dec_decorr_process_fx( FOR( l = 1; l < filter_length; l++ ) { // q adjustment needed// - Word32 temp_1 = Mpy_32_16_1( filter_frame_real_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 + Word32 temp_1 = Mpy_32_32( filter_frame_real_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 temp_1 = L_shl( temp_1, 3 ); // q_decorr decorr_buffer_ptr_fx[0] = L_sub( L_add( decorr_buffer_ptr_fx[0], frame_ma_fx[2 * l] ), temp_1 ); // q_deocor move32(); - Word32 temp_2 = Mpy_32_16_1( filter_frame_imag_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 + Word32 temp_2 = Mpy_32_32( filter_frame_imag_fx, filter_coeff_den_real_fx[l] ); // q_decorr - 3 temp_2 = L_shl( temp_2, 3 ); // q_decorr decorr_buffer_ptr_fx[1] = L_sub( L_add( decorr_buffer_ptr_fx[1], frame_ma_fx[2 * l + 1] ), temp_2 ); // q_decorr move32(); @@ -1146,16 +1147,16 @@ void ivas_dirac_dec_decorr_close_fx( static void get_lattice_coeffs_fx( const Word16 band_index, // Q0 const Word16 channel_index, // Q0 - Word16 *lattice_coeffs ) // Q12 + Word32 *lattice_coeffs ) // Q31 { Word16 k; FOR( k = 0; k < ap_filter_length[band_index]; k++ ) { - Word16 cur_lattice_coeff = ap_lattice_coeffs_fx[band_index][add( imult1616( channel_index, ap_filter_length[band_index] ), k )]; // Q12 - lattice_coeffs[k] = cur_lattice_coeff; // Q12 - move16(); - move16(); + Word32 cur_lattice_coeff = ap_lattice_coeffs_fx[band_index][add( imult1616( channel_index, ap_filter_length[band_index] ), k )]; // Q31 + lattice_coeffs[k] = cur_lattice_coeff; // Q31 + move32(); + move32(); } return; @@ -1165,40 +1166,40 @@ static void get_lattice_coeffs_fx( /* convert lattice filter coeffs to all pass transfer function coeffs */ static void lattice2allpass_fx( const Word16 filter_length, // Q0 - const Word16 *lattice_coeffs_fx, // Q15 - Word16 *filter_coeffs_num_real_fx, // Q12 - Word16 *filter_coeffs_den_real_fx ) // Q12 + const Word32 *lattice_coeffs_fx, // Q31 + Word32 *filter_coeffs_num_real_fx, // Q28 + Word32 *filter_coeffs_den_real_fx ) // Q28 { Word16 i, p; - Word16 alpha_real_fx[2][DIRAC_MAX_DECORR_FILTER_LEN + 1]; - Word16 *alpha_real_p_old_fx = &alpha_real_fx[0][0]; - Word16 *alpha_real_p_fx = &alpha_real_fx[1][0]; - Word16 *tmp_fx; + Word32 alpha_real_fx[2][DIRAC_MAX_DECORR_FILTER_LEN + 1]; + Word32 *alpha_real_p_old_fx = &alpha_real_fx[0][0]; + Word32 *alpha_real_p_fx = &alpha_real_fx[1][0]; + Word32 *tmp_fx; FOR( i = 0; i < 2; i++ ) { - set16_fx( alpha_real_fx[i], 0, DIRAC_MAX_DECORR_FILTER_LEN + 1 ); + set32_fx( alpha_real_fx[i], 0, DIRAC_MAX_DECORR_FILTER_LEN + 1 ); } - alpha_real_p_fx[0] = ONE_IN_Q12; - move16(); - alpha_real_p_old_fx[0] = ONE_IN_Q12; - move16(); + alpha_real_p_fx[0] = ONE_IN_Q28; + move32(); + alpha_real_p_old_fx[0] = ONE_IN_Q28; + move32(); /* recursion */ - Word16 lattice_alpha = 0; - move16(); + Word32 lattice_alpha = 0; + move32(); FOR( p = 1; p < filter_length; p++ ) { - alpha_real_p_fx[p] = shr( lattice_coeffs_fx[( p - 1 )], 3 ); /* Q12 */ + alpha_real_p_fx[p] = L_shr( lattice_coeffs_fx[( p - 1 )], 3 ); /* Q28 */ move16(); FOR( i = 1; i < p; i++ ) { - lattice_alpha = mult( lattice_coeffs_fx[( p - 1 )], alpha_real_p_old_fx[sub( p, i )] ); /* Q12 */ - alpha_real_p_fx[i] = add( alpha_real_p_old_fx[i], lattice_alpha ); /* Q12 */ - move16(); + lattice_alpha = Mpy_32_32( lattice_coeffs_fx[( p - 1 )], alpha_real_p_old_fx[sub( p, i )] ); /* Q28 */ + alpha_real_p_fx[i] = L_add( alpha_real_p_old_fx[i], lattice_alpha ); /* Q28 */ + move32(); } /* switch pointers */ tmp_fx = alpha_real_p_old_fx; @@ -1208,10 +1209,10 @@ static void lattice2allpass_fx( FOR( i = 0; i < filter_length; i++ ) { - filter_coeffs_den_real_fx[i] = alpha_real_p_old_fx[i]; /* Q12 */ - move16(); - filter_coeffs_num_real_fx[i] = alpha_real_p_old_fx[sub( sub( filter_length, i ), 1 )]; /* Q12 */ - move16(); + filter_coeffs_den_real_fx[i] = alpha_real_p_old_fx[i]; /* Q28 */ + move32(); + filter_coeffs_num_real_fx[i] = alpha_real_p_old_fx[sub( sub( filter_length, i ), 1 )]; /* Q28 */ + move32(); } return; diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index e7d6c6293..f62440749 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -51,10 +51,10 @@ extern const Word16 diffuse_response_CICP16_fx[9]; /*Q-15*/ extern const Word16 ap_pre_delay[DIRAC_DECORR_NUM_SPLIT_BANDS]; extern const Word16 ap_filter_length[DIRAC_DECORR_NUM_SPLIT_BANDS]; extern const Word16 ap_lattice_delta_phi_fx[DIRAC_MAX_NUM_DECORR_FILTERS * DIRAC_MAX_DECORR_FILTER_LEN]; /*Q-14*/ -extern const Word16 ap_lattice_coeffs_1_fx[DIRAC_DECORR_FILTER_LEN_1 * DIRAC_MAX_NUM_DECORR_FILTERS]; /*Q-15*/ -extern const Word16 ap_lattice_coeffs_2_fx[DIRAC_DECORR_FILTER_LEN_2 * DIRAC_MAX_NUM_DECORR_FILTERS]; /*Q-15*/ -extern const Word16 ap_lattice_coeffs_3_fx[DIRAC_DECORR_FILTER_LEN_3 * DIRAC_MAX_NUM_DECORR_FILTERS]; /*Q-15*/ -extern const Word16 *const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS]; +extern const Word32 ap_lattice_coeffs_1_fx[DIRAC_DECORR_FILTER_LEN_1 * DIRAC_MAX_NUM_DECORR_FILTERS]; /*Q-15*/ +extern const Word32 ap_lattice_coeffs_2_fx[DIRAC_DECORR_FILTER_LEN_2 * DIRAC_MAX_NUM_DECORR_FILTERS]; /*Q-15*/ +extern const Word32 ap_lattice_coeffs_3_fx[DIRAC_DECORR_FILTER_LEN_3 * DIRAC_MAX_NUM_DECORR_FILTERS]; /*Q-15*/ +extern const Word32 *const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS]; extern const Word16 ap_split_frequencies_fx[DIRAC_DECORR_NUM_SPLIT_BANDS + 1]; /*Q-14*/ extern const Word16 sba_map_tc[11]; /*Q-0*/ diff --git a/lib_rend/ivas_rom_rend_fx.c b/lib_rend/ivas_rom_rend_fx.c index 2b46ff611..4f101582c 100644 --- a/lib_rend/ivas_rom_rend_fx.c +++ b/lib_rend/ivas_rom_rend_fx.c @@ -76,11 +76,10 @@ const Word16 ap_lattice_delta_phi_fx[DIRAC_MAX_NUM_DECORR_FILTERS*DIRAC_MAX_DECO 29799 , 15800 , 24520 , 10977 , 25165 , 30177 , 16042 , 10060 , 30789 , 8397 , 19121 , 1339 , 29056 , 25160 , 12415 , 3611 , 25203 , 20991 , 4951 , 14580 , 13083 , 24188 , 27295 , 14997 , 22841 , 12403 , 5735 , 19656 , 21619 , 18488 , 10360 , 12954 , 7563 , 27744 , 25189 , 5677 , 7107 , 28747 , 9026 , 11251 , 12524 , 29372 , 24412 }; -const Word16 ap_lattice_coeffs_1_fx[330] /* Q15 */ = { 26061, 16472, 6699, 13650, 15061, 8862, -6617, 917, 2222, -1724, -1270, -1880, 671, 12048, -19454, 17487, 6635, -63, 6392, -6044, -7663, 7474, -10790, -11098, -2611, 1716, -310, 5859, 6253, -15691, 1442, 25837, 4375, -5690, 17871, 22329, 10907, 9656, 10658, 1560, 5157, 3810, 7175, -6201, -10400, -24696, 25309, -16625, 9076, -22700, 7612, -11624, -511, -7309, 10174, -1147, 2810, -16383, 7053, 6599, -16238, -9884, 6439, 10687, -19476, 10319, 21911, 2511, 1497, -4089, -6660, -9738, 4122, -5881, -6611, 5279, 12977, 8745, 11684, 15995, -1843, 4563, -9712, -3697, 1225, -12039, -7087, -9088, 12760, 3772, -7879, -8880, 13982, -362, 4974, 8306, 7397, 16341, -4468, 14516, -9994, -1025, -352, 5581, 16268, -4583, -7929, -3435, 9645, -2219, -16128, -15978, 1192, 3584, 12981, -11562, -6747, -2719, -15172, -10135, 848, -3029, -4100, -5115, -160, 5847, 2935, 1468, 7805, -10227, -12802, -5850, 14890, 12681, -12742, -6481, 1164, 14922, -1782, 12452, 9534, 1599, 2576, 7265, -7128, 3974, -12998, -7159, -4170, -8831, -11279, -15238, -13808, -852, 7259, 11861, -11411, 9666, 11998, 2315, -2819, 8261, 5113, -2057, 13401, 7944, -9888, -2167, 12735, -15146, -5206, 7562, -3053, 1542, 2405, -10977, 751, 11619, 2372, 638, 11039, -15746, 5579, 8508, -12896, -11422, -3570, 9137, 12631, 11870, -10444, 11872, 9467, 9542, -9110, -14722, -9453, -13565, -13280, -9671, -8031, 82, 9433, 11410, -5844, -6767, 11504, -15800, 699, -16128, 1593, 14853, 3576, 7621, -15524, 4603, 11551, -3231, 4822, -1828, 3530, -7570, 11708, 11404, 7615, -10642, 5324, 1888, -1990, -319, -7346, -9252, -2144, 2119, 9187, -9335, -15417, 638, -14493, 12360, 14659, -9519, 11322, 12130, -10260, 3918, 9830, 13336, -9106, 14648, 6383, 5167, -7320, -4822, 12421, -7089, 4520, -13014, 2421, -8949, -14517, -5515, 11346, 1230, 2142, 5370, -4014, 11975, -10365, 3842, -9872, 5558, -11025, 8844, -13767, -10855, 16335, -12878, -15144, -10587, 15432, -11778, 8661, 7104, 16167, 4963, -10539, 15217, -11654, 13775, 6039, -9900, 4474, -8285, 6353, 9790, 7825, -12658, -5963, -2533, 4090, -8630, 12766, 147, 11134, 13605, 12378, 13114, 11548, -124, -6046, 14199, -7784, 4839, 13343, 2215, -8169, -11600, 10516, 13959, 10144, -6215, -6863, 5209, -2684, 12675, 5851, -13341, 7280, -4885, }; -const Word16 ap_lattice_coeffs_2_fx[132] /* Q15 */ = { 20764, 22321, -1619, 9395, 4784, 4436, -13439, -6775, -21527, -3334, 14296, 11135, -4305, -25354, -9883, 10733, 10886, 6745, 23514, -18100, -4919, 1787, 7848, -21249, -23653, 6205, 2234, 203, 2523, 1267, 13874, -3560, 14157, -13586, 9104, 13712, 2549, -9275, -11698, 151, -14504, -12200, 13216, 7963, 10301, 14565, 11387, 16254, 3552, 15380, -5579, 10692, 5641, 14428, 1914, 11130, -6388, 16096, -9217, -1412, -15810, -10977, -11015, 6437, -5394, 14499, -4429, -11612, 14815, -10198, -11391, 16329, -9469, 12334, -5830, 6407, 10940, -5003, 1744, 15000, 14499, 7708, -11310, -9374, 5093, 13283, 7113, -3537, 350, 12090, -16330, -16246, -7060, -3075, 10494, -453, 16036, 15427, -2157, 11366, 893, 4918, 15860, -16298, 5531, -16182, -5686, 10966, 8658, -13914, -10319, 8293, 13021, -16107, -14867, -15183, -626, 11, 10336, 15477, 3117, 9285, -7375, -3924, -15626, 1229, 11041, 16204, -2051, 5821, 15200, 16032, }; -const Word16 ap_lattice_coeffs_3_fx[66] /* Q15 */ = { 621, -6953, 13851, -13128, -3502, -805, 4587, 9161, 1060, 20726, 18957, -24071, 563, 433, -908, -11578, -15799, -16097, 14975, 5410, 15391, -6412, 14421, -15642, 11802, -16074, 15880, -5694, 247, 9115, 14234, 1977, -6347, -1104, 16260, 96, -15756, -3589, -760, 10639, -9570, -11670, -12012, 12481, -9887, 3614, 12575, 9960, -16373, -11455, 10969, -662, -14092, -5069, -12161, 10947, 11367, -5465, -7506, 3865, 11183, 16071, 16176, -12049, 13976, -1499, }; - -const Word16 * const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS] = +const Word32 ap_lattice_coeffs_1_fx[330] /* Q31 */ = { 1707955968, 1079539968, 439065920, 894568704, 987086592, 580795520, -433671424, 60123100, 145623008, -113015624, -83277272, -123237648, 43980464, 789623296, -1274971776, 1146041216, 434865440, -4194035, 418933248, -396120544, -502225568, 489841024, -707151360, -727382784, -171154448, 112504520, -20332376, 383985120, 409832224, -1028380544, 94536528, 1693286528, 286751360, -372925568, 1171218304, 1463361920, 714828608, 632831232, 698492672, 102256728, 338016064, 249692224, 470255968, -406406976, -681613440, -1618517632, 1658684160, -1089598848, 594810048, -1487723008, 498864736, -761839168, -33543694, -479015552, 666806528, -75234944, 184217584, -1073737536, 462267328, 432535424, -1064187648, -647809920, 422002016, 700395328, -1276386944, 676287680, 1435960064, 164589584, 98163624, -267984480, -436523296, -638210688, 270166336, -385436800, -433269856, 346019744, 850510912, 573156928, 765762624, 1048283392, -120804544, 299101536, -636524864, -242330640, 80326624, -789039168, -464483520, -595626048, 836273088, 247207584, -516360288, -582000256, 916374208, -23749022, 326015936, 544365632, 484824512, 1070984448, -292867392, 951343872, -655019008, -67237712, -23117662, 365821696, 1066178368, -300379264, -519686752, -225163664, 632096768, -145444768, -1056995776, -1047134528, 78157664, 234919680, 850736384, -757728896, -442194816, -178238992, -994355776, -664208128, 55589760, -198547744, -268733952, -335258720, -10494753, 383196992, 192384464, 96265248, 511571392, -670272576, -838996096, -383418176, 975855232, 831101952, -835100544, -424765824, 76321568, 977938304, -116844584, 816118976, 624840448, 104805792, 168871664, 476183040, -467180768, 260466144, -851865984, -469186528, -273299520, -578761856, -739202496, -998661504, -904981824, -55901148, 475768544, 777374080, -747846144, 633471168, 786354816, 151747632, -184790960, 541442880, 335149184, -134861968, 878260672, 520681024, -648033280, -142077520, 834621696, -992624896, -341192192, 495630624, -200100384, 101094944, 157629600, -719445696, 49263276, 761521344, 155458496, 41817948, 723487232, -1031938880, 365645600, 557622016, -845198016, -748587008, -233994112, 598808640, 827833472, 777923776, -684486784, 778044032, 620485312, 625355840, -597041280, -964868672, -619576960, -889000256, -870330048, -633834112, -526369728, 5433133, 618239040, 747816064, -383012288, -443491872, 753940736, -1035527360, 45870252, -1057006464, 104457896, 973415680, 234419312, 499502560, -1017436928, 301725760, 757045952, -211754768, 316049472, -119823144, 231367744, -496124544, 767317376, 747390912, 499083776, -697476928, 348923136, 123795992, -130425272, -20920786, -481433632, -606352768, -140537776, 138935744, 602089984, -611830976, -1010393216, 41841572, -949849216, 810060928, 960749824, -623839680, 742015744, 795013504, -672420096, 256821872, 644275136, 874015104, -596832960, 960008960, 418381344, 338664608, -479752128, -316038720, 814053056, -464590912, 296281888, -852937536, 158709776, -586499264, -951414720, -361479488, 743596288, 80622976, 140417520, 351974720, -263116144, 784855872, -679294144, 251841856, -646998144, 364266912, -722555264, 579635904, -902286720, -711452736, 1070569984, -843980416, -992532608, -693845504, 1011415424, -771940928, 567612160, 465568000, 1059568448, 325320160, -690744576, 997319296, -763801920, 902804288, 395774784, -648814912, 293208832, -542989120, 416409952, 641614400, 512836288, -829568640, -390839872, -166056320, 268091856, -565634304, 836672512, 9667971, 729723520, 891643776, 811214080, 859468032, 756829056, -8177617, -396275168, 930607744, -510143328, 317148960, 874476800, 145204256, -535395584, -760230656, 689206976, 914828032, 664809408, -407354016, -449784000, 341379040, -175941184, 830706816, 383501920, -874332928, 477147232, -320183360}; +const Word32 ap_lattice_coeffs_2_fx[132] /* Q31 */ = { 1360843264, 1462880896, -106124344, 615715776, 313579872, 290773568, -880779712, -444026592, -1410828032, -218497872, 936944960, 729753600, -282142848, -1661606912, -647739072, 703431872, 713452032, 442076704, 1541038592, -1186205568, -322414592, 117158120, 514363136, -1392593792, -1550156800, 406684000, 146426176, 13348758, 165409920, 83060376, 909276800, -233341280, 927820288, -890434752, 596656832, 898691840, 167097856, -607873152, -766668864, 9951439, -950562176, -799540352, 866157440, 521887904, 675097984, 954584384, 746287104, 1065244224, 232804400, 1007990144, -365686400, 700745408, 369704352, 945610048, 125449552, 729442240, -418684160, 1054884800, -604078592, -92599496, -1036132928, -719417728, -721895936, 421913952, -353525216, 950242176, -290318304, -761035968, 970948224, -668342016, -746551232, 1070181312, -620620608, 808379392, -382088896, 419923232, 716984640, -327914304, 114310552, 983047168, 950209984, 505204128, -741223296, -614390784, 333800576, 870574848, 466160704, -231842336, 22973780, 792393536, -1070215680, -1064756736, -462737632, -201582144, 687787456, -29725468, 1050991360, 1011065344, -141377440, 744899776, 58581208, 322307232, 1039409984, -1068139008, 362486656, -1060515456, -372648544, 718711232, 567440320, -911931072, -676298432, 543498048, 853369216, -1055627776, -974371328, -995053760, -41077068, 738734, 677385088, 1014353152, 204309440, 608543168, -483372800, -257186944, -1024072704, 80584320, 723596736, 1061954304, -134438912, 381504768, 996200512, 1050733696}; +const Word32 ap_lattice_coeffs_3_fx[66] /* Q31 */ = { 1360843264, 1462880896, -106124344, 615715776, 313579872, 290773568, -880779712, -444026592, -1410828032, -218497872, 936944960, 729753600, -282142848, -1661606912, -647739072, 703431872, 713452032, 442076704, 1541038592, -1186205568, -322414592, 117158120, 514363136, -1392593792, -1550156800, 406684000, 146426176, 13348758, 165409920, 83060376, 909276800, -233341280, 927820288, -890434752, 596656832, 898691840, 167097856, -607873152, -766668864, 9951439, -950562176, -799540352, 866157440, 521887904, 675097984, 954584384, 746287104, 1065244224, 232804400, 1007990144, -365686400, 700745408, 369704352, 945610048, 125449552, 729442240, -418684160, 1054884800, -604078592, -92599496, -1036132928, -719417728, -721895936, 421913952, -353525216, 950242176}; +const Word32 * const ap_lattice_coeffs_fx[DIRAC_DECORR_NUM_SPLIT_BANDS] = { &ap_lattice_coeffs_1_fx[0], &ap_lattice_coeffs_2_fx[0], diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 0515e4038..17474bfe7 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -120,8 +120,8 @@ typedef struct dirac_decorr_params_structure Word16 *pre_delay; Word16 *filter_length; - Word16 *filter_coeff_num_real_fx; /* Q12 */ - Word16 *filter_coeff_den_real_fx; /* Q12 */ + Word32 *filter_coeff_num_real_fx; /* Q28 */ + Word32 *filter_coeff_den_real_fx; /* Q28 */ Word16 *phase_coeff_real_fx; /* Q14 */ Word16 *phase_coeff_imag_fx; /* Q14 */ Word16 *split_frequency_bands; -- GitLab From 1609478cc3e8fee37f8a9bf2d43f9da3fc9d0f36 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 30 Apr 2025 14:46:00 +0530 Subject: [PATCH 2/2] Clang formatting changes --- lib_rend/ivas_dirac_decorr_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_dirac_decorr_dec_fx.c b/lib_rend/ivas_dirac_decorr_dec_fx.c index 4db9cd09a..9b2bf02d7 100644 --- a/lib_rend/ivas_dirac_decorr_dec_fx.c +++ b/lib_rend/ivas_dirac_decorr_dec_fx.c @@ -1154,7 +1154,7 @@ static void get_lattice_coeffs_fx( FOR( k = 0; k < ap_filter_length[band_index]; k++ ) { Word32 cur_lattice_coeff = ap_lattice_coeffs_fx[band_index][add( imult1616( channel_index, ap_filter_length[band_index] ), k )]; // Q31 - lattice_coeffs[k] = cur_lattice_coeff; // Q31 + lattice_coeffs[k] = cur_lattice_coeff; // Q31 move32(); move32(); } -- GitLab