Skip to content
Commits on Source (3)
...@@ -80,8 +80,6 @@ ...@@ -80,8 +80,6 @@
#define FIX_1978_SAT_MISSING_IN_GAIN_ENC /* VA: Fix add saturation missing that lead to a crash in P800-10 */ #define FIX_1978_SAT_MISSING_IN_GAIN_ENC /* VA: Fix add saturation missing that lead to a crash in P800-10 */
#define FIX_1981_MAXIMUM_EXP_FX /* FhG: Fix bug in function to find maximum value in vector */ #define FIX_1981_MAXIMUM_EXP_FX /* FhG: Fix bug in function to find maximum value in vector */
//#define PITCH_OL_PRINTIND
//#define PITCH_OL_PRINTVAL
#define FIX_1979_SAT_MISSING_IN_LSF_ENC /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */ #define FIX_1979_SAT_MISSING_IN_LSF_ENC /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */
#define FIX_1946_CRASH_JBM_PROCESSING /* FhG: Increased guard bits of DFT_fx */ #define FIX_1946_CRASH_JBM_PROCESSING /* FhG: Increased guard bits of DFT_fx */
......
...@@ -1221,86 +1221,41 @@ Word16 maximum_exp_fx( /* o : index of the maximum value ...@@ -1221,86 +1221,41 @@ Word16 maximum_exp_fx( /* o : index of the maximum value
) )
{ {
Word16 j, ind; Word16 j, ind;
#ifndef FIX_1981_MAXIMUM_EXP_FX
Word16 tmp, exp; Word16 tmp, exp;
ind = 0; ind = 0;
move16(); move16();
#ifndef FIX_1981_MAXIMUM_EXP_FX
tmp = vec_fx[0]; tmp = vec_fx[0];
move16(); move16();
exp = exp_vec[0]; exp = exp_vec[0];
move16(); move16();
#else #else
Word16 tmp, exp, scale; Word16 scale;
ind = 0;
move16();
#endif
#if 0
float vec_float[1024];
for ( int ii = 0; ii < lvec_fx; ii++ )
vec_float[ii] = vec_fx[ii] * pow( 2, exp_vec[ii] - 31 );
#endif
#ifdef FIX_1981_MAXIMUM_EXP_FX
scale = sub( norm_s( vec_fx[ind] ), 1 ); scale = sub( norm_s( vec_fx[ind] ), 1 );
tmp = shl( vec_fx[ind], scale ); tmp = shl( vec_fx[ind], scale );
exp = sub( exp_vec[ind], scale ); exp = sub( exp_vec[ind], scale );
#endif
FOR( j = 1; j < lvec_fx; j++ ) FOR( j = 1; j < lvec_fx; j++ )
{ {
IF( LT_16( tmp, shr_sat( vec_fx[j], sub( exp, exp_vec[j] ) ) ) ) IF( LT_16( tmp, shr_sat( vec_fx[j], sub( exp, exp_vec[j] ) ) ) )
{ {
ind = j; ind = j;
move16(); move16();
#ifdef FIX_1981_MAXIMUM_EXP_FX
scale = sub( norm_s( vec_fx[ind] ), 1 ); scale = sub( norm_s( vec_fx[ind] ), 1 );
tmp = shl( vec_fx[ind], scale ); tmp = shl( vec_fx[ind], scale );
exp = sub( exp_vec[ind], scale ); exp = sub( exp_vec[ind], scale );
}
}
#else #else
FOR( j = 1; j < lvec_fx; j++ )
{
#if 0
// insert assert to find critical bitstreams
{
static int calls = 0;
calls++;
Word16 tmp16, tmp16_1;
Word32 tmp32, tmp32_1;
tmp16 = tmp;
tmp32 = L_deposit_l( tmp );
tmp16_1 = shr_sat( vec_fx[j] , sub( exp, exp_vec[j] ) );
tmp32_1 = L_shr_sat( L_deposit_l( vec_fx[j] ), sub( exp, exp_vec[j] ) );
if ( ( LT_16( tmp16, tmp16_1 ) != LT_32( tmp32, tmp32_1 ) ) )
{
tmp16 = LT_16( tmp16, tmp16_1 );
tmp32 = LT_32( tmp32, tmp32_1 );
assert( tmp16 == tmp32 );
}
}
#endif
IF( LT_16( tmp, shr_sat( vec_fx[j], sub( exp, exp_vec[j] ) ) ) )
{
ind = j;
move16();
tmp = vec_fx[j]; tmp = vec_fx[j];
move16(); move16();
exp = exp_vec[j]; exp = exp_vec[j];
move16(); move16();
#endif
} }
} }
#endif
#ifdef PITCH_OL_PRINTVAL /*value out*/
printf( "\n val= %15.15f", (float) vec_fx[ind] * pow( 2, exp_vec[ind] - 15 ) );
#endif
return ind; return ind;
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "prot_fx.h" /* Function prototypes */ #include "prot_fx.h" /* Function prototypes */
#include "prot_fx_enc.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */
/*-----------------------------------------------------------------* /*-----------------------------------------------------------------*
* Local Constants * Local Constants
*-----------------------------------------------------------------*/ *-----------------------------------------------------------------*/
...@@ -732,9 +731,6 @@ void pitch_ol_fx( ...@@ -732,9 +731,6 @@ void pitch_ol_fx(
/* 1st set of candidates */ /* 1st set of candidates */
ind = add( maximum_fx( pt_cor1, sec_length[j], &ftmp ), offset ); ind = add( maximum_fx( pt_cor1, sec_length[j], &ftmp ), offset );
#ifdef PITCH_OL_PRINTIND
printf( "\n ind = %d", ind );
#endif
pitchX[i][j] = add( ind, pit_min ); pitchX[i][j] = add( ind, pit_min );
move16(); move16();
pt2 = pt1 - pitchX[i][j] + /*-*/ offset_la; /* selected moving vector */ pt2 = pt1 - pitchX[i][j] + /*-*/ offset_la; /* selected moving vector */
...@@ -771,9 +767,6 @@ void pitch_ol_fx( ...@@ -771,9 +767,6 @@ void pitch_ol_fx(
/* 2nd set of candidates */ /* 2nd set of candidates */
ind1 = add( maximum_fx( pt_cor3, sec_length1[j], &ftmp ), offset1 ); ind1 = add( maximum_fx( pt_cor3, sec_length1[j], &ftmp ), offset1 );
#ifdef PITCH_OL_PRINTIND
printf( "\n ind = %d", ind );
#endif
pitchX[i][j + NSECT] = add( ind1, pit_min1 ); pitchX[i][j + NSECT] = add( ind1, pit_min1 );
move16(); move16();
pt4 = pt1 - pitchX[i][j + NSECT] + /*-*/ offset_la1; pt4 = pt1 - pitchX[i][j + NSECT] + /*-*/ offset_la1;
...@@ -1685,9 +1678,6 @@ void pitch_ol_ivas_fx( ...@@ -1685,9 +1678,6 @@ void pitch_ol_ivas_fx(
/* 1st set of candidates */ /* 1st set of candidates */
ind = add( maximum_exp_fx( pt_cor1, pt_cor1_exp, sec_length[j] ), offset ); ind = add( maximum_exp_fx( pt_cor1, pt_cor1_exp, sec_length[j] ), offset );
#ifdef PITCH_OL_PRINTIND
printf( "\n ind = %d", ind );
#endif
pitchX[i][j] = add( ind, pit_min ); pitchX[i][j] = add( ind, pit_min );
move16(); move16();
pt2 = pt1 - pitchX[i][j] + /*-*/ offset_la; /* selected moving vector */ pt2 = pt1 - pitchX[i][j] + /*-*/ offset_la; /* selected moving vector */
...@@ -1730,9 +1720,6 @@ void pitch_ol_ivas_fx( ...@@ -1730,9 +1720,6 @@ void pitch_ol_ivas_fx(
/* 2nd set of candidates */ /* 2nd set of candidates */
ind1 = add( maximum_exp_fx( pt_cor3, pt_cor3_exp, sec_length1[j] ), offset1 ); ind1 = add( maximum_exp_fx( pt_cor3, pt_cor3_exp, sec_length1[j] ), offset1 );
#ifdef PITCH_OL_PRINTIND
printf( "\n ind = %d", ind );
#endif
pitchX[i][j + NSECT] = add( ind1, pit_min1 ); pitchX[i][j + NSECT] = add( ind1, pit_min1 );
move16(); move16();
pt4 = pt1 - pitchX[i][j + NSECT] + /*-*/ offset_la1; pt4 = pt1 - pitchX[i][j + NSECT] + /*-*/ offset_la1;
......