Loading lib_com/ivas_qmetadata_com.c +39 −0 Original line number Diff line number Diff line Loading @@ -526,9 +526,18 @@ ivas_error only_reduce_bits_direction_fx( Word16 *bits_dir0; Word16 bits_sph_idx_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; #ifdef FIX_QMETADATA_PENALTY Word32 penalty[MASA_MAXIMUM_CODING_SUBBANDS]; Word16 tmp; #else Word16 penalty[MASA_MAXIMUM_CODING_SUBBANDS]; Word16 shift, tmp, tmp_e, flag; Word32 tmp_32; #endif FOR( j = 0; j < coding_subbands; j++ ) { FOR( k = 0; k < no_subframes; k++ ) Loading Loading @@ -612,6 +621,34 @@ ivas_error only_reduce_bits_direction_fx( } ELSE { #ifdef FIX_QMETADATA_PENALTY FOR( j = 0; j < coding_subbands; j++ ) { penalty[j] = 1; move32(); FOR( k = 0; k < coding_subbands; k++ ) { IF( NE_16(k, j) ) { penalty[j] = L_shr( W_extract_l( W_mult_32_16( penalty[j], bits_sph_idx_orig[k][0] ) ), 1 ); } } tmp = sub( bits_sph_idx_orig[j][0], q_direction->band_data[j].bits_sph_idx[0] ); FOR( k = 1; k < no_subframes; k++ ) { tmp = add( tmp, sub( bits_sph_idx_orig[j][k], q_direction->band_data[j].bits_sph_idx[k] ) ) ; } penalty[j] = L_shr(W_extract_l( W_mult_32_16( penalty[j], tmp )), 1); } sort_desc_ind_32_fx( penalty, coding_subbands, ind_order ); for ( j = 0; j < coding_subbands; j++ ) { printf( "%d ", ind_order[j] ); } printf( "\n" ); #else FOR( j = 0; j < coding_subbands; j++ ) { penalty[j] = 0; Loading Loading @@ -669,6 +706,8 @@ ivas_error only_reduce_bits_direction_fx( } } sort_desc_ind_16_fx( penalty, coding_subbands, ind_order ); #endif } *reduce_bits_out = negate( reduce_bits ); Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ #define SIMPLIFY_CODE_BE // Simplify synthesis loop #define CR_2109_to_2112_cd0_ce0 /* This is related to the CRs include in the 26.444 package of 21-12. Concerns lead_deindexing and */ #define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */ /* ##################### End NON-BE switches ########################### */ Loading Loading
lib_com/ivas_qmetadata_com.c +39 −0 Original line number Diff line number Diff line Loading @@ -526,9 +526,18 @@ ivas_error only_reduce_bits_direction_fx( Word16 *bits_dir0; Word16 bits_sph_idx_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES]; #ifdef FIX_QMETADATA_PENALTY Word32 penalty[MASA_MAXIMUM_CODING_SUBBANDS]; Word16 tmp; #else Word16 penalty[MASA_MAXIMUM_CODING_SUBBANDS]; Word16 shift, tmp, tmp_e, flag; Word32 tmp_32; #endif FOR( j = 0; j < coding_subbands; j++ ) { FOR( k = 0; k < no_subframes; k++ ) Loading Loading @@ -612,6 +621,34 @@ ivas_error only_reduce_bits_direction_fx( } ELSE { #ifdef FIX_QMETADATA_PENALTY FOR( j = 0; j < coding_subbands; j++ ) { penalty[j] = 1; move32(); FOR( k = 0; k < coding_subbands; k++ ) { IF( NE_16(k, j) ) { penalty[j] = L_shr( W_extract_l( W_mult_32_16( penalty[j], bits_sph_idx_orig[k][0] ) ), 1 ); } } tmp = sub( bits_sph_idx_orig[j][0], q_direction->band_data[j].bits_sph_idx[0] ); FOR( k = 1; k < no_subframes; k++ ) { tmp = add( tmp, sub( bits_sph_idx_orig[j][k], q_direction->band_data[j].bits_sph_idx[k] ) ) ; } penalty[j] = L_shr(W_extract_l( W_mult_32_16( penalty[j], tmp )), 1); } sort_desc_ind_32_fx( penalty, coding_subbands, ind_order ); for ( j = 0; j < coding_subbands; j++ ) { printf( "%d ", ind_order[j] ); } printf( "\n" ); #else FOR( j = 0; j < coding_subbands; j++ ) { penalty[j] = 0; Loading Loading @@ -669,6 +706,8 @@ ivas_error only_reduce_bits_direction_fx( } } sort_desc_ind_16_fx( penalty, coding_subbands, ind_order ); #endif } *reduce_bits_out = negate( reduce_bits ); Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ #define SIMPLIFY_CODE_BE // Simplify synthesis loop #define CR_2109_to_2112_cd0_ce0 /* This is related to the CRs include in the 26.444 package of 21-12. Concerns lead_deindexing and */ #define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */ /* ##################### End NON-BE switches ########################### */ Loading