Loading lib_com/cnst.h +4 −0 Original line number Diff line number Diff line Loading @@ -2731,7 +2731,11 @@ extern const Word16 Idx2Freq_Tbl[]; /* 'x' is converted to Q6, 'Freq_Tbl'/1000 in Q9 */ /* only works for 'fs' = [8000,12800,16000,25600,32000,48000] (unpredictable otherwise) */ /* 15625 is 1000000.0f/Q6 but we use the calculated value to avoid float point code */ #ifdef FIX_2286_GCC_WARNING_Idx2Freq_Tbl #define NS2SA_FX2(fs,x) (chk_fs(fs) mult(Idx2Freq_Tbl[L_and(L_shr(fs,8),7)-2], (Word16)((x)/15625))) #else #define NS2SA_FX2(fs,x) (chk_fs(fs) mult((&Idx2Freq_Tbl[-2])[L_and(L_shr(fs,8),7)], (Word16)((x)/15625))) #endif #define L_FRAME_12k8 256 /* Frame size at 12k8Hz: 20ms = 256 samples */ #define L_FRAME_16k 320 /* Frame size at 16kHz: 20ms = 320 samples */ Loading lib_com/log2.c +20 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ Word16 Log2_norm_lc( /* (o) : Fractional part of Log2. (range: 0<=val i = mac_r( L_x, -32 * 2 - 1, 16384 ); /* Extract b25-b31 minus 32 */ #ifdef FIX_2284_ADD_ASSERT_LOG assert( ( i >= 0 ) && ( i < (Word16) ( sizeof( L_table_Log2_norm_lc ) / sizeof( L_table_Log2_norm_lc[0] ) ) ) && ( i < (Word16) ( sizeof( table_diff_Log2_norm_lc ) / sizeof( table_diff_Log2_norm_lc[0] ) ) ) ); #endif y = mac_r( L_table_Log2_norm_lc[i], table_diff_Log2_norm_lc[i], a ); /* table[i] << 16 - diff*a*2 */ return y; Loading @@ -80,6 +84,9 @@ Word16 Log2_norm_lc( /* (o) : Fractional part of Log2. (range: 0<=val Word32 log10_fx( Word32 Linput ) /*o : Q23, i: 2Q13*/ { Word16 n1, frac, p1, p2, q1; #ifdef FIX_2284_ADD_ASSERT_LOG Word16 idx; #endif Word32 Ltemp1, Ltemp2; Word32 L_tmp; Loading @@ -94,10 +101,23 @@ Word32 log10_fx( Word32 Linput ) /*o : Q23, i: 2Q13*/ Ltemp2 = L_mult( extract_h( Ltemp1 ), 0x40 ); frac = extract_l( Ltemp2 ); #ifdef FIX_2284_ADD_ASSERT_LOG idx = sub( extract_h( Ltemp2 ), 0x20 ); assert( idx >= 0 && idx < (Word16) ( sizeof( log2_tab ) / sizeof( log2_tab[0] ) ) ); p1 = log2_tab[idx]; move16(); idx = sub( extract_h( Ltemp2 ), 0x1F ); assert( idx >= 0 && idx < (Word16) ( sizeof( log2_tab ) / sizeof( log2_tab[0] ) ) ); p2 = log2_tab[idx]; move16(); #else p1 = log2_tab[sub( extract_h( Ltemp2 ), 0x20 )]; move16(); p2 = log2_tab[sub( extract_h( Ltemp2 ), 0x1F )]; move16(); #endif Ltemp2 = L_mult( n1, 0x200 ); n1 = extract_l( Ltemp2 ); Loading lib_com/options.h +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,16 @@ #define FIX_2248_EVS_ASSERT /* VA: Include _sat in an EVS related part of the code */ #define FIX_2254_IMPROV_COMPLEXITY_BE /* VA: BE small complexity reduction */ #define FIX_2275_OOB_INDEXING_IN_PREDICT_SIGNAL_FUNC /* FhG: fix a USAN OOB error */ #define FIX_2284_ADD_ASSERT_LOG /* FhG: add asserts to Log2_norm_lc() and log10_fx() */ #define FIX_2286_GCC_WARNING_Idx2Freq_Tbl /* FhG: Fix compiler warning for OOB access of Idx2Freq_Tbl[] */ #define FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */ #define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */ #define FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ #define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */ #define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ /* #################### End BE switches ################################## */ Loading lib_dec/ACcontextMapping_dec_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -614,6 +614,7 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( move16(); s = 0; move16(); /* Main Loop through the 2-tuples */ FOR( k = 0; k < lastnz; k += 2 ) { Loading Loading @@ -701,9 +702,15 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( c = add( 12, esc_nb ); } #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = shl( s_and( s, 0x0F ), 4 ); /*Shift old 4 bits*/ s = add( s, c ); /*replace last 4 bits*/ t = s_and( s, 0xFF ); #else s = (UWord16) L_shl( s, 4 ); /*Shift old 4 bits*/ s = (UWord16) L_add( s, c ); /*replace last 4 bits*/ t = (UWord16) L_and( s, 0xFF ); #endif } /* Decode signs */ Loading lib_dec/ivas_mct_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -699,7 +699,11 @@ ivas_error mct_dec_reconfigure_fx( move16(); /* MDCT stereo initialization */ #ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) #else IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) #endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } Loading Loading
lib_com/cnst.h +4 −0 Original line number Diff line number Diff line Loading @@ -2731,7 +2731,11 @@ extern const Word16 Idx2Freq_Tbl[]; /* 'x' is converted to Q6, 'Freq_Tbl'/1000 in Q9 */ /* only works for 'fs' = [8000,12800,16000,25600,32000,48000] (unpredictable otherwise) */ /* 15625 is 1000000.0f/Q6 but we use the calculated value to avoid float point code */ #ifdef FIX_2286_GCC_WARNING_Idx2Freq_Tbl #define NS2SA_FX2(fs,x) (chk_fs(fs) mult(Idx2Freq_Tbl[L_and(L_shr(fs,8),7)-2], (Word16)((x)/15625))) #else #define NS2SA_FX2(fs,x) (chk_fs(fs) mult((&Idx2Freq_Tbl[-2])[L_and(L_shr(fs,8),7)], (Word16)((x)/15625))) #endif #define L_FRAME_12k8 256 /* Frame size at 12k8Hz: 20ms = 256 samples */ #define L_FRAME_16k 320 /* Frame size at 16kHz: 20ms = 320 samples */ Loading
lib_com/log2.c +20 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ Word16 Log2_norm_lc( /* (o) : Fractional part of Log2. (range: 0<=val i = mac_r( L_x, -32 * 2 - 1, 16384 ); /* Extract b25-b31 minus 32 */ #ifdef FIX_2284_ADD_ASSERT_LOG assert( ( i >= 0 ) && ( i < (Word16) ( sizeof( L_table_Log2_norm_lc ) / sizeof( L_table_Log2_norm_lc[0] ) ) ) && ( i < (Word16) ( sizeof( table_diff_Log2_norm_lc ) / sizeof( table_diff_Log2_norm_lc[0] ) ) ) ); #endif y = mac_r( L_table_Log2_norm_lc[i], table_diff_Log2_norm_lc[i], a ); /* table[i] << 16 - diff*a*2 */ return y; Loading @@ -80,6 +84,9 @@ Word16 Log2_norm_lc( /* (o) : Fractional part of Log2. (range: 0<=val Word32 log10_fx( Word32 Linput ) /*o : Q23, i: 2Q13*/ { Word16 n1, frac, p1, p2, q1; #ifdef FIX_2284_ADD_ASSERT_LOG Word16 idx; #endif Word32 Ltemp1, Ltemp2; Word32 L_tmp; Loading @@ -94,10 +101,23 @@ Word32 log10_fx( Word32 Linput ) /*o : Q23, i: 2Q13*/ Ltemp2 = L_mult( extract_h( Ltemp1 ), 0x40 ); frac = extract_l( Ltemp2 ); #ifdef FIX_2284_ADD_ASSERT_LOG idx = sub( extract_h( Ltemp2 ), 0x20 ); assert( idx >= 0 && idx < (Word16) ( sizeof( log2_tab ) / sizeof( log2_tab[0] ) ) ); p1 = log2_tab[idx]; move16(); idx = sub( extract_h( Ltemp2 ), 0x1F ); assert( idx >= 0 && idx < (Word16) ( sizeof( log2_tab ) / sizeof( log2_tab[0] ) ) ); p2 = log2_tab[idx]; move16(); #else p1 = log2_tab[sub( extract_h( Ltemp2 ), 0x20 )]; move16(); p2 = log2_tab[sub( extract_h( Ltemp2 ), 0x1F )]; move16(); #endif Ltemp2 = L_mult( n1, 0x200 ); n1 = extract_l( Ltemp2 ); Loading
lib_com/options.h +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,16 @@ #define FIX_2248_EVS_ASSERT /* VA: Include _sat in an EVS related part of the code */ #define FIX_2254_IMPROV_COMPLEXITY_BE /* VA: BE small complexity reduction */ #define FIX_2275_OOB_INDEXING_IN_PREDICT_SIGNAL_FUNC /* FhG: fix a USAN OOB error */ #define FIX_2284_ADD_ASSERT_LOG /* FhG: add asserts to Log2_norm_lc() and log10_fx() */ #define FIX_2286_GCC_WARNING_Idx2Freq_Tbl /* FhG: Fix compiler warning for OOB access of Idx2Freq_Tbl[] */ #define FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */ #define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */ #define FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #define FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH /* FhG: fix OOB index USAN error in TCX LTP pitch search */ #define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ #define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */ #define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ /* #################### End BE switches ################################## */ Loading
lib_dec/ACcontextMapping_dec_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -614,6 +614,7 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( move16(); s = 0; move16(); /* Main Loop through the 2-tuples */ FOR( k = 0; k < lastnz; k += 2 ) { Loading Loading @@ -701,9 +702,15 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( c = add( 12, esc_nb ); } #ifdef FIX_1464_UBSAN_RC_CONTEXT_MAP s = shl( s_and( s, 0x0F ), 4 ); /*Shift old 4 bits*/ s = add( s, c ); /*replace last 4 bits*/ t = s_and( s, 0xFF ); #else s = (UWord16) L_shl( s, 4 ); /*Shift old 4 bits*/ s = (UWord16) L_add( s, c ); /*replace last 4 bits*/ t = (UWord16) L_and( s, 0xFF ); #endif } /* Decode signs */ Loading
lib_dec/ivas_mct_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -699,7 +699,11 @@ ivas_error mct_dec_reconfigure_fx( move16(); /* MDCT stereo initialization */ #ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) #else IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) #endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } Loading