Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ #define FIX_2383_INIT_Q_A_ITF /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */ #define FIX_2382_COPY_AQ_IN_MCT /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */ #define FIX_2391_INIT_HQ_GENERIC_OFFSET /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */ #define FIX_2402_SIMPLIFY_ARI_CODEC /* FhG: basop issue 2402: simplify processing in arithmetic decoding, symbol table lookup, all BE */ /* #################### End BE switches ################################## */ Loading lib_dec/ari_dec_fx.c +41 −1 Original line number Diff line number Diff line Loading @@ -13,6 +13,16 @@ * Ari decode 14 bits routines -------------------------------------------------------------*/ #ifdef FIX_2402_SIMPLIFY_ARI_CODEC static Word32 L_msui_32_16(Word32 cum, Word32 range, Word16 cum_freq) { /* WMOPS counting is done using L_sub, similar to other MSU operations */ /* Note: range*cum_freq do never exceed signed 32-bit, when multiplied */ /* Note: No overflow or saturation feature required. */ return L_sub(cum, range * cum_freq ); } #endif Word32 ari_decode_overflow_fx( Tastat *s ) { return ( L_sub( L_sub( s->high, 1 ), s->low ) <= 0 ); Loading Loading @@ -77,9 +87,11 @@ static Word16 ari_lookup_s17_fx( UWord16 const *cum_freq /* Q0 */ ) { Word32 tmp; const UWord16 *p; #ifndef FIX_2402_SIMPLIFY_ARI_CODEC Word32 tmp; Word16 range_l, range_h; #endif p = cum_freq; Loading @@ -88,6 +100,7 @@ static Word16 ari_lookup_s17_fx( /* tmp_p = p+8; if (tmp_p[0]*range>cum) p = tmp_p; */ /* max value in p[x] is 16384 => 14 bits */ #ifndef FIX_2402_SIMPLIFY_ARI_CODEC range_l = extract_l( L_and( range, 0x7FFF ) ); range_h = extract_l( L_shr( range, 15 ) ); Loading Loading @@ -122,6 +135,33 @@ static Word16 ari_lookup_s17_fx( p = p + 1; } } #else if (L_msui_32_16(cum, range, p[8]) < 0) { p = p + 8; move16(); } if (L_msui_32_16(cum, range, p[4]) < 0) { p = p + 4; move16(); } if (L_msui_32_16(cum, range, p[2]) < 0) { p = p + 2; move16(); } if (L_msui_32_16(cum, range, p[1]) < 0) { p = p + 1; move16(); IF( EQ_32( (Word32) ( &cum_freq[15] - p ), 0 ) && (L_msui_32_16(cum, range, p[1] ) < 0) ) { p = p + 1; move16(); } } #endif /* return extract_l(L_shr(L_sub((Word32)p,(Word32)cum_freq),1)); */ L_sub( 0, 0 ); Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ #define FIX_2383_INIT_Q_A_ITF /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */ #define FIX_2382_COPY_AQ_IN_MCT /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */ #define FIX_2391_INIT_HQ_GENERIC_OFFSET /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */ #define FIX_2402_SIMPLIFY_ARI_CODEC /* FhG: basop issue 2402: simplify processing in arithmetic decoding, symbol table lookup, all BE */ /* #################### End BE switches ################################## */ Loading
lib_dec/ari_dec_fx.c +41 −1 Original line number Diff line number Diff line Loading @@ -13,6 +13,16 @@ * Ari decode 14 bits routines -------------------------------------------------------------*/ #ifdef FIX_2402_SIMPLIFY_ARI_CODEC static Word32 L_msui_32_16(Word32 cum, Word32 range, Word16 cum_freq) { /* WMOPS counting is done using L_sub, similar to other MSU operations */ /* Note: range*cum_freq do never exceed signed 32-bit, when multiplied */ /* Note: No overflow or saturation feature required. */ return L_sub(cum, range * cum_freq ); } #endif Word32 ari_decode_overflow_fx( Tastat *s ) { return ( L_sub( L_sub( s->high, 1 ), s->low ) <= 0 ); Loading Loading @@ -77,9 +87,11 @@ static Word16 ari_lookup_s17_fx( UWord16 const *cum_freq /* Q0 */ ) { Word32 tmp; const UWord16 *p; #ifndef FIX_2402_SIMPLIFY_ARI_CODEC Word32 tmp; Word16 range_l, range_h; #endif p = cum_freq; Loading @@ -88,6 +100,7 @@ static Word16 ari_lookup_s17_fx( /* tmp_p = p+8; if (tmp_p[0]*range>cum) p = tmp_p; */ /* max value in p[x] is 16384 => 14 bits */ #ifndef FIX_2402_SIMPLIFY_ARI_CODEC range_l = extract_l( L_and( range, 0x7FFF ) ); range_h = extract_l( L_shr( range, 15 ) ); Loading Loading @@ -122,6 +135,33 @@ static Word16 ari_lookup_s17_fx( p = p + 1; } } #else if (L_msui_32_16(cum, range, p[8]) < 0) { p = p + 8; move16(); } if (L_msui_32_16(cum, range, p[4]) < 0) { p = p + 4; move16(); } if (L_msui_32_16(cum, range, p[2]) < 0) { p = p + 2; move16(); } if (L_msui_32_16(cum, range, p[1]) < 0) { p = p + 1; move16(); IF( EQ_32( (Word32) ( &cum_freq[15] - p ), 0 ) && (L_msui_32_16(cum, range, p[1] ) < 0) ) { p = p + 1; move16(); } } #endif /* return extract_l(L_shr(L_sub((Word32)p,(Word32)cum_freq),1)); */ L_sub( 0, 0 ); Loading