diff --git a/lib_com/cldfb_fx.c b/lib_com/cldfb_fx.c index ede4be78bde0a8a0c27bb13f83e1e246613c8057..6c29d2a57f53812f9e42178ecc386e5b3d7e7db1 100644 --- a/lib_com/cldfb_fx.c +++ b/lib_com/cldfb_fx.c @@ -104,8 +104,12 @@ void cldfbAnalysis_ivas_fx( Word32 iBuffer_fx[2 * CLDFB_NO_CHANNELS_MAX]; const Word32 *rot_vctr_re_fx; const Word32 *rot_vctr_im_fx; +#ifdef OPT_IVAS_FILTER_ROM + const Word32 *ptr_pf_fx; +#else /* OPT_IVAS_FILTER_ROM */ const Word16 *ptr_pf_fx; Word16 ptr_pf_sf; +#endif /* OPT_IVAS_FILTER_ROM */ Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )]; Word16 offset, frameSize; @@ -147,8 +151,12 @@ void cldfbAnalysis_ivas_fx( rot_vctr_re_fx = h_cldfb->rot_vec_ana_re_fx; rot_vctr_im_fx = h_cldfb->rot_vec_ana_im_fx; +#ifdef OPT_IVAS_FILTER_ROM + ptr_pf_fx = h_cldfb->p_filter_32; +#else /* OPT_IVAS_FILTER_ROM */ ptr_pf_fx = h_cldfb->p_filter; - ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 + ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); FOR( i = 0; i < no_col; i++ ) @@ -156,6 +164,32 @@ void cldfbAnalysis_ivas_fx( FOR( k = 0; k < M4; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // Qx + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx + +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx @@ -180,10 +214,11 @@ void cldfbAnalysis_ivas_fx( i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx - r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // Qx - 1 - r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // Qx - 1 - i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // Qx - 1 - i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // Qx - 1 + r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // Qx - 1 + r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // Qx - 1 + i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // Qx - 1 + i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // Qx - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_sub( r1_fx, r2_fx ); // Qx - 1 @@ -207,6 +242,31 @@ void cldfbAnalysis_ivas_fx( FOR( k = M4; k < M2; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // Qx + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // Qx + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // Qx + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // Qx +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // Qx r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // Qx r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // Qx @@ -235,6 +295,7 @@ void cldfbAnalysis_ivas_fx( r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // Qx - 1 i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // Qx - 1 i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // Qx - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_add( r1_fx, r2_fx ); // Qx - 1 @@ -323,8 +384,12 @@ void cldfbAnalysis_ts_fx( const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; +#ifdef OPT_IVAS_FILTER_ROM + const Word32 *ptr_pf_fx; +#else /* OPT_IVAS_FILTER_ROM */ const Word16 *ptr_pf_fx; Word16 ptr_pf_sf; +#endif /* OPT_IVAS_FILTER_ROM */ Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )]; Word16 offset, frameSize; @@ -371,8 +436,12 @@ void cldfbAnalysis_ts_fx( rot_vctr_delay_re_fx = h_cldfb->rot_vec_ana_delay_re_fx; // q = 31 rot_vctr_delay_im_fx = h_cldfb->rot_vec_ana_delay_im_fx; // q = 31 +#ifdef OPT_IVAS_FILTER_ROM + ptr_pf_fx = h_cldfb->p_filter_32; +#else /* OPT_IVAS_FILTER_ROM */ ptr_pf_fx = h_cldfb->p_filter; - ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 + ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); FOR( i = 0; i < no_col; i++ ) @@ -380,6 +449,31 @@ void cldfbAnalysis_ts_fx( FOR( k = 0; k < M4; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[L2 - M2 - 1 - ( 2 * k ) + 0 * L2] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[L2 - M2 - 1 - ( 2 * k ) + 0 * L2] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q @@ -404,10 +498,11 @@ void cldfbAnalysis_ts_fx( i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q - r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 - r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 - i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 - i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 + r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 + r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 + i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 + i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_sub( r1_fx, r2_fx ); // q -1 @@ -417,8 +512,8 @@ void cldfbAnalysis_ts_fx( rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] ); // q - 3 rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3 #else /* OPT_AVOID_STATE_BUF_RESCALE */ - rBuffer_fx[2 * k] = L_sub( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_im_fx[k] ) ); // q - 3 - rBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_re_fx[k] ) ); // q - 3 + rBuffer_fx[2 * k] = L_sub( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_im_fx[k] ) ); // q - 3 + rBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_re_fx[k] ) ); // q - 3 #endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); @@ -431,8 +526,8 @@ void cldfbAnalysis_ts_fx( iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] ); // q - 3 iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3 #else /* OPT_AVOID_STATE_BUF_RESCALE */ - iBuffer_fx[2 * k] = L_sub( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_im_fx[k] ) ); // q - 3 - iBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_re_fx[k] ) ); // q - 3 + iBuffer_fx[2 * k] = L_sub( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_im_fx[k] ) ); // q - 3 + iBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_re_fx[k] ) ); // q - 3 #endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); @@ -441,6 +536,31 @@ void cldfbAnalysis_ts_fx( FOR( k = M4; k < M2; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q @@ -465,10 +585,11 @@ void cldfbAnalysis_ts_fx( i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q - r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 - r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 - i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 - i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 + r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 + r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 + i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 + i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_add( r1_fx, r2_fx ); // q - 1 @@ -659,8 +780,12 @@ void cldfbAnalysis_ts_fx_var_q( const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; +#ifdef OPT_IVAS_FILTER_ROM + const Word32 *ptr_pf_fx; +#else /* OPT_IVAS_FILTER_ROM */ const Word16 *ptr_pf_fx; Word16 ptr_pf_sf; +#endif /* OPT_IVAS_FILTER_ROM */ Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )]; Word16 offset, frameSize; @@ -724,8 +849,12 @@ void cldfbAnalysis_ts_fx_var_q( rot_vctr_delay_re_fx = h_cldfb->rot_vec_ana_delay_re_fx; // q = 31 rot_vctr_delay_im_fx = h_cldfb->rot_vec_ana_delay_im_fx; // q = 31 +#ifdef OPT_IVAS_FILTER_ROM + ptr_pf_fx = h_cldfb->p_filter_32; +#else /* OPT_IVAS_FILTER_ROM */ ptr_pf_fx = h_cldfb->p_filter; - ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 + ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); FOR( i = 0; i < no_col; i++ ) @@ -733,6 +862,31 @@ void cldfbAnalysis_ts_fx_var_q( FOR( k = 0; k < M4; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q @@ -757,10 +911,11 @@ void cldfbAnalysis_ts_fx_var_q( i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q - r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 - r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 - i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 - i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 + r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 + r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 + i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 + i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_sub( r1_fx, r2_fx ); // q -1 @@ -784,6 +939,32 @@ void cldfbAnalysis_ts_fx_var_q( FOR( k = M4; k < M2; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q @@ -812,6 +993,7 @@ void cldfbAnalysis_ts_fx_var_q( r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_add( r1_fx, r2_fx ); // q - 1 @@ -930,8 +1112,12 @@ void cldfbAnalysis_ts_fx_fixed_q( const Word32 *rot_vctr_im_fx; const Word32 *rot_vctr_delay_re_fx; const Word32 *rot_vctr_delay_im_fx; +#ifdef OPT_IVAS_FILTER_ROM + const Word32 *ptr_pf_fx; +#else /* OPT_IVAS_FILTER_ROM */ const Word16 *ptr_pf_fx; Word16 ptr_pf_sf; +#endif /* OPT_IVAS_FILTER_ROM */ Word32 *timeBuffer_fx, buffer_fx[( CLDFB_NO_CHANNELS_MAX * CLDFB_NO_COL_MAX ) + ( 9 * CLDFB_NO_CHANNELS_MAX )]; Word16 offset, frameSize, gb, hr, shift; @@ -977,8 +1163,12 @@ void cldfbAnalysis_ts_fx_fixed_q( rot_vctr_delay_re_fx = h_cldfb->rot_vec_ana_delay_re_fx; // q = 31 rot_vctr_delay_im_fx = h_cldfb->rot_vec_ana_delay_im_fx; // q = 31 +#ifdef OPT_IVAS_FILTER_ROM + ptr_pf_fx = h_cldfb->p_filter_32; +#else /* OPT_IVAS_FILTER_ROM */ ptr_pf_fx = h_cldfb->p_filter; - ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 + ptr_pf_sf = h_cldfb->p_filter_sf; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); FOR( i = 0; i < no_col; i++ ) @@ -986,6 +1176,31 @@ void cldfbAnalysis_ts_fx_fixed_q( FOR( k = 0; k < M4; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 0 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 1 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 2 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 3 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q @@ -1010,10 +1225,11 @@ void cldfbAnalysis_ts_fx_fixed_q( i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q - r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 - r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 - i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 - i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 + r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 + r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 + i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 + i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_sub( r1_fx, r2_fx ); // q -1 @@ -1037,6 +1253,31 @@ void cldfbAnalysis_ts_fx_fixed_q( FOR( k = M4; k < M2; k++ ) { /* prototype filter */ +#ifdef OPT_IVAS_FILTER_ROM + r1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + r1_fx = Msub_32_32( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + r2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + r2_fx = Msub_32_32( r2_fx, timeBuffer_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 5 * M2 + ( 2 * k ) + 4 * L2 )] ); // q + + i1_fx = Msub_32_32( 0, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 3 * L2 )] ); // q + i1_fx = Msub_32_32( i1_fx, timeBuffer_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 + M2 - 1 - ( 2 * k ) + 4 * L2 )] ); // q + + i2_fx = Msub_32_32( 0, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 0 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 1 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 2 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q + i2_fx = Msub_32_32( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q +#else /* OPT_IVAS_FILTER_ROM */ r1_fx = Msub_32_16( 0, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 0 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 1 * L2 )] ); // q r1_fx = Msub_32_16( r1_fx, timeBuffer_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )], ptr_pf_fx[( L2 - M2 - 1 - ( 2 * k ) + 2 * L2 )] ); // q @@ -1065,6 +1306,7 @@ void cldfbAnalysis_ts_fx_fixed_q( r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 +#endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ rr12_fx = L_add( r1_fx, r2_fx ); // q - 1 @@ -1222,8 +1464,12 @@ void cldfbSynthesis_ivas_fx( Word32 new_samples_fx[2 * CLDFB_NO_CHANNELS_MAX]; Word32 *ptr_time_out_fx; +#ifdef OPT_IVAS_FILTER_ROM + const Word32 *p_filter_32; +#else /* OPT_IVAS_FILTER_ROM */ const Word16 *p_filter; Word16 p_filter_sf; +#endif /* OPT_IVAS_FILTER_ROM */ Word32 accu0, accu1, accu2, accu3, accu4; Word16 no_col = h_cldfb->no_col; @@ -1253,9 +1499,12 @@ void cldfbSynthesis_ivas_fx( synthesisBuffer_fx = buffer_fx; Copy32( h_cldfb->cldfb_state_fx, synthesisBuffer_fx + i_mult( M1, no_col ), h_cldfb->p_filter_length ); +#ifdef OPT_IVAS_FILTER_ROM + p_filter_32 = h_cldfb->p_filter_32; +#else /* OPT_IVAS_FILTER_ROM */ p_filter = h_cldfb->p_filter; - p_filter_sf = h_cldfb->p_filter_sf; // Q14 - move16(); + p_filter_sf = h_cldfb->p_filter_sf; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ ptr_time_out_fx = timeOut_fx; /*synthesisBuffer += M1 * h_cldfb->no_col;*/ @@ -1366,11 +1615,19 @@ void cldfbSynthesis_ivas_fx( { FOR( i = 0; i < L2; i++ ) { +#ifdef OPT_IVAS_FILTER_ROM + accu0 = Madd_32_32( synthesisBuffer_fx[i], new_samples_fx[L2 - 1 - i], p_filter_32[i] ); // Qx - 1 + accu1 = Madd_32_32( synthesisBuffer_fx[1 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 1 * L2 + i )] ); // Qx - 1 + accu2 = Madd_32_32( synthesisBuffer_fx[2 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 2 * L2 + i )] ); // Qx - 1 + accu3 = Madd_32_32( synthesisBuffer_fx[3 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 3 * L2 + i )] ); // Qx - 1 + accu4 = Madd_32_32( synthesisBuffer_fx[4 * L2 + i], new_samples_fx[L2 - 1 - i], p_filter_32[( 4 * L2 + i )] ); // Qx - 1 +#else /* OPT_IVAS_FILTER_ROM */ accu0 = Madd_32_16( synthesisBuffer_fx[i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[i] ), p_filter_sf ); // Qx - 1 accu1 = Madd_32_16( synthesisBuffer_fx[1 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 1 * L2 + i )] ), p_filter_sf ); // Qx - 1 accu2 = Madd_32_16( synthesisBuffer_fx[2 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 2 * L2 + i )] ), p_filter_sf ); // Qx - 1 accu3 = Madd_32_16( synthesisBuffer_fx[3 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 3 * L2 + i )] ), p_filter_sf ); // Qx - 1 accu4 = Madd_32_16( synthesisBuffer_fx[4 * L2 + i], Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter[( 4 * L2 + i )] ), p_filter_sf ); // Qx - 1 +#endif /* OPT_IVAS_FILTER_ROM */ synthesisBuffer_fx[i] = accu0; move32(); @@ -1389,12 +1646,21 @@ void cldfbSynthesis_ivas_fx( FOR( i = 0; i < L2; i++ ) { +#ifdef OPT_IVAS_FILTER_ROM + Word32 prod = L_shl_sat( ( new_samples_fx[L2 - 1 - i] ), shift ); + accu0 = Madd_32_32( synthesisBuffer_fx[i], prod, p_filter_32[i] ); // Qx -1 + shift + accu1 = Madd_32_32( synthesisBuffer_fx[1 * L2 + i], prod, p_filter_32[( 1 * L2 + i )] ); // Qx -1 + shift + accu2 = Madd_32_32( synthesisBuffer_fx[2 * L2 + i], prod, p_filter_32[( 2 * L2 + i )] ); // Qx -1 + shift + accu3 = Madd_32_32( synthesisBuffer_fx[3 * L2 + i], prod, p_filter_32[( 3 * L2 + i )] ); // Qx -1 + shift + accu4 = Madd_32_32( synthesisBuffer_fx[4 * L2 + i], prod, p_filter_32[( 4 * L2 + i )] ); // Qx -1 + shift +#else /* OPT_IVAS_FILTER_ROM */ Word32 prod = L_shl_sat( Mpy_32_16_1( new_samples_fx[L2 - 1 - i], p_filter_sf ), shift ); accu0 = Madd_32_16( synthesisBuffer_fx[i], prod, p_filter[i] ); // Qx -1 + shift accu1 = Madd_32_16( synthesisBuffer_fx[1 * L2 + i], prod, p_filter[( 1 * L2 + i )] ); // Qx -1 + shift accu2 = Madd_32_16( synthesisBuffer_fx[2 * L2 + i], prod, p_filter[( 2 * L2 + i )] ); // Qx -1 + shift accu3 = Madd_32_16( synthesisBuffer_fx[3 * L2 + i], prod, p_filter[( 3 * L2 + i )] ); // Qx -1 + shift accu4 = Madd_32_16( synthesisBuffer_fx[4 * L2 + i], prod, p_filter[( 4 * L2 + i )] ); // Qx -1 + shift +#endif /* OPT_IVAS_FILTER_ROM */ synthesisBuffer_fx[i] = accu0; move32(); @@ -1867,8 +2133,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; - hs->p_filter_sf = (Word16) 17036; // Q14 +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_10_fx; +#else /* OPT_IVAS_FILTER_ROM */ + hs->p_filter_sf = (Word16) 17036; // Q14 hs->p_filter = CLDFB80_10_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_10_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -1879,8 +2149,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_10_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15388; // Q14 hs->p_filter = LDQMF_10_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_10_SCALE_FX_Q8; } BREAK; @@ -1898,8 +2172,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_16_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17051; // Q14 hs->p_filter = CLDFB80_16_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_16_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -1910,8 +2188,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_16_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15388; // Q14 hs->p_filter = LDQMF_16_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_16_SCALE_FX_Q8; } BREAK; @@ -1929,8 +2211,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_20_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17050; // Q14 hs->p_filter = CLDFB80_20_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_20_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -1941,8 +2227,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_20_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15390; // Q14 hs->p_filter = LDQMF_20_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_20_SCALE_FX_Q8; } BREAK; @@ -1960,8 +2250,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_30_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17051; // Q14 hs->p_filter = CLDFB80_30_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_30_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -1972,8 +2266,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_30_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15388; // Q14 hs->p_filter = LDQMF_30_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_30_SCALE_FX_Q8; } BREAK; @@ -1991,8 +2289,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_32_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17050; // Q14 hs->p_filter = CLDFB80_32_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_32_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -2003,8 +2305,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_32_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15392; // Q14 hs->p_filter = LDQMF_32_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_32_SCALE_FX_Q8; } BREAK; @@ -2022,8 +2328,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_40_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17051; // Q14 hs->p_filter = CLDFB80_40_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_40_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -2034,8 +2344,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_40_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15391; // Q14 hs->p_filter = LDQMF_40_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_40_SCALE_FX_Q8; } BREAK; @@ -2053,8 +2367,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_60_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17051; // Q14 hs->p_filter = CLDFB80_60_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = CLDFB80_60_SCALE_FX_Q8; } ELSE IF( EQ_32( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) @@ -2065,8 +2383,12 @@ static void cldfb_init_proto_and_twiddles( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_60_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15391; // Q14 hs->p_filter = LDQMF_60_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = LDQMF_60_SCALE_FX_Q8; } BREAK; @@ -2113,11 +2435,15 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; - hs->p_filter_sf = (Word16) 17036; // Q14 hs->scale = cldfb_scale_2_5ms[0]; move16(); move16(); +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_10_fx; +#else /* OPT_IVAS_FILTER_ROM */ + hs->p_filter_sf = (Word16) 17036; // Q14 hs->p_filter = CLDFB80_10_fx; +#endif /* OPT_IVAS_FILTER_ROM */ } ELSE IF( EQ_16( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { @@ -2129,8 +2455,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_10_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15388; // Q14 hs->p_filter = LDQMF_10_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_5_0ms[0]; move16(); move16(); @@ -2158,8 +2488,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_16_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17051; // Q14 hs->p_filter = CLDFB80_16_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_2_5ms[1]; move16(); move16(); @@ -2174,8 +2508,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_16_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15388; // Q14 hs->p_filter = LDQMF_16_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_5_0ms[1]; move16(); move16(); @@ -2210,8 +2548,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_20_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17050; // Q14 hs->p_filter = CLDFB80_20_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_2_5ms[2]; move16(); move16(); @@ -2226,8 +2568,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_20_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15390; // Q14 hs->p_filter = LDQMF_20_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_5_0ms[2]; move16(); move16(); @@ -2261,9 +2607,13 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; - hs->p_filter_sf = (Word16) 17051; // Q14 hs->scale = cldfb_scale_2_5ms[6]; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_30_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter = CLDFB80_30_fx; + hs->p_filter_sf = (Word16) 17051; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ } ELSE IF( EQ_16( hs->prototype, CLDFB_PROTOTYPE_5_00MS ) ) { @@ -2275,9 +2625,13 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; - hs->p_filter_sf = (Word16) 15388; // Q14 hs->scale = cldfb_scale_5_0ms[6]; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_30_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter = LDQMF_30_fx; + hs->p_filter_sf = (Word16) 15388; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); move16(); } @@ -2304,8 +2658,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_32_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17050; // Q14 hs->p_filter = CLDFB80_32_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_2_5ms[3]; move16(); move16(); @@ -2320,9 +2678,13 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; - hs->p_filter_sf = (Word16) 15392; // Q14 hs->scale = cldfb_scale_5_0ms[3]; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_32_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter = LDQMF_32_fx; + hs->p_filter_sf = (Word16) 15392; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); move16(); } @@ -2355,9 +2717,13 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; - hs->p_filter_sf = (Word16) 17051; // Q14 hs->scale = cldfb_scale_2_5ms[4]; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_40_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter = CLDFB80_40_fx; + hs->p_filter_sf = (Word16) 17051; // Q14 +#endif /* OPT_IVAS_FILTER_ROM */ move16(); move16(); } @@ -2371,8 +2737,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_40_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15391; // Q14 hs->p_filter = LDQMF_40_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_5_0ms[4]; move16(); move16(); @@ -2406,8 +2776,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = NULL; hs->rot_vec_syn_delay_re_fx = NULL; hs->rot_vec_syn_delay_im_fx = NULL; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = CLDFB80_60_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 17051; // Q14 hs->p_filter = CLDFB80_60_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_2_5ms[5]; move16(); move16(); @@ -2422,8 +2796,12 @@ static void cldfb_init_proto_and_twiddles_enc_fx( hs->rot_vec_ana_delay_im_fx = rot_vec_delay_im_LDQMF_fx; hs->rot_vec_syn_delay_re_fx = rot_vec_delay_re_LDQMF_fx; hs->rot_vec_syn_delay_im_fx = rot_vec_delay_im_LDQMF_fx; +#ifdef OPT_IVAS_FILTER_ROM + hs->p_filter_32 = LDQMF_60_fx; +#else /* OPT_IVAS_FILTER_ROM */ hs->p_filter_sf = (Word16) 15391; // Q14 hs->p_filter = LDQMF_60_fx; +#endif /* OPT_IVAS_FILTER_ROM */ hs->scale = cldfb_scale_5_0ms[5]; move16(); move16(); diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 74e682a4b28a15ecf08eaeb99d954e0243513081..71d090a53d8f9765001a71ec4236e6d730732cdc 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1092,10 +1092,14 @@ void ivas_mct_dec_mct_fx( ); void apply_MCT_dec_fx( - MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ - Decoder_State **sts, /* i/o: decoder state structure */ - Word32 *x[MCT_MAX_CHANNELS][NB_DIV], /* i/o: decoded and dequan. spect. input to MCT */ - Word16 q_x[MCT_MAX_CHANNELS] ); + MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ + Decoder_State **sts, /* i/o: decoder state structure */ + Word32 *x[MCT_MAX_CHANNELS][NB_DIV] /* i/o: decoded and dequan. spect. input to MCT */ +#ifndef OPT_SBA_DEC_PATH + , + Word16 q_x[MCT_MAX_CHANNELS] +#endif /* OPT_SBA_DEC_PATH */ +); void mctStereoIGF_dec_fx( MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ @@ -1129,9 +1133,13 @@ void stereo_decoder_tcx_fx( const Word16 mct_on, /* i : flag mct block (1) or stereo (0) */ const Word16 last_core_l, /* i : last core for left channel */ const Word16 last_core_r, /* i : last core for right channel */ - const Word16 tmp_plc_upmix, /* i : indicates temp upmix for PLC decision */ + const Word16 tmp_plc_upmix /* i : indicates temp upmix for PLC decision */ +#ifndef OPT_SBA_DEC_PATH + , Word16 *q_x_ch2, - Word16 *q_x_ch1 ); + Word16 *q_x_ch1 +#endif /* OPT_SBA_DEC_PATH */ +); void v_multc_acc_32_16( const Word32 x[], /* i : Input vector */ diff --git a/lib_com/options.h b/lib_com/options.h index b45e546710855a549ba5ab337184f41eb40d2999..81300af69b7ada418c5db922decbec4dc5a8cf16 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -87,6 +87,8 @@ #define OPT_BIN_RENDERER_V2 #define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ #define OPT_AVOID_STATE_BUF_RESCALE /* Optimization made to avoid rescale of synth state buffer */ +#define OPT_SBA_DEC_PATH /* Optimization made in SBA decoding path */ +#define OPT_IVAS_FILTER_ROM /* Optimization made in IVAS filter table */ #define FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx /*FhG: WMOPS tuning, nonbe*/ #define FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot /*FhG: WMOPS tuning, nonbe*/ /* Both following 2 macros (IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST*) are independent from each other, they refer to different code blocks */ diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index a64b37f7bf01385aaf73812a95fe689b3bd2f5b3..1f43b3d1f571026c56005c607b2062463e00cb74 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -5194,6 +5194,7 @@ const Word16 freqTable[2] = {20, 40}; // Q0 /* SNR: 109.44, PHASE: 3.500000000000000 */ /* SNR: 109.44, PHASE: 3.500000000000000 */ +#ifndef OPT_IVAS_FILTER_ROM const Word16 CLDFB80_10_fx[100] = // q = 15 sf = 17036 qsf = 14 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, -2, 0, 0, 0, -1, 0, 0, 0, -8, -31, @@ -5429,6 +5430,778 @@ const Word16 LDQMF_60_fx[] = // q = 15 sf = 15391 qsf = 14 -142, -123, -104, -88, -72, -57, -44, -28, }; +#else /* OPT_IVAS_FILTER_ROM */ + +const Word32 CLDFB80_10_fx[100] = // q = 30 +{ + 3584, -2501, -707, 157, -1170, -1038, +-11, -1944, -1380, 1837, 14727, -9096, +-1691, -267, 3897, -4705, 419, 4651, +5275, -6639, -243747, -72521, -17071, 14831, +-23632, -38285, 18452, -20885, -6245, -281515, +-1070487, -153329, -20195, -4338, -209848, 194011, +24972, -5106, -34468, 1151402, -2164680, -832327, +376720, 1686598, 1844777, 1697325, 2356308, 3037447, +3248821, 1779296, -1533240, -1713947, 833816, 2751563, +2421812, 284255, -3540922, -6991555, -10248264, -14642952, +20031906, 26043234, 34417552, 45928496, 60756732, 78698864, +98151832, 116245496, 129823136, 136344976, 134601568, 122059576, +95304000, 53433792, -3371365, -74987256, -160511088, -258343120, +-366360320, -481533344, 599091264, 714631872, 823505600, 920768896, +1001735168, 1062249792, 1100603392, 1116473216, 1114030976, 1091249536, +1031959808, 939413760, 835792512, 727712064, 614651648, 499141824, +382288320, 266885408, 148867680, 44714176 +}; + + +/* SNR: 292.49, PHASE: 2.000000000000000 */ +const Word32 CLDFB80_16_fx[160] = // q = 30 +{ 592, -824, -251, 104, 64, -2, +-19, 2357, 3222, -18, -2, 75, +37, -82, -596, 808, 2242, -3035, +-755, 254, 126, -435, 107, -19350, +26445, -100, 482, -149, -91, 247, +2196, -3062, -344117, -158537, -67240, -47926, +-21715, 16231, 6227, 48320, 46494, 5449, +17932, -33783, -26258, -13467, -97911, -469416, +-1317171, -563405, -199456, -118497, -43264, 11679, +-61886, 64706, -248886, 55869, 3768, 67211, +64791, 39611, 345778, 1796799, -2314105, -1658358, +-815220, -115680, 761413, 1616443, 1931089, 1230669, +1712206, 1949652, 2418775, 2970521, 3179526, 3272216, +2739046, 1383591, -1186345, -2091284, -1594461, -20541, +1561481, 2685864, 2822045, 2243697, 1007270, -1321111, +-3774214, -5979353, -7970747, -10025660, -12576468, -15588057, +19092548, 22464968, 26489252, 31480652, 37681832, 45115060, +53868456, 63884792, 75139712, 87185504, 99355152, 110921760, +121117896, 129158840, 134480400, 136595408, 135565040, 130704096, +120827352, 105296200, 83827480, 56486836, 23319760, -15680647, +-60454808, -110775264, -166285472, -226570624, -291114656, -359358976, +-430528992, -503583200, 577127680, 650096768, 721690560, 790528896, +855345280, 915113088, 968648896, 1014713216, 1052549440, 1081848192, +1102232576, 1113723648, 1117499392, 1114694144, 1104247168, 1084392960, +1047294336, 993703296, 933123072, 868665920, 802559168, 734628416, +664562240, 593135168, 520952544, 448011680, 375024864, 302909728, +230463232, 156264608, 85568040, 29877076 +}; + + +/* SNR: 89.77, PHASE: 1.500000000000000 */ +const Word32 CLDFB80_20_fx[200] = // q = 30 +{ 1767, -5032, -88, -196, 26, 203, +-254, -755, -8, 5224, 7569, 3, +161, -101, 462, -85, -115, 1651, +-2694, 4755, 4946, -22236, -524, -658, +65, 469, -402, -1021, 719, -9362, +12273, -828, -312, 170, -1089, 201, +407, -7058, 12038, -3893, -327043, -222151, +-35479, -70712, -44739, -22286, -4950, 10391, +-6975, 55398, 27635, -7373, 3144, -22481, +-20586, -25326, -30793, 63871, -118589, -531211, +-1262671, -706692, -140675, -191397, -107627, -49946, +-20212, 30609, -145958, 302172, -516943, 139838, +-27637, 62099, 52144, 58317, 81974, -160536, +375017, 1963206, -2140127, -2009648, -925313, -652848, +-36271, 664400, 1339893, 1799274, 1945125, 831665, +1777056, 1828829, 2078398, 2585601, 2993432, 3154609, +3289693, 3034094, 2356141, 1146722, -993260, -1911082, +-2021484, -1182252, 157141, 1427332, 2466905, 2979250, +2692828, 2193128, 1283653, -616499, -2589952, -4472529, +-6187298, -7776617, -9380603, -11192438, -13438549, -15899665, +18725886, 21392202, 24336266, 27874318, 32044188, 37006492, +42749912, 49318540, 56747120, 64938688, 73960840, 83528888, +93302528, 102923904, 112017456, 120184144, 127010856, 132191136, +135478896, 136610544, 135791440, 132663544, 126439184, 116783968, +103416816, 86239880, 65299188, 40633116, 12229525, -19893306, +-55715672, -95119752, -137902624, -183892768, -232841840, -284483936, +-338536576, -394642624, -452297696, -510956224, 569805312, 628294144, +686151296, 742695360, 797209408, 849073920, 897777728, 942743488, +983299712, 1018874944, 1049145600, 1073975296, 1093176448, 1106582656, +1114420736, 1117424512, 1116238848, 1110577792, 1099271424, 1081958528, +1052270720, 1010577920, 964128448, 914037760, 862118336, 809238464, +755241024, 699830528, 643231744, 585949312, 528205504, 469954944, +411440896, 353300032, 295721536, 237791168, 178588864, 119772248, +66882256, 25081918 +}; + + +/* SNR: 89.29, PHASE: 0.833333333333333 */ +const Word32 CLDFB80_30_fx[300] = // q = 30 +{ -298, 3584, 1941, -855, -2501, -18, +108, -707, 31, 15, 157, 303, +46, -1170, 5206, 7621, -1038, 39, +476, -11, -29, -11, -1944, 58, +-3, -1380, -660, 1053, 1837, -2898, +-12992, 14727, 8112, -3476, -9096, -22, +265, -1691, 46, -32, -267, 593, +210, 3897, 9064, -12976, -4705, -177, +-1102, 419, 158, 60, 4651, -142, +-11, 5275, 2753, -4425, -6639, 19639, +-341195, -243747, -157895, -76329, -72521, -65719, +-49275, -17071, -21325, -4817, 14831, 27866, +-1522, -23632, 5019, -51348, -38285, -878, +59536, 18452, -11251, -36822, -20885, -26546, +-28596, -6245, -16613, -92408, -281515, -679650, +-1089989, -1070487, -687312, -252030, -153329, -178007, +-122647, -20195, -41359, -29533, -4338, 53191, +-112253, -209848, 617831, -803951, 194011, 106901, +-106999, 24972, 64775, 70954, -5106, 66493, +77725, -34468, 24005, 399486, 1151402, 2091330, +-1945866, -2164680, -1871142, -1133490, -832327, -560635, +-144700, 376720, 793103, 1258629, 1686598, 1843272, +1942367, 1844777, 286874, 1790714, 1697325, 1882734, +2048236, 2356308, 2670961, 2960784, 3037447, 3187788, +3282834, 3248821, 2972461, 2561469, 1779296, 779690, +-670109, -1533240, -2023874, -2068454, -1713947, -979306, +-79112, 833816, 1606493, 2311180, 2751563, 2948543, +2758276, 2421812, 2144318, 1669907, 284255, -925661, +-2240403, -3540922, -4767759, -5909822, -6991555, -8035796, +-9103931, -10248264, -11549851, -13052389, -14642952, -16334399, +18220558, 20031906, 21872604, 23814234, 26043234, 28516756, +31295850, 34417552, 37909524, 41736344, 45928496, 50500180, +55453996, 60756732, 66352956, 72392624, 78698864, 85151696, +91671536, 98151832, 104484224, 110553528, 116245496, 121424144, +125981624, 129823136, 132872256, 135069696, 136344976, 136548112, +135995744, 134601568, 131846392, 127706624, 122059576, 114818808, +105909512, 95304000, 83010216, 69049472, 53433792, 36159948, +17222988, -3371365, -25594396, -49478012, -74987256, -102019216, +-130543792, -160511088, -191851984, -224489536, -258343120, -293333280, +-329374368, -366360320, -404158112, -442603456, -481533344, -520813312, +560055680, 599091264, 637996480, 676579264, 714631872, 751940864, +788293056, 823505600, 857424640, 889902848, 920768896, 949826944, +976873792, 1001735168, 1024295104, 1044475456, 1062249792, 1077572608, +1090377088, 1100603392, 1108260608, 1113474048, 1116473216, 1117510400, +1116725248, 1114030976, 1109119488, 1101598848, 1091249536, 1078932736, +1059134272, 1031959808, 1003169408, 972174976, 939413760, 905472960, +870845632, 835792512, 800328576, 764335744, 727712064, 690466496, +652724672, 614651648, 576357376, 537862912, 499141824, 460206112, +421184800, 382288320, 343676096, 305305440, 266885408, 228014720, +188521408, 148867680, 110353960, 74971128, 44714176, 18455688 +}; + + +const Word32 CLDFB80_32_fx[320] = // q = 30 +{ + -1093, 2020, -1500, 75, -3259, -200, +2, 86, -307, -6, -372, -406, +686, 39, -1685, 4713, 6814, -1488, +47, 778, -40, -130, 24, -872, +225, -5, -116, -556, -123, -751, +1334, -5815, -17696, 8208, -6989, 239, +-11912, -669, 1, 206, -738, 0, +-579, -811, 1617, 569, 3828, 10109, +-14335, -4601, -628, -1935, 180, 186, +-69, 2086, -538, 14, 408, 1524, +585, 3601, -4502, 26170, -348871, -274413, +-191283, -101650, -55023, -71745, -57839, -39470, +-16489, -17154, -4618, 1542, 27531, -4838, +-24078, -6041, -61576, -45939, -4350, 52992, +-21467, -30551, -47624, -16879, -16327, -28526, +-30774, 45781, -47861, -103961, -321282, -704888, +-1065517, -1123685, -707166, -371532, -86309, -196314, +-147630, -95796, -26567, -30201, -12085, -23646, +30175, -133297, -186726, 644643, -823106, 165914, +127129, -77847, 76139, 59764, 84597, 13696, +44921, 72597, 82827, -180230, 163871, 385660, +1272552, 2097220, -1940583, -2216918, -1963534, -1312195, +-811283, -684818, -332127, 81208, 566324, 995811, +1374732, 1743252, 1885233, 1944746, 1791356, 230889, +1776037, 1693755, 1848743, 2021967, 2237951, 2554532, +2866858, 3010232, 3111818, 3235821, 3289505, 3179984, +2912034, 2438977, 1724392, 733947, -625866, -1486531, +-1958890, -2094028, -1863598, -1255187, -454123, 425746, +1212702, 1901282, 2517750, 2869908, 2908450, 2719155, +2384774, 2140992, 1717492, 398307, -731735, -1939480, +-3196994, -4359654, -5453402, -6492968, -7485701, -8462297, +-9485345, -10586349, -11872517, -13293064, -14799378, -16391634, +18159074, 19878216, 21572990, 23372214, 25384474, 27638258, +30127980, 32911950, 36012916, 39421380, 43135868, 47172528, +51552328, 56259572, 61272356, 66530936, 72196904, 78102488, +84136944, 90243120, 96340328, 102334376, 108124720, 113633800, +118743656, 123354504, 127384760, 130768192, 133428752, 135331936, +136411184, 136532064, 136012736, 134791376, 132367184, 128735088, +123803096, 117494272, 109734136, 100486232, 89749032, 77539936, +63866580, 48743548, 32160198, 14114131, -5387419, -26313940, +-48704924, -72531920, -97696000, -124178280, -151940320, -180929216, +-211078752, -242327632, -274608448, -307853568, -341987136, -376916512, +-412518528, -448658976, -485200704, -522047808, 558838528, 595432000, +631934592, 668176768, 703995904, 739213504, 773652800, 807151808, +839574912, 870801792, 900704320, 929133248, 955922048, 980906240, +1003949120, 1024962240, 1043881152, 1060686784, 1075342592, 1087794688, +1097989248, 1105913344, 1111637504, 1115325568, 1117191552, 1117410816, +1116024960, 1112890624, 1107711872, 1100166016, 1090143104, 1078585600, +1060024128, 1034545088, 1007817280, 979127552, 948772416, 917237312, +884973248, 852271488, 819225472, 785777536, 751820160, 717295872, +682246976, 646793792, 611070144, 575157504, 539069056, 502781984, +466300064, 429718016, 393203360, 356913536, 320878656, 284927936, +248740064, 212036736, 174863904, 137843808, 102263632, 69872776, +42173520, 17586372 +}; + + +/* SNR: 81.55, PHASE: 0.500000000000000 */ +const Word32 CLDFB80_40_fx[400] = // q = 30 +{ +-4459, -419, -3627, 1424, -337, -2077, +303, 18, 81, 159, -711, 9, +12, -289, -782, 599, -26, 261, +-439, 2799, 3758, -185, 230, -43, +682, -21, -75, -29, -55, -1950, +416, 56, 16, 233, 887, -479, +680, -2718, -569, -16448, -33103, -1653, +-16424, 6275, -1401, -7536, 1256, 82, +202, 378, -1703, -5, -27, -665, +-1194, 1295, -18, 118, -11445, 11396, +-15922, 16043, 175, 78, -1655, 102, +374, 132, 161, 4663, -995, -137, +-67, -970, -4393, 2058, -3082, 11739, +-993, 52507, -372470, -339964, -238020, -154668, +-91227, -39704, -68193, -63466, -52270, -36721, +-12972, -20431, -6925, 7426, -2361, 29241, +920, -11369, 13936, -42084, -90219, 4460, +-7456, 295, 60570, -36066, -9836, -23630, +-40550, -22839, -11573, -27317, -28142, -21799, +74247, -37443, -94761, -175261, -418504, -781461, +-995765, -1274142, -822204, -644197, -320592, -79371, +-211045, -170432, -131251, -90676, -8615, -38865, +-25806, 10490, -21115, 43834, -93771, -212052, +-80067, 687824, -841077, -28319, 196054, 89800, +-98757, 81413, 22561, 71310, 76947, -1234, +38817, 69237, 75947, 74313, -220677, 108139, +388007, 614410, 1602908, 2104013, -1945962, -2345233, +-2073811, -1788974, -1237042, -801097, -773094, -511061, +-205272, 126459, 548962, 854332, 1215260, 1516757, +1754373, 1867886, 1938796, 1938332, 1525725, 104199, +1696967, 1687208, 1745905, 1910502, 2033618, 2194668, +2472078, 2712787, 2937869, 3012596, 3095693, 3204093, +3274808, 3283756, 3148592, 2939051, 2641685, 2031332, +1549503, 597843, -490013, -1328870, -1713436, -2059616, +-2084878, -1903964, -1464478, -873102, -195311, 513856, +1135793, 1697317, 2228107, 2629045, 2909611, 2926214, +2785543, 2569874, 2293850, 2134485, 1852516, 752397, +-164140, -1082527, -2067571, -3082101, -4010647, -4913513, +-5770452, -6592737, -7388101, -8166445, -8966356, -9806266, +-10700961, -11733450, -12861255, -14030459, -15273330, -16566203, +17977196, 19420796, 20683474, 22109952, 23560036, 25167814, +26942868, 28845886, 30930688, 33206692, 35686848, 38368864, +41237952, 44313740, 47594052, 51099240, 54815852, 58726668, +62834600, 67067844, 71610536, 76321632, 81103048, 85964624, +90855304, 95735248, 100552568, 105257896, 109812680, 114164760, +118253480, 122029112, 125449296, 128468360, 131068744, 133194984, +134844544, 135983552, 136548480, 136476080, 136056288, 135290432, +133727152, 131405624, 128303264, 124356992, 119537688, 113797504, +107116320, 99479544, 90889712, 81356080, 70886368, 59482072, +47150368, 33884192, 19681098, 4546190, -11521655, -28482206, +-46395036, -65246120, -84945856, -105504280, -126897840, -149107856, +-172107808, -195862240, -220341504, -245510512, -271335616, -297782912, +-324814976, -352387008, -380449280, -408931776, -437767552, -466890752, +-496221408, -525752320, 555187200, 584450368, 613710272, 642840512, +671780800, 700438528, 728721728, 756541312, 783807872, 810444608, +836384512, 861566464, 885927424, 909395008, 931888896, 953321728, +973609216, 992677120, 1010468928, 1026949632, 1042084096, 1055868544, +1068286464, 1079312512, 1088916480, 1097072128, 1103772032, 1109042176, +1112948608, 1115590912, 1117080960, 1117511680, 1116923264, 1115280512, +1112471040, 1108330880, 1102691712, 1095455872, 1086748672, 1077537920, +1062688064, 1042243712, 1021432192, 999408768, 976158720, 951869952, +926793472, 901173760, 875200384, 848982208, 822546624, 795860992, +768868224, 741522368, 713812928, 685772416, 657463808, 628958848, +600314432, 571556608, 542686272, 513690592, 484561600, 455329056, +426060320, 396846880, 367771776, 338869952, 310096864, 281325184, +252379520, 223109248, 193485184, 163693120, 134192648, 105710896, +79151352, 55383672, 34725716, 14899882 +}; + + +/* SNR: 85.15, PHASE: 0.166666666666667 */ +const Word32 CLDFB80_60_fx[600] = // q = 30 +{ -11638, 1767, -122, 1628, -5032, -196, +161, -88, -3545, 137, -196, 21, +36, 26, 132, -1128, 203, 12, +-29, -254, -97, -286, -755, 689, +-55, -8, 215, -1583, 5224, -169, +-595, 7569, -1361, 190, 3, -67, +788, 161, -43, -20, -101, -32, +-10, 462, -3064, 321, -85, 24, +12, -115, 151, -968, 1651, -22, +-258, -2694, -28, 68, 4755, -32803, +-51846, 4946, -596, 6086, -22236, -388, +578, -524, -12974, 673, -658, 65, +91, 65, 314, -2699, 469, 12, +-69, -402, -518, -689, -1021, 1669, +-23, 719, 449, -2322, -9362, 9537, +-13566, 12273, 3730, -157, -828, 61, +-1978, -312, 206, 462, 170, 84, +41, -1089, 7330, -768, 201, -60, +-41, 407, -660, 3231, -7058, 161, +771, 12038, 198, -1291, -3893, 106546, +-387363, -327043, -319712, -213953, -222151, -158504, +-105319, -35479, -59682, -66733, -70712, -61610, +-55171, -44739, -31711, -9900, -22286, -19252, +-9917, -4950, 14172, 3111, 10391, 26566, +4086, -6975, -13332, -9892, 55398, -89244, +-120822, 27635, -30751, -9363, -7373, 2810, +49557, 3144, -15960, 10651, -22481, -39335, +-43081, -20586, -29742, -8098, -25326, -28071, +-28128, -30793, -15878, 36414, 63871, -51035, +-98423, -118589, -196780, -380753, -531211, -867079, +-924260, -1262671, -1211187, -909700, -706692, -590140, +-387713, -140675, -90592, -207147, -191397, -163116, +-139419, -107627, -77449, 8620, -49946, -36329, +-21446, -20212, 13295, -23389, 30609, 24765, +-73159, -145958, -228347, -136170, 302172, 622362, +-742756, -516943, 79533, 208728, 139838, 68780, +-69177, -27637, 72365, 6204, 62099, 78720, +81230, 52144, -15436, 27781, 58317, 71170, +74613, 81974, 55368, -164496, -160536, 180918, +362005, 375017, 795458, 1461875, 1963206, 2095155, +-1983049, -2140127, -2301661, -2078197, -2009648, -1702455, +-1336746, -925313, -815553, -803613, -652848, -461551, +-265137, -36271, 196856, 518314, 664400, 915382, +1166217, 1339893, 1585569, 1738976, 1799274, 1890535, +1933937, 1945125, 1923994, 1665861, 831665, 77564, +1488037, 1777056, 1688417, 1721975, 1828829, 1937199, +2017937, 2078398, 2252451, 2437196, 2585601, 2754365, +2909842, 2993432, 3016599, 3074266, 3154609, 3219375, +3265044, 3289693, 3277126, 3189837, 3034094, 2902602, +2709099, 2356141, 1938986, 1632226, 1146722, 418214, +-305018, -993260, -1403823, -1653092, -1911082, -2083225, +-2096449, -2021484, -1849083, -1552144, -1182252, -764155, +-310625, 157141, 627282, 1032601, 1427332, 1788414, +2142931, 2466905, 2666629, 2856089, 2979250, 2902477, +2810289, 2692828, 2523008, 2330296, 2193128, 2132550, +2001086, 1283653, 592123, -15236, -616499, -1241115, +-1897102, -2589952, -3235046, -3852858, -4472529, -5058432, +-5630304, -6187298, -6725206, -7257095, -7776617, -8297675, +-8829816, -9380603, -9952123, -10548511, -11192438, -11919065, +-12671172, -13438549, -14232061, -15062200, -15899665, -16802572, +17739412, 18725886, 19625418, 20458448, 21392202, 22346532, +23310144, 24336266, 25457146, 26639572, 27874318, 29180440, +30570936, 32044188, 33604364, 35257056, 37006492, 38833420, +40745368, 42749912, 44846596, 47032812, 49318540, 51704112, +54183000, 56747120, 59397304, 62137772, 64938688, 67793344, +70831448, 73960840, 77111768, 80298224, 83528888, 86778376, +90039080, 93302528, 96541856, 99755032, 102923904, 106027616, +109066040, 112017456, 114866184, 117592440, 120184144, 122624224, +124905544, 127010856, 128931552, 130666344, 132191136, 133505016, +134605360, 135478896, 136120576, 136498544, 136610544, 136390896, +136106368, 135791440, 135081680, 134039064, 132663544, 130943336, +128876128, 126439184, 123615464, 120403880, 116783968, 112750168, +108296544, 103416816, 98114136, 92387688, 86239880, 79676032, +72697184, 65299188, 57491652, 49271324, 40633116, 31582262, +22113356, 12229525, 1933215, -8779568, -19893306, -31396530, +-43338216, -55715672, -68469528, -81601800, -95119752, -109012544, +-123274624, -137902624, -152887216, -168220960, -183892768, -199892672, +-216212560, -232841840, -249770272, -266987040, -284483936, -302248800, +-320270592, -338536576, -357031680, -375740448, -394642624, -413715328, +-432939744, -452297696, -471766976, -491319872, -510956224, -530689568, +550314688, 569805312, 589331520, 608841280, 628294144, 647679424, +666974528, 686151296, 705180416, 724037376, 742695360, 761126400, +779305216, 797209408, 814818048, 832112192, 849073920, 865685504, +881927232, 897777728, 913213888, 928211072, 942743488, 956784768, +970310720, 983299712, 995732352, 1007593856, 1018874944, 1029566592, +1039655360, 1049145600, 1058033856, 1066312576, 1073975296, 1081012992, +1087415680, 1093176448, 1098289920, 1102755712, 1106582656, 1109785856, +1112388096, 1114420736, 1115916544, 1116907776, 1117424512, 1117484800, +1117091968, 1116238848, 1114897920, 1113026048, 1110577792, 1107500160, +1103739520, 1099271424, 1094099328, 1088271360, 1081958528, 1076012800, +1066112832, 1052270720, 1038832960, 1024980800, 1010577920, 995613248, +980113280, 964128448, 947737280, 931017344, 914037760, 896864896, +879548544, 862118336, 844591360, 826968768, 809238464, 791384896, +773390848, 755241024, 736928896, 718455680, 699830528, 681070912, +662197568, 643231744, 624193216, 605096768, 585949312, 566752640, +547506176, 528205504, 508844544, 489425088, 469954944, 450450944, +430937408, 411440896, 391989376, 372605984, 353300032, 334067616, +314888448, 295721536, 276517248, 257224080, 237791168, 218193616, +198443888, 178588864, 158737840, 139063920, 119772248, 101121944, +83411368, 66882256, 51724928, 38009000, 25081918, 11097560 +}; + + +/* 5ms delay prototype */ +const Word32 LDQMF_10_fx[] = // q = 30 +{ + 136778, 68195, -70890, -226890, -352352, -420072, +-436802, -444543, -506661, -672815, -980068, -1367880, +-1747442, -2041059, -2171766, -2084001, -1756846, -1205000, +-470033, 391658, -1352314, -2311012, -3225024, -4068760, +-4825637, -5483931, -6033975, -6472204, -6808585, -7075060, +-7325812, -7636335, -8074047, -8676456, -9424478, -10219283, +-10865228, -11073811, -10475044, -8652076, 5180201, -339904, +-8224782, -18673422, -31726070, -47229416, -64809980, -83846512, +-103451368, -122477480, -139540384, -153063904, -161342016, -162639632, +-155309920, -137908720, -109304704, -68777832, -16099735, 48410956, +-123867744, -208812656, -301278944, -398795360, -498505440, -597277184, +-691834048, -778907776, -855407232, -918606592, -966152640, -996390080, +-1008509056, -1002265344, -978191040, -937540800, -882190336, -814525888, +-737309056, -653527872, 566225280, 478344672, 392910464, 312395584, +238918544, 174094816, 118926376, 73749168, 38239292, 11438051, +-6809585, -17473586, -23179288, -24893300, -23497172, -19904868, +-15070633, -9938406, -5364481, -2000462 +}; + + +const Word32 LDQMF_16_fx[] = // q = 30 +{ +135840, 119105, 61025, -23300, -120396, -217572, +-303688, -369787, -411986, -431913, -436960, -439365, +-455121, -500073, -585815, -716339, -910646, -1146410, +-1392576, -1634245, -1852285, -2026746, -2138911, -2173116, +-2118583, -1970211, -1728614, -1399460, -992562, -520340, +3268, 562389, -1169900, -1774888, -2369781, -2945925, +-3497147, -4018445, -4506032, -4956920, -5368526, -5738270, +-6064626, -6347064, -6587229, -6790047, -6964112, -7121373, +-7276728, -7449880, -7659373, -7920485, -8244154, -8633965, +-9083566, -9574508, -10074442, -10534940, -10894573, -11076715, +-10992408, -10543848, -9627864, -8139161, 5976364, 3037887, +-760649, -5491840, -11209240, -17943616, -25700144, -34454400, +-44150032, -54695840, -65964980, -77789648, -89960896, -102229872, +-114308392, -125871952, -136561440, -145990880, -153753088, -159424128, +-162577504, -162794960, -159676832, -152853360, -141995744, -126825840, +-107126032, -82747424, -53617472, -19744928, 18775524, 61761592, +-108947912, -159965984, -214394832, -271716064, -331337920, -392605120, +-454808224, -517194272, -578978880, -639359104, -697528768, -752693376, +-804086912, -850989824, -892747136, -928791232, -958536704, -981563328, +-997684800, -1006698432, -1008520640, -1003187328, -990852800, -971782976, +-946346880, -915003328, -878295040, -836832960, -791284544, -742359104, +-690793664, -637338560, 582754624, 527645440, 472906400, 419190784, +367113152, 317241312, 270082016, 226065808, 185534960, 148735312, +115810224, 86800312, 61646000, 40190228, 22181636, 7245162, +-4169367, -12156084, -17964338, -21866804, -24101958, -24886370, +-24433336, -22962478, -20701850, -17885954, -14749119, -11519968, +-8412224, -5619924, -3298610, -1524161 +}; + + +const Word32 LDQMF_20_fx[] = // q = 30 +{ +132095, 130054, 94118, 37811, -32619, -110471, +-188997, -262715, -325880, -375095, -408842, -427924, +-435582, -437285, -440062, -452482, -482692, -537287, +-620381, -731564, -887814, -1074239, -1268925, -1466394, +-1657422, -1832122, -1980124, -2091724, -2157946, -2171782, +-2128230, -2024638, -1860817, -1638685, -1362085, -1036418, +-668022, -263994, 167952, 619489, -1109006, -1594302, +-2074063, -2544892, -3002259, -3443307, -3865450, -4266665, +-4645248, -4999899, -5329217, -5631869, -5906959, -6153951, +-6372928, -6565001, -6732690, -6880012, -7012401, -7136777, +-7260809, -7394870, -7549043, -7731644, -7949919, -8208793, +-8510223, -8852171, -9227619, -9624792, -10025312, -10404401, +-10731825, -10971712, -11081824, -11015548, -10722771, -10150872, +-9246198, -7954792, 6226194, 4006049, 1251053, -2079213, +-6018496, -10592059, -15815707, -21694928, -28223572, -35382820, +-43140436, -51449560, -60249600, -69462792, -78994976, -88734976, +-98555328, -108312432, -117847120, -126986608, -135542896, -143318016, +-150106768, -155693424, -159859744, -162387488, -163062224, -161676800, +-158034768, -151954128, -143271408, -131843832, -117553208, -100308496, +-80048728, -56744644, -30400730, -1056328, 31212950, 66296312, +-104051416, -144280880, -186784688, -231313168, -277585056, -325290400, +-374093504, -423635840, -473540064, -523412928, -572850304, -621440576, +-668770368, -714429248, -758014656, -799138176, -837430848, -872549376, +-904183040, -932063424, -955866112, -975368256, -990502784, -1001141248, +-1007204608, -1008661952, -1005531712, -997881088, -985824192, -969518976, +-949164608, -924995776, -897283008, -866326016, -832450624, -796003264, +-757347840, -716859456, -674920448, -631918336, 588261568, 544170240, +500187776, 456655456, 413899520, 372230592, 331939808, 293293792, +256529792, 221851008, 189423392, 159373024, 131783696, 106697088, +84113256, 63991576, 46252108, 30775584, 17400960, 5897692, +-3242832, -10003035, -15315395, -19324048, -22161874, -23947232, +-24790774, -24801182, -24088950, -22768174, -20956786, -18774960, +-16343248, -13780261, -11200397, -8711802, -6413878, -4393110, +-2713518, -1364255 +}; + + +const Word32 LDQMF_30_fx[] = // q = 30 +{ + 121571, 136778, 125655, 101704, 68195, 26875, +-20212, -70890, -123705, -176138, -226890, -274106, +-316253, -352352, -381787, -404297, -420072, -429892, +-434876, -436802, -437431, -439163, -444543, -456066, +-476087, -506661, -549091, -604538, -672815, -752814, +-858037, -980068, -1106184, -1235998, -1367880, -1498945, +-1626464, -1747442, -1858910, -1957741, -2041059, -2106142, +-2150372, -2171766, -2168618, -2139643, -2084001, -2001495, +-1892255, -1756846, -1596236, -1411745, -1205000, -977797, +-732072, -470033, -193708, 94399, 391658, 694989, +-1028102, -1352314, -1674661, -1994503, -2311012, -2622127, +-2927093, -3225024, -3515027, -3796480, -4068760, -4331384, +-4583784, -4825637, -5056603, -5276176, -5483931, -5679645, +-5863044, -6033975, -6192384, -6338348, -6472204, -6594554, +-6706284, -6808585, -6902959, -6991107, -7075060, -7157331, +-7239857, -7325812, -7418951, -7521577, -7636335, -7765375, +-7910813, -8074047, -8256089, -8457071, -8676456, -8912695, +-9163169, -9424478, -9691922, -9959316, -10219283, -10463412, +-10682245, -10865228, -11000298, -11074417, -11073811, -10983892, +-10789539, -10475044, -10024687, -9422374, -8652076, -7698111, +6547450, 5180201, 3585185, 1749124, -339904, -2692689, +-5318487, -8224782, -11417230, -14899579, -18673422, -22738288, +-27091010, -31726070, -36635292, -41807760, -47229416, -52884028, +-58751904, -64809980, -71032152, -77388632, -83846512, -90369776, +-96918936, -103451368, -109921528, -116280640, -122477480, -128458624, +-134165992, -139540384, -144523760, -149052944, -153063904, -156492352, +-159273296, -161342016, -162634320, -163087360, -162639632, -161231616, +-158806368, -155309920, -150691824, -144905568, -137908720, -129663752, +-120138088, -109304704, -97142448, -83636416, -68777832, -52564528, +-35001268, -16099735, 4121304, 25635912, 48410956, 72407360, +-97584200, -123867744, -151213264, -179552912, -208812656, -238912112, +-269764832, -301278944, -333357440, -365898336, -398795360, -431938528, +-465214080, -498505440, -531693760, -564658432, -597277184, -629427584, +-660987072, -691834048, -721848128, -750911168, -778907776, -805726528, +-831260224, -855407232, -878071616, -899164800, -918606592, -936328128, +-952202112, -966152640, -978197888, -988289792, -996390080, -1002471040, +-1006513664, -1008509056, -1008457600, -1006369728, -1002265344, -996173888, +-988133504, -978191040, -966401920, -952828672, -937540800, -920615360, +-902135488, -882190336, -860873664, -838284672, -814525888, -789704064, +-763927872, -737309056, -709960000, -681994880, -653527872, -624673024, +595607552, 566225280, 536822976, 507495872, 478344672, 449466912, +420958208, 392910464, 365412224, 338547584, 312395584, 287029856, +262517344, 238918544, 216286160, 194665808, 174094816, 154602160, +136208672, 118926376, 102759984, 87704592, 73749168, 60872400, +49048000, 38239292, 28404982, 19492542, 11438051, 4150853, +-1959299, -6809585, -10983833, -14524688, -17473586, -19875174, +-21764768, -23179288, -24150308, -24711158, -24893300, -24729546, +-24252922, -23497172, -22497182, -21287720, -19904868, -18383770, +-16760795, -15070633, -13348427, -11626766, -9938406, -8313092, +-6779951, -5364481, -4088471, -2966834, -2000462, -1134160 +}; + + +const Word32 LDQMF_32_fx[] = // q = 30 +{ +119697, 137151, 128520, 107723, 78400, 41836, +-442, -46740, -95597, -145201, -193804, -240598, +-283800, -322316, -355411, -382593, -403699, -418862, +-428699, -434120, -436480, -437237, -438149, -441391, +-449045, -463039, -485346, -517326, -560092, -614348, +-679872, -755580, -854379, -968457, -1086190, -1207329, +-1330799, -1454135, -1575271, -1691704, -1801098, -1900763, +-1988263, -2061316, -2117677, -2155275, -2172543, -2168111, +-2140952, -2090356, -2016155, -1918414, -1797519, -1654212, +-1489464, -1304576, -1100939, -880095, -643755, -393648, +-131597, 140303, 419876, 704520, -1017921, -1322020, +-1624457, -1924758, -2222508, -2515835, -2804014, -3086295, +-3361992, -3630425, -3891163, -4143616, -4387487, -4622276, +-4847761, -5063642, -5269495, -5464963, -5649876, -5823971, +-5987172, -6139337, -6280537, -6410931, -6530943, -6641149, +-6742439, -6835855, -6922708, -7004445, -7082802, -7159902, +-7237256, -7317480, -7403834, -7498178, -7602711, -7719257, +-7849652, -7995245, -8157013, -8335469, -8530447, -8741283, +-8966383, -9203373, -9449370, -9700315, -9951033, -10195449, +-10426707, -10637019, -10818085, -10960053, -11052529, -11084311, +-11043675, -10918394, -10695736, -10362793, -9906464, -9313511, +-8570674, -7665161, 6586647, 5317833, 3849979, 2171972, +273875, -1853535, -4218327, -6827112, -9685347, -12796811, +-16163952, -19787344, -23665996, -27796800, -32174812, -36793016, +-41642268, -46710992, -51985904, -57451192, -63088408, -68876552, +-74792144, -80808992, -86898528, -93029584, -99168576, -105279432, +-111323816, -117260928, -123048216, -128641440, -133992400, -139052160, +-143773440, -148104208, -151991888, -155383600, -158225792, -160465072, +-162048320, -162923104, -163038096, -162343200, -160789920, -158332016, +-154925376, -150528912, -145104496, -138617152, -131035664, -122332640, +-112485024, -101474136, -89286032, -75911456, -61346324, -45591780, +-28653996, -10544916, 8718141, 29112362, 50609392, 73176464, +-96780680, -121357544, -146873168, -173272304, -200494976, -228475968, +-257145792, -286430368, -316251616, -346527296, -377172096, -408096800, +-439210240, -470417824, -501623072, -532727936, -563632832, -594237184, +-624439872, -654140096, -683237312, -711632192, -739226496, -765924288, +-791632320, -816260416, -839722176, -861935360, -882823040, -902313408, +-920341952, -936853184, -951735680, -964924736, -976443584, -986251200, +-994314944, -1000609792, -1005117952, -1007828864, -1008739392, -1007854080, +-1005185024, -1000751488, -994580096, -986704064, -977163328, -966004416, +-953279168, -939044864, -923364608, -906306368, -887942656, -868349888, +-847608448, -825801792, -803016512, -779341120, -754867072, -729686080, +-703891520, -677576896, -650837184, -623766656, 596524928, 568982144, +541414592, 513899552, 486520032, 459356832, 432489472, 405994688, +379947008, 354417408, 329473600, 305178976, 281592608, 258768368, +236754960, 215594992, 195325728, 175977920, 157575920, 140137536, +123674336, 108191456, 93687496, 80154992, 67580128, 55943780, +45219876, 35377480, 26377892, 18179138, 10724362, 3937154, +-1793747, -6383129, -10375463, -13802420, -16701194, -19108980, +-21056298, -22573612, -23687536, -24425978, -24814642, -24880884, +-24650790, -24152456, -23413234, -22462376, -21328340, -20040900, +-18629038, -17122794, -15550818, -13942058, -12323783, -10723672, +-9166937, -7678115, -6278687, -4990172, -3829056, -2807491, +-1918388, -1103400 +}; + + +const Word32 LDQMF_40_fx[] = // q = 30 +{ +113206, 137254, 134425, 123146, 105211, 81666, +53560, 21302, -14069, -51499, -90644, -130324, +-169687, -208133, -245093, -279677, -311296, -339564, +-364227, -384972, -401866, -414904, -424383, -430758, +-434462, -436342, -437086, -437526, -438798, -441921, +-448029, -458055, -473038, -493889, -521096, -555299, +-596905, -645667, -701531, -764070, -843495, -933719, +-1026835, -1122239, -1219597, -1318430, -1417239, -1515133, +-1610824, -1702996, -1790556, -1872015, -1946188, -2011806, +-2067738, -2112859, -2146050, -2166539, -2173557, -2166437, +-2144725, -2108000, -2056211, -1989295, -1907357, -1810628, +-1699503, -1574446, -1436054, -1285028, -1122103, -948052, +-763730, -570121, -367947, -158284, 57837, 279329, +505114, 733496, -987128, -1230885, -1473412, -1714779, +-1954662, -2192913, -2428356, -2660607, -2889345, -3114179, +-3334742, -3550687, -3761781, -3967793, -4168400, -4363503, +-4552806, -4736194, -4913551, -5084693, -5249383, -5407420, +-5558753, -5703241, -5840790, -5971350, -6094838, -6211308, +-6320774, -6423390, -6519396, -6609079, -6692852, -6771222, +-6844809, -6914280, -6980363, -7043921, -7105964, -7167616, +-7229469, -7292854, -7359781, -7431209, -7508135, -7591745, +-7682927, -7782628, -7891680, -8010673, -8140087, -8280182, +-8430924, -8592083, -8763179, -8943293, -9131195, -9325472, +-9524332, -9725493, -9926142, -10123188, -10313198, -10492333, +-10656603, -10801577, -10922158, -11013175, -11068951, -11083709, +-11051345, -10965628, -10820070, -10607987, -10322919, -9958035, +-9506509, -8961670, -8316717, -7565184, 6702942, 5718827, +4609517, 3369113, 1992225, 473872, -1190731, -3005819, +-4975066, -7101637, -9388180, -11836610, -14448347, -17224060, +-20163764, -23266722, -26531342, -29955288, -33535422, -37267720, +-41147260, -45168140, -49323552, -53606284, -58007508, -62517548, +-67125584, -71820016, -76587808, -81415152, -86287160, -91187832, +-96100320, -101006496, -105887512, -110723520, -115493552, -120176040, +-124748632, -129188288, -133469680, -137567456, -141458352, -145116032, +-148513808, -151624560, -154421360, -156876704, -158963328, -160653808, +-161921024, -162738128, -163078752, -162916896, -162227280, -160985216, +-159167008, -156749920, -153712208, -150033328, -145694224, -140676912, +-134964928, -128543672, -121399776, -113521832, -104900488, -95527920, +-85398544, -74508560, -62856444, -50442808, -37270156, -23343566, +-8670189, 6740502, 22876916, 39724980, 57268860, 75490816, +-94376496, -113883272, -134001320, -154702832, -175958544, -197737504, +-220006032, -242729312, -265870144, -289389664, -313247648, -337401888, +-361809024, -386424256, -411201216, -436093120, -461051360, -486026816, +-510969600, -535829088, -560554240, -585093440, -609395008, -633407296, +-657078592, -680357568, -703193408, -725535424, -747334272, -768541184, +-789108672, -808990656, -828142272, -846520832, -864084928, -880795968, +-896616960, -911514304, -925457216, -938417536, -950324992, -961141376, +-970896128, -979566976, -987136576, -993587776, -998908288, -1003088128, +-1006120192, -1008000960, -1008729280, -1008307648, -1006741504, -1004039168, +-1000212096, -995274560, -989243584, -982139008, -973983296, -964801472, +-954620608, -943470016, -931381312, -918388608, -904527488, -889835648, +-874352128, -858117568, -841174400, -823565824, -805336512, -786531904, +-767198144, -747382720, -727132672, -706495808, -685520512, -664254656, +-642746560, -621047616, 599273536, 577248256, 555196416, 533150944, +511154144, 489249568, 467478368, 445881248, 424498464, 403368608, +382529632, 362017792, 341868224, 322114240, 302787552, 283917824, +265532592, 247657504, 230315568, 213527440, 197311648, 181683920, +166657488, 152242496, 138447232, 125276624, 112733328, 100817520, +89526080, 78854768, 68795096, 59337532, 50469688, 42175888, +34440516, 27241264, 20558124, 14361678, 8619497, 3303077, +-1288525, -5070930, -8454926, -11459781, -14115485, -16433949, +-18436136, -20138626, -21555150, -22702724, -23593500, -24242222, +-24662498, -24867088, -24870766, -24686354, -24328404, -23811232, +-23148884, -22356736, -21449164, -20441404, -19348716, -18185774, +-16968062, -15710186, -14426756, -13132428, -11840736, -10565599, +-9320040, -8115962, -6965903, -5879984, -4867950, -3939393, +-3097321, -2346408, -1680052, -1007771 +}; + + +const Word32 LDQMF_60_fx[] = // q = 30 +{ + 102336, 132095, 137435, 135349, 130054, 120487, +108540, 94118, 77297, 58570, 37811, 15643, +-7974, -32619, -57897, -84046, -110471, -136942, +-163210, -188997, -214438, -239091, -262715, -285164, +-306247, -325880, -343923, -360378, -375095, -388054, +-399325, -408842, -416725, -423037, -427924, -431547, +-434000, -435582, -436522, -437005, -437285, -437644, +-438481, -440062, -442703, -446767, -452482, -460182, +-470154, -482692, -497967, -516093, -537287, -561715, +-589463, -620381, -654511, -691825, -731564, -775911, +-829205, -887814, -949148, -1011179, -1074239, -1138341, +-1203246, -1268925, -1334921, -1400802, -1466394, -1531260, +-1595082, -1657422, -1717943, -1776350, -1832122, -1884921, +-1934396, -1980124, -2021834, -2059138, -2091724, -2119241, +-2141378, -2157946, -2168655, -2173353, -2171782, -2163852, +-2149388, -2128230, -2100421, -2065896, -2024638, -1976676, +-1922048, -1860817, -1793099, -1719008, -1638685, -1552286, +-1460012, -1362085, -1258676, -1150050, -1036418, -918024, +-795131, -668022, -536993, -402188, -263994, -122679, +21420, 167952, 316690, 467104, 619489, 773430, +-945239, -1109006, -1271451, -1433050, -1594302, -1754861, +-1914784, -2074063, -2232363, -2389328, -2544892, -2698989, +-2851488, -3002259, -3151251, -3298296, -3443307, -3586211, +-3726943, -3865450, -4001599, -4135335, -4266665, -4395461, +-4521664, -4645248, -4766175, -4884420, -4999899, -5112604, +-5222404, -5329217, -5433113, -5533999, -5631869, -5726641, +-5818340, -5906959, -5992421, -6074745, -6153951, -6230036, +-6303010, -6372928, -6439843, -6503845, -6565001, -6623435, +-6679269, -6732690, -6783804, -6832855, -6880012, -6925506, +-6969547, -7012401, -7054336, -7095680, -7136777, -7177903, +-7219120, -7260809, -7303731, -7348340, -7394870, -7443617, +-7494881, -7549043, -7606393, -7667166, -7731644, -7800142, +-7872827, -7949919, -8031501, -8117779, -8208793, -8304570, +-8405066, -8510223, -8619935, -8734017, -8852171, -8974106, +-9099397, -9227619, -9358364, -9490965, -9624792, -9759051, +-9892867, -10025312, -10155439, -10282162, -10404401, -10520844, +-10630426, -10731825, -10823502, -10903968, -10971712, -11025073, +-11062346, -11081824, -11081759, -11060277, -11015548, -10945697, +-10848751, -10722771, -10565739, -10375810, -10150872, -9888970, +-9588053, -9246198, -8861297, -8431401, -7954792, -7429283, +6854949, 6226194, 5542800, 4803353, 4006049, 3149248, +2231398, 1251053, 206700, -902968, -2079213, -3323232, +-4636016, -6018496, -7471561, -8995894, -10592059, -12260527, +-14001671, -15815707, -17702624, -19662438, -21694928, -23799650, +-25976100, -28223572, -30541232, -32928052, -35382820, -37904240, +-40490688, -43140436, -45851544, -48621904, -51449560, -54331840, +-57266136, -60249600, -63279032, -66351236, -69462792, -72609920, +-75788648, -78994976, -82224448, -85472704, -88734976, -92006232, +-95281520, -98555328, -101822272, -105076584, -108312432, -111523680, +-114704032, -117847120, -120946376, -123995120, -126986608, -129913560, +-132768248, -135542896, -138230992, -140825344, -143318016, -145701104, +-147966688, -150106768, -152113232, -153978192, -155693424, -157250816, +-158642336, -159859744, -160895152, -161740352, -162387488, -162828688, +-163056176, -163062224, -162839296, -162379936, -161676800, -160722816, +-159511024, -158034768, -156287280, -154262480, -151954128, -149356496, +-146464032, -143271408, -139773568, -135965808, -131843832, -127403488, +-122641048, -117553208, -112136840, -106389392, -100308496, -93892368, +-87139520, -80048728, -72619504, -64851416, -56744644, -48299972, +-39518100, -30400730, -20949652, -11167261, -1056328, 9379870, +20137698, 31212950, 42601076, 54297248, 66296312, 78593112, +-91185600, -104051416, -117194704, -130607064, -144280880, -158207776, +-172378736, -186784688, -201415824, -216262032, -231313168, -246558128, +-261985952, -277585056, -293343616, -309249600, -325290400, -341453376, +-357725472, -374093504, -390543744, -407062432, -423635840, -440249504, +-456889088, -473540064, -490187584, -506816896, -523412928, -539960640, +-556444864, -572850304, -589161600, -605363456, -621440576, -637377600, +-653159232, -668770368, -684195712, -699420352, -714429248, -729207616, +-743740992, -758014656, -772014784, -785727168, -799138176, -812234496, +-825002880, -837430848, -849505856, -861215872, -872549376, -883495616, +-894043456, -904183040, -913905152, -923200640, -932063424, -940477696, +-948417216, -955866112, -962841216, -969345024, -975368256, -980905536, +-985952256, -990502784, -994553344, -998100544, -1001141248, -1003673344, +-1005694720, -1007204608, -1008202304, -1008687808, -1008661952, -1008125952, +-1007081664, -1005531712, -1003479040, -1000927424, -997881088, -994344832, +-990323904, -985824192, -980852096, -975414528, -969518976, -963173312, +-956385600, -949164608, -941519424, -933459776, -924995776, -916137728, +-906896448, -897283008, -887308928, -876985984, -866326016, -855341824, +-844045696, -832450624, -820569472, -808415936, -796003264, -783345088, +-770455104, -757347840, -744036608, -730535808, -716859456, -703022272, +-689038016, -674920448, -660685696, -646345600, -631918336, -617424704, +602927232, 588261568, 573575488, 558872576, 544170240, 529480224, +514815008, 500187776, 485610624, 471095904, 456655456, 442301536, +428045760, 413899520, 399874240, 385981024, 372230592, 358633472, +345199872, 331939808, 318862624, 305977728, 293293792, 280819232, +268562016, 256529792, 244729552, 233167968, 221851008, 210784624, +199973840, 189423392, 179137440, 169119664, 159373024, 149900064, +140703152, 131783696, 123142424, 114780232, 106697088, 98892400, +91364808, 84113256, 77135992, 70429688, 63991576, 57819020, +51907328, 46252108, 40848248, 35691672, 30775584, 26091894, +21637068, 17400960, 13374445, 9548629, 5897692, 2475272, +-592184, -3242832, -5659970, -7917455, -10003035, -11926348, +-13696880, -15315395, -16789184, -18123694, -19324048, -20394110, +-21338122, -22161874, -22868630, -23462238, -23947232, -24327810, +-24607834, -24790774, -24881324, -24883598, -24801182, -24638338, +-24399474, -24088950, -23710470, -23268668, -22768174, -22213084, +-21607820, -20956786, -20264828, -19536176, -18774960, -17986262, +-17174228, -16343248, -15497611, -14641749, -13780261, -12916498, +-12055168, -11200397, -10355588, -9525147, -8711802, -7920384, +-7153632, -6413878, -5706099, -5031208, -4393110, -3792571, +-3230785, -2713518, -2227977, -1784736, -1364255, -871387 +}; +#endif /* OPT_IVAS_FILTER_ROM */ + const Word32 rot_vec_delay_re_LDQMF_fx[60] = // q = 31 { -1518500224, 1518500224, 1518500224, -1518500224, -1518500224, 1518500224, 1518500224, -1518500224, -1518500224, 1518500224, 1518500224, -1518500224, -1518500224, 1518500224, diff --git a/lib_com/rom_com_fx.h b/lib_com/rom_com_fx.h index 29e7637574ac2d2085f44ff635a71493440b7444..9bf335aac1b8bac51a45ccafc1cc847a0dba6500 100644 --- a/lib_com/rom_com_fx.h +++ b/lib_com/rom_com_fx.h @@ -70,7 +70,7 @@ extern const Word16 sin_twiddle_table_25_5_5[25]; // Q15 extern const Word16 cos_twiddle_table_16_8_2[16]; // Q15 extern const Word16 sin_twiddle_table_16_8_2[16]; // Q15 - +#ifndef OPT_IVAS_FILTER_ROM extern const Word16 CLDFB80_10_fx[100]; // Q15 extern const Word16 CLDFB80_16_fx[160]; // Q15 extern const Word16 CLDFB80_20_fx[200]; // Q15 @@ -87,6 +87,25 @@ extern const Word16 LDQMF_30_fx[300]; // Q15 extern const Word16 LDQMF_32_fx[320]; // Q15 extern const Word16 LDQMF_40_fx[400]; // Q15 extern const Word16 LDQMF_60_fx[600]; // Q15 +#else /* OPT_IVAS_FILTER_ROM */ + +extern const Word32 CLDFB80_10_fx[100]; // Q30 +extern const Word32 CLDFB80_16_fx[160]; // Q30 +extern const Word32 CLDFB80_20_fx[200]; // Q30 +extern const Word32 CLDFB80_30_fx[300]; // Q30 +extern const Word32 CLDFB80_32_fx[320]; // Q30 +extern const Word32 CLDFB80_40_fx[400]; // Q30 +extern const Word32 CLDFB80_60_fx[600]; // Q30 + +/*5ms delay*/ +extern const Word32 LDQMF_10_fx[100]; // Q30 +extern const Word32 LDQMF_16_fx[160]; // Q30 +extern const Word32 LDQMF_20_fx[200]; // Q30 +extern const Word32 LDQMF_30_fx[300]; // Q30 +extern const Word32 LDQMF_32_fx[320]; // Q30 +extern const Word32 LDQMF_40_fx[400]; // Q30 +extern const Word32 LDQMF_60_fx[600]; // Q30 +#endif /* OPT_IVAS_FILTER_ROM */ /* Not used anywhere extern const Word16 LDQMF_10_enc_fx[100]; extern const Word16 LDQMF_16_enc_fx[160]; diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h index e5081d2be6bc7d1650a88dbc1b23ab2394a9840a..506d2d1cd7b828ecfbe8d863db3973f0646d87b9 100644 --- a/lib_com/stat_com.h +++ b/lib_com/stat_com.h @@ -619,8 +619,11 @@ typedef struct cldfb_filter_bank_struct Word16 da; /* delay analysis */ CLDFB_PROTOTYPE prototype; const Word16 *p_filter; /*!< Pointer to filter coefficients */ // Q15 - Word16 p_filter_sf; // Q0 - +#ifdef OPT_IVAS_FILTER_ROM + const Word32 *p_filter_32; /*!< Pointer to filter coefficients */ // Q15 +#else /* OPT_IVAS_FILTER_ROM */ + Word16 p_filter_sf; // Q0 +#endif /* OPT_IVAS_FILTER_ROM */ /* rotation vectors */ const Word32 *rot_vec_syn_re_fx; // Q29 diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 03bc7ee12ee45d2cc81066fc65c158f191c6aa25..a778424dd37420b7e61fd86c88e5d6b236a8b4d0 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -1750,31 +1750,68 @@ void ivas_qmetadata_to_dirac_fx( } ELSE { +#ifndef OPT_SBA_DEC_PATH Word16 tmp1, tmp4; +#endif /* OPT_SBA_DEC_PATH */ Word16 a, b_tmp; Word16 exp_factor = 0; move16(); a = rand_triangular_signed_fx( seed_ptr, &exp_factor ); // q = exp_factor +#ifndef OPT_SBA_DEC_PATH tmp1 = mult( a, dirac_dithering_azi_scale_fx[diff_idx] ); // exp_factor + 5 Word32 tmp1_32 = L_deposit_h( tmp1 ); +#else /* OPT_SBA_DEC_PATH */ + Word32 tmp1_32 = L_mult( a, dirac_dithering_azi_scale_fx[diff_idx] ); // exp_factor + 5 +#endif /* OPT_SBA_DEC_PATH */ Word16 final_1_exp; - Word32 final_1_32 = BASOP_Util_Add_Mant32Exp( azimuth_fx, 9, tmp1_32, exp_factor + 5, &final_1_exp ); - b_tmp = rand_triangular_signed_fx( seed_ptr, &exp_factor ); // q = exp_factor + Word32 final_1_32; +#ifndef OPT_SBA_DEC_PATH + final_1_32 = BASOP_Util_Add_Mant32Exp( azimuth_fx, 9, tmp1_32, add( exp_factor, 5 ), &final_1_exp ); +#else /* OPT_SBA_DEC_PATH */ + Word16 norm_op1 = norm_l( azimuth_fx ); + Word16 norm_op2 = norm_l( tmp1_32 ); + Word16 op2_e = add( exp_factor, 5 ); + final_1_exp = add( s_max( s_max( sub( 9, norm_op1 ), sub( op2_e, norm_op2 ) ), 0 ), 2 ); // 2 for headroom + final_1_32 = L_add( L_shr( azimuth_fx, sub( final_1_exp, 9 ) ), L_shr( tmp1_32, sub( final_1_exp, op2_e ) ) ); + +#endif /* OPT_SBA_DEC_PATH */ + b_tmp = rand_triangular_signed_fx( seed_ptr, &exp_factor ); // q = exp_factor +#ifndef OPT_SBA_DEC_PATH tmp4 = mult( b_tmp, dirac_dithering_ele_scale_fx[diff_idx] ); // exp_factor + 4 Word32 tmp4_32 = L_deposit_h( tmp4 ); - Word16 final_2_exp; - Word32 final_2_32 = BASOP_Util_Add_Mant32Exp( elevation_fx, 9, tmp4_32, exp_factor + 4, &final_2_exp ); - +#else /* OPT_SBA_DEC_PATH */ + Word32 tmp4_32 = L_mult( b_tmp, dirac_dithering_ele_scale_fx[diff_idx] ); // exp_factor + 4 +#endif /* OPT_SBA_DEC_PATH */ + Word16 final_2_exp; + Word32 final_2_32; +#ifndef OPT_SBA_DEC_PATH + final_2_32 = BASOP_Util_Add_Mant32Exp( elevation_fx, 9, tmp4_32, add( exp_factor, 4 ), &final_2_exp ); +#else /* OPT_SBA_DEC_PATH */ + norm_op1 = norm_l( elevation_fx ); + norm_op2 = norm_l( tmp4_32 ); + op2_e = add( exp_factor, 4 ); + final_2_exp = add( s_max( s_max( sub( 9, norm_op1 ), sub( op2_e, norm_op2 ) ), 0 ), 2 ); // 2 for headroom + final_2_32 = L_add( L_shr( elevation_fx, sub( final_2_exp, 9 ) ), L_shr( tmp4_32, sub( final_2_exp, op2_e ) ) ); +#endif /* OPT_SBA_DEC_PATH */ + +#ifndef OPT_SBA_DEC_PATH final_1_32 = BASOP_Util_Add_Mant32Exp( final_1_32, final_1_exp, ONE_IN_Q30, 0, &final_1_exp ); /*0.5 in q31*/ final_2_32 = BASOP_Util_Add_Mant32Exp( final_2_32, final_2_exp, ONE_IN_Q30, 0, &final_2_exp ); azi = extract_h( L_shr( final_1_32, sub( sub( 31, final_1_exp ), 16 ) ) ); ele = extract_h( L_shr( final_2_32, sub( sub( 31, final_2_exp ), 16 ) ) ); +#else /* OPT_SBA_DEC_PATH */ + final_1_32 = L_add( final_1_32, L_shl( 1, sub( 30, final_1_exp ) ) ); /*0.5 in q31*/ + final_2_32 = L_add( final_2_32, L_shl( 1, sub( 30, final_2_exp ) ) ); + azi = extract_h( L_shr( final_1_32, sub( 15, final_1_exp ) ) ); + ele = extract_h( L_shr( final_2_32, sub( 15, final_2_exp ) ) ); +#endif /* OPT_SBA_DEC_PATH */ + /*addition of one to compensate precision loss*/ if ( azi < 0 ) diff --git a/lib_dec/ivas_mct_core_dec_fx.c b/lib_dec/ivas_mct_core_dec_fx.c index b42eb534b34af52b78b359306728ea7fd919f4a3..08359826a48825d19a6ef9a170789f5938b68f6a 100644 --- a/lib_dec/ivas_mct_core_dec_fx.c +++ b/lib_dec/ivas_mct_core_dec_fx.c @@ -198,7 +198,10 @@ void ivas_mct_core_dec( Word16 tcx_offset; Word16 tcx_offsetFB; Word16 left_rect; - Word16 L_spec, scale, tmp1, tmp2; + Word16 L_spec; +#ifndef OPT_SBA_DEC_PATH + Word16 scale, tmp1, tmp2; +#endif /* OPT_SBA_DEC_PATH */ #ifdef DEBUG_MCT float nrg[MCT_MAX_CHANNELS]; #endif @@ -218,11 +221,18 @@ void ivas_mct_core_dec( move16(); FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { +#ifndef OPT_SBA_DEC_PATH FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; i = add( i, 1 ); } +#else /* OPT_SBA_DEC_PATH */ + FOR( ch = 0; ch < CPE_CHANNELS; ( ch++, i++ ) ) + { + sts[i] = hCPE[cpe_id]->hCoreCoder[ch]; + } +#endif /* OPT_SBA_DEC_PATH */ } i = 0; @@ -268,7 +278,61 @@ void ivas_mct_core_dec( { CONTINUE; } +#ifdef OPT_SBA_DEC_PATH + IF( EQ_16( st->core, TCX_10_CORE ) ) + { + Word16 L_frame_2 = shr( st->L_frame, 1 ); + Word16 L_frameTCX_2 = shr( st->hTcxDec->L_frameTCX, 1 ); + nSubframes = NB_DIV; // assuming NB_DIV is 2. Below logic needs to be modified if NB_DIV changes. + move16(); + FOR( k = 0; k < nSubframes; k++ ) + { + L_spec = shr( st->hTcxCfg->tcx_coded_lines, 1 ); + move32(); + init_tcx_info_fx( st, L_frame_2, L_frameTCX_2, k, bfi, &tcx_offset, &tcx_offsetFB, &L_frame, &L_frameTCX, &left_rect, &L_spec ); + + Word16 x_e, x_len; + /* mono or dual mono IGF decoding */ + x_e = sub( 31, q_x[ch] ); + decoder_tcx_IGF_mono_fx( st, x_fx[ch][k], &x_e, &x_len, L_frame, left_rect, bfi, k ); + q_x[ch] = sub( 31 - 12, x_e ); // Shift to bring x to Q12 + move16(); + FOR( i = 0; i < x_len; i++ ) + { + x_fx[ch][k][i] = L_shr( x_fx[ch][k][i], q_x[ch] ); + move32(); + } + q_x[ch] = Q12; + move16(); + } + } + ELSE + { + nSubframes = 1; + move16(); + { + L_spec = st->hTcxCfg->tcx_coded_lines; + move32(); + + init_tcx_info_fx( st, st->L_frame, st->hTcxDec->L_frameTCX, 0, bfi, &tcx_offset, &tcx_offsetFB, &L_frame, &L_frameTCX, &left_rect, &L_spec ); + + Word16 x_e, x_len; + /* mono or dual mono IGF decoding */ + x_e = sub( 31, q_x[ch] ); + decoder_tcx_IGF_mono_fx( st, x_fx[ch][0], &x_e, &x_len, L_frame, left_rect, bfi, 0 ); + q_x[ch] = sub( 31 - 12, x_e ); // Shift to bring x to Q12 + move16(); + FOR( i = 0; i < x_len; i++ ) + { + x_fx[ch][0][i] = L_shr( x_fx[ch][0][i], q_x[ch] ); + move32(); + } + q_x[ch] = Q12; + move16(); + } + } +#else /* OPT_SBA_DEC_PATH */ IF( EQ_16( st->core, TCX_10_CORE ) ) { nSubframes = NB_DIV; @@ -304,6 +368,7 @@ void ivas_mct_core_dec( q_x[ch] = Q12; move16(); } +#endif /* OPT_SBA_DEC_PATH */ } } ELSE @@ -318,6 +383,9 @@ void ivas_mct_core_dec( * MCT processing *--------------------------------------------------------------------------------*/ +#ifdef OPT_SBA_DEC_PATH + apply_MCT_dec_fx( hMCT, sts, x_fx ); +#else /* OPT_SBA_DEC_PATH */ apply_MCT_dec_fx( hMCT, sts, x_fx, q_x ); FOR( ch = 0; ch < nChannels; ch++ ) { @@ -331,6 +399,7 @@ void ivas_mct_core_dec( q_x[ch] = Q12; move16(); } +#endif /* OPT_SBA_DEC_PATH */ } pop_wmops(); diff --git a/lib_dec/ivas_mct_dec_mct_fx_fx.c b/lib_dec/ivas_mct_dec_mct_fx_fx.c index 0f20c1ec0fbdd12dc61b9d97a6d8bf256733fbb5..0d998b355f87a39a661e643ec386ac8edbfec77b 100644 --- a/lib_dec/ivas_mct_dec_mct_fx_fx.c +++ b/lib_dec/ivas_mct_dec_mct_fx_fx.c @@ -165,8 +165,12 @@ void ivas_mct_dec_mct_fx( static void applyGlobalILD_fx( Decoder_State **sts, MCT_DEC_HANDLE hMCT, - Word32 *x[MCT_MAX_CHANNELS][NB_DIV], - Word16 q_x[MCT_MAX_CHANNELS] ) + Word32 *x[MCT_MAX_CHANNELS][NB_DIV] +#ifndef OPT_SBA_DEC_PATH + , + Word16 q_x[MCT_MAX_CHANNELS] +#endif /* OPT_SBA_DEC_PATH */ +) { Word16 ch, k; Word16 nSubframes, L_subframeTCX; @@ -207,9 +211,14 @@ static void applyGlobalILD_fx( FOR( k = 0; k < nSubframes; k++ ) { v_multc_fixed( x[ch][k], qratio, x[ch][k], L_subframeTCX ); // Qx - 5 + q_qratio +#ifdef OPT_SBA_DEC_PATH + scale_sig32( x[ch][k], L_subframeTCX, sub( 5, q_qratio ) ); +#endif /* OPT_SBA_DEC_PATH */ } +#ifndef OPT_SBA_DEC_PATH q_x[ch] = add( sub( q_x[ch], 5 ), q_qratio ); move16(); +#endif /* OPT_SBA_DEC_PATH */ } ELSE { @@ -228,10 +237,14 @@ static void applyGlobalILD_fx( *----------------------------------------------------------*/ void apply_MCT_dec_fx( - MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ - Decoder_State **sts, /* i/o: decoder state structure */ - Word32 *x[MCT_MAX_CHANNELS][NB_DIV], /* i/o: decoded and dequan. spect. input to MCT */ - Word16 q_x[MCT_MAX_CHANNELS] ) + MCT_DEC_HANDLE hMCT, /* i/o: MCT decoder structure */ + Decoder_State **sts, /* i/o: decoder state structure */ + Word32 *x[MCT_MAX_CHANNELS][NB_DIV] /* i/o: decoded and dequan. spect. input to MCT */ +#ifndef OPT_SBA_DEC_PATH + , + Word16 q_x[MCT_MAX_CHANNELS] +#endif /* OPT_SBA_DEC_PATH */ +) { Word16 pair; MCT_DEC_BLOCK_DATA_HANDLE hBlock; @@ -240,10 +253,18 @@ void apply_MCT_dec_fx( { hBlock = hMCT->hBlockData[pair]; +#ifndef OPT_SBA_DEC_PATH stereo_decoder_tcx_fx( hBlock->hStereoMdct, hBlock->mask, &x[hBlock->ch2][0], &x[hBlock->ch1][0], &x[hBlock->ch2][0], hBlock->hStereoMdct->mdct_stereo_mode, sts[hBlock->ch1]->core, sts[hBlock->ch2]->core, sts[0]->igf, sts[0]->hTcxDec->L_frameTCX, sts[1]->hTcxDec->L_frameTCX, 1, TCX_20_CORE, TCX_20_CORE, 0, &q_x[hBlock->ch2], &q_x[hBlock->ch1] ); +#else /* OPT_SBA_DEC_PATH */ + stereo_decoder_tcx_fx( hBlock->hStereoMdct, hBlock->mask, &x[hBlock->ch2][0], &x[hBlock->ch1][0], &x[hBlock->ch2][0], hBlock->hStereoMdct->mdct_stereo_mode, sts[hBlock->ch1]->core, sts[hBlock->ch2]->core, sts[0]->igf, sts[0]->hTcxDec->L_frameTCX, sts[1]->hTcxDec->L_frameTCX, 1, TCX_20_CORE, TCX_20_CORE, 0 ); +#endif /* OPT_SBA_DEC_PATH */ } +#ifndef OPT_SBA_DEC_PATH applyGlobalILD_fx( sts, hMCT, x, q_x ); +#else /* OPT_SBA_DEC_PATH */ + applyGlobalILD_fx( sts, hMCT, x ); +#endif /* OPT_SBA_DEC_PATH */ return; } diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index fabebede4e6e468526331188d065f9086d1715c9..4e90792fba310f9b3bc3ba5fd43fc770460c6774 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -737,7 +737,11 @@ void ivas_mdct_core_invQ_fx( q_r = sub( 30, sts[1]->hTonalMDCTConc->lastBlockData.spectralData_exp ); /* both input in same Q */ +#ifndef OPT_SBA_DEC_PATH stereo_decoder_tcx_fx( hCPE->hStereoMdct, ms_mask, x_0[1], &spectralData_tmp[0], &spectralData_tmp[1], &hCPE->hStereoMdct->mdct_stereo_mode[0], sts[0]->core, sts[1]->core, sts[0]->igf, L_frameTCX[0], L_frameTCX[1], 0, sts[0]->last_core, sts[1]->last_core, 1, &q_r, &q_l ); +#else /* OPT_SBA_DEC_PATH */ + stereo_decoder_tcx_fx( hCPE->hStereoMdct, ms_mask, x_0[1], &spectralData_tmp[0], &spectralData_tmp[1], &hCPE->hStereoMdct->mdct_stereo_mode[0], sts[0]->core, sts[1]->core, sts[0]->igf, L_frameTCX[0], L_frameTCX[1], 0, sts[0]->last_core, sts[1]->last_core, 1 ); +#endif /* OPT_SBA_DEC_PATH */ Copy_Scale_sig_32_16( spectralData_tmp[0], sts[0]->hTonalMDCTConc->lastBlockData.spectralData, L_frameTCX[0], -15 ); // q_l - 15 Copy_Scale_sig_32_16( spectralData_tmp[1], sts[1]->hTonalMDCTConc->lastBlockData.spectralData, L_frameTCX[1], -15 ); // q_r - 15 diff --git a/lib_dec/ivas_stereo_mdct_core_dec_fx.c b/lib_dec/ivas_stereo_mdct_core_dec_fx.c index 89cb92a4d08c1b9f834610892fdd5ce2dc73c68c..85ae00c9082f3c2ebb62d5de09d2248ca324472c 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_core_dec_fx.c @@ -465,9 +465,11 @@ void stereo_mdct_core_dec_fx( test(); IF( ( !bfi || ( sts[0]->core != ACELP_CORE || sts[1]->core != ACELP_CORE ) ) && !hCPE->hStereoMdct->isSBAStereoMode ) { +#ifndef OPT_SBA_DEC_PATH Word16 q_x_1 = 11, q_x_0 = 11; move16(); move16(); +#endif /* OPT_SBA_DEC_PATH */ FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -477,7 +479,11 @@ void stereo_mdct_core_dec_fx( move16(); } } +#ifdef OPT_SBA_DEC_PATH + stereo_decoder_tcx_fx( hCPE->hStereoMdct, ms_mask, x_0_fx[1], x_fx[0], x_fx[1], &hCPE->hStereoMdct->mdct_stereo_mode[0], sts[0]->core, sts[1]->core, sts[0]->igf, L_frameTCX[0], L_frameTCX[1], 0, sts[0]->last_core, sts[1]->last_core, 0 ); +#else /* OPT_SBA_DEC_PATH */ stereo_decoder_tcx_fx( hCPE->hStereoMdct, ms_mask, x_0_fx[1], x_fx[0], x_fx[1], &hCPE->hStereoMdct->mdct_stereo_mode[0], sts[0]->core, sts[1]->core, sts[0]->igf, L_frameTCX[0], L_frameTCX[1], 0, sts[0]->last_core, sts[1]->last_core, 0, &q_x_1, &q_x_0 ); +#endif /* OPT_SBA_DEC_PATH */ } ivas_mdct_core_tns_ns_fx( hCPE, fUseTns, tnsData, x_fx, Aq_fx_32, 0, x_e ); diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c index 8842a6792a8c866cbcc17e6b0b0a9f1a32f7392d..492060a67d4a4527180dbf4e195e7b80e68ce567 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c @@ -313,9 +313,13 @@ void stereo_decoder_tcx_fx( const Word16 mct_on, /* i : flag mct block (1) or stereo (0) Q0*/ const Word16 last_core_l, /* i : last core for left channel Q0*/ const Word16 last_core_r, /* i : last core for right channel Q0*/ - const Word16 tmp_plc_upmix, /* i : indicates temp upmix for PLC decision Q0*/ + const Word16 tmp_plc_upmix /* i : indicates temp upmix for PLC decision Q0*/ +#ifndef OPT_SBA_DEC_PATH + , Word16 *q_x_ch2, - Word16 *q_x_ch1 ) + Word16 *q_x_ch1 +#endif /* OPT_SBA_DEC_PATH */ +) { Word16 i, k, sfb, nSubframes; STEREO_MDCT_BAND_PARAMETERS *sfbConf = NULL; @@ -361,10 +365,12 @@ void stereo_decoder_tcx_fx( } } inverseMS_fx( sfbConf->sfbOffset[sfbConf->nBandsStereoCore], spec_l[k], spec_r[k], SQRT2_OVER_2_FIXED ); +#ifndef OPT_SBA_DEC_PATH *q_x_ch2 = *q_x_ch2; move16(); *q_x_ch1 = *q_x_ch1; move16(); +#endif /* OPT_SBA_DEC_PATH */ } ELSE IF( EQ_16( mdct_stereo_mode[k], SMDCT_BW_MS ) ) { @@ -381,10 +387,12 @@ void stereo_decoder_tcx_fx( } } inverseBwMS_fx( sfbConf->sfbOffset[sfb], sfbConf->sfbOffset[sfb + 1], spec_l[k], spec_r[k], SQRT2_OVER_2_FIXED ); +#ifndef OPT_SBA_DEC_PATH *q_x_ch2 = *q_x_ch2; move16(); *q_x_ch1 = *q_x_ch1; move16(); +#endif /* OPT_SBA_DEC_PATH */ } } } @@ -402,10 +410,12 @@ void stereo_decoder_tcx_fx( } } inverseMS_fx( sub( sfbConf->sfbOffset[sfbConf->sfbCnt], sfbConf->sfbOffset[sfbConf->nBandsStereoCore] ), &spec_l[k][sfbConf->sfbOffset[sfbConf->nBandsStereoCore]], &spec_r[k][sfbConf->sfbOffset[sfbConf->nBandsStereoCore]], SQRT2_OVER_2_FIXED ); +#ifndef OPT_SBA_DEC_PATH *q_x_ch2 = *q_x_ch2; move16(); *q_x_ch1 = *q_x_ch1; move16(); +#endif /* OPT_SBA_DEC_PATH */ } ELSE IF( EQ_16( hStereoMdct->IGFStereoMode[k], SMDCT_BW_MS ) ) { @@ -422,10 +432,12 @@ void stereo_decoder_tcx_fx( } } inverseBwMS_fx( sfbConf->sfbOffset[sfb], sfbConf->sfbOffset[sfb + 1], spec_l[k], spec_r[k], SQRT2_OVER_2_FIXED ); +#ifndef OPT_SBA_DEC_PATH *q_x_ch2 = *q_x_ch2; move16(); *q_x_ch1 = *q_x_ch1; move16(); +#endif /* OPT_SBA_DEC_PATH */ } } } @@ -483,8 +495,10 @@ void stereo_decoder_tcx_fx( nrgRatio = L_shl( nrgRatio, shift ); /* Q26 + shift */ v_multc_fixed( spec_r[k], nrgRatio, spec_r[k], L_frameTCX_r ); /* spec_r will be in Qx + shift - Q5 */ Scale_sig32( spec_r[k], L_frameTCX_r, sub( 5, shift ) ); /* Qx */ +#ifndef OPT_SBA_DEC_PATH *q_x_ch2 = *q_x_ch2; move16(); +#endif /* OPT_SBA_DEC_PATH */ } ELSE IF( ( LT_32( nrgRatio, ONE_IN_Q26 ) ) && ( LT_16( k, tmp2 ) ) ) { @@ -492,8 +506,10 @@ void stereo_decoder_tcx_fx( shift = sub( 5, tmp_e ); v_multc_fixed( spec_l[k], inv_nrgRatio, spec_l[k], L_frameTCX_l ); /* spec_r will be in Qx - tmp_e */ Scale_sig32( spec_l[k], L_frameTCX_l, sub( 5, shift ) ); /* Qx */ +#ifndef OPT_SBA_DEC_PATH *q_x_ch1 = *q_x_ch1; move16(); +#endif /* OPT_SBA_DEC_PATH */ } } } /* for k */ diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index ba0ab89532221e289e7504e997553b9b64f0f479..c96878d553fc7654f52080b1ae514946ecc6c39f 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -674,7 +674,7 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( Word16 num_freq_bands_diff, num_channels_diff; Word16 ch_idx; Word32 aux_buf[CLDFB_NO_CHANNELS_MAX]; - Word16 diff_start_band, tmp16; + Word16 diff_start_band; DIRAC_OUTPUT_SYNTHESIS_PARAMS *h_dirac_output_synthesis_params; DIRAC_OUTPUT_SYNTHESIS_STATE *h_dirac_output_synthesis_state; @@ -827,9 +827,341 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( ONE_IN_Q29 /*0.25f Q31*/, h_dirac_output_synthesis_state->diffuse_power_factor_fx, num_freq_bands ); /*h_dirac_output_synthesis_state->diffuse_power_factor_q+Q31-Q31->h_dirac_output_synthesis_state->diffuse_power_factor_q*/ +#ifdef OPT_SBA_DEC_PATH + /*Direct gain*/ + + Word16 *exp_temp_cy_cross_dir_smooth_fx = (Word16 *) malloc( num_freq_bands * num_channels_dir * sizeof( Word16 ) ); + Word16 cy_cross_dir_smooth_e = sub( 31, h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ); + + FOR( Word16 kk = 0; kk < ( num_freq_bands * num_channels_dir ); kk++ ) + { + exp_temp_cy_cross_dir_smooth_fx[kk] = cy_cross_dir_smooth_e; // h_dirac_output_synthesis_state->q_cy_cross_dir_smooth; + move16(); + } + + Word16 q_temp = sub( add( shl( h_dirac_output_synthesis_state->direct_responses_q, 1 ), q_diffuseness ), 62 ); + Word32 one_in_qdiff = L_shl( 1, q_diffuseness ); + Word32 c1 = Madd_32_16( ONE_IN_Q29 /*1 Q29*/, L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr_fx, ONE_IN_Q29 /*1 Q29*/ ), 5461 /*1.0 / 6.0 Q15*/ ); /*Diffuseness modellling nrg compensation*/ /*Q29*/ + Word16 q_diff_c = sub( q_diffuseness, 2 ); + + FOR( ch_idx = 0; ch_idx < s_min( 4, nchan_transport ); ch_idx++ ) + { + Word16 k; + IF( ch_idx != 0 ) + { + Word32 a, c; + Word16 b, b_exp, sqr_exp, q_diff_aab; // , q_diff_c; + Word32 mpy_a_a_b, mpy_diff_c, mpy_diff_aab; + Word32 sqr_inp, sqr; + + /*Directonal sound gain nrg compensation*/ + FOR( k = 0; k < num_freq_bands_diff; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses + move32(); + + + b_exp = 0; + move16(); + + b = 0; + move16(); + + if ( 0 == reference_power[k + ( ch_idx + 1 ) * num_freq_bands] ) + { + b = MAX_16; + move16(); + } + + test(); + IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] && reference_power[k + num_freq_bands] ) + { + b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], reference_power[k + ( ch_idx + 1 ) * num_freq_bands], &b_exp ); /*Q(15-b_exp)*/ + } + + + mpy_a_a_b = Mpy_32_32( a, Mpy_32_16_1( a, b ) ); // Q = (h_dirac_output_synthesis_state->q_direct_responses + (15 - b_exp) - 15) + (h_dirac_output_synthesis_state->q_direct_responses) - 31 + mpy_diff_aab = Mpy_32_32( L_sub( one_in_qdiff, diffuseness[k] ), mpy_a_a_b ); // Q(q_diff_aab) = 2*(h_dirac_output_synthesis_state->q_direct_responses) - b_exp - 31 + q_diffuseness -31 + mpy_diff_c = Mpy_32_32( diffuseness[k], c1 ); // Q(q_diff_c) = q_diffuseness - 2 + + q_diff_aab = sub( q_temp, b_exp ); // add( sub( add( h_dirac_output_synthesis_state->direct_responses_q, sub( 15, b_exp ) ), 15 ), add( sub( h_dirac_output_synthesis_state->direct_responses_q, 31 ), sub( q_diffuseness, 31 ) ) ); + + Word16 minq = sub( s_min( q_diff_aab, q_diff_c ), 1 ); + Word32 op1 = L_shr( mpy_diff_aab, sub( q_diff_aab, minq ) ); + Word32 op2 = L_shr( mpy_diff_c, sub( q_diff_c, minq ) ); + sqr_inp = L_add( op1, op2 ); + sqr_exp = sub( 31, minq ); + sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ + sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ + IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) + { + IF( GT_16( sqr_exp, cy_cross_dir_smooth_e ) ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( sqr_exp, cy_cross_dir_smooth_e ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth-> (31-sqr_exp) */ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + ELSE + { + sqr = L_shr( sqr, sub( cy_cross_dir_smooth_e, sqr_exp ) ); /*( 31- sqr_exp )-> h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ + } + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*exp_temp_cy_cross_dir_smooth_fx*/ + move32(); + } + ELSE + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr; // L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*31-sqr_exp*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + } + c = Madd_32_16( ONE_IN_Q27 /*1 Q27*/, L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_fx, ONE_IN_Q27 /*1 Q27*/ ), 5461 ); /*Diffuseness modellling nrg compensation*/ /* 1.0 / 6.0 = 5461 in Q15*/ /*Q27*/ + Word16 diff_c_exp = sub( q_diffuseness, 4 ); +#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot + FOR( ; k < num_freq_bands; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses + move32(); + IF( reference_power[k + num_freq_bands] == 0 ) + { + sqr_inp = Mpy_32_32( diffuseness[k], c ); + sqr_exp = sub( 31 + 4, q_diffuseness ); + } + ELSE + { + Word16 diff_aab_exp; + IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] == 0 ) + { + mpy_a_a_b = Mpy_32_32( a, a ); // Q = (h_dirac_output_synthesis_state->q_direct_responses + (h_dirac_output_synthesis_state->q_direct_responses) - 31 + mpy_diff_aab = Mpy_32_32( L_sub( one_in_qdiff, diffuseness[k] ), mpy_a_a_b ); // Q = 2*(h_dirac_output_synthesis_state->q_direct_responses) - 31 + q_diffuseness -31 + mpy_diff_c = Mpy_32_32( diffuseness[k], c ); // Q = q_diffuseness - 4 + diff_aab_exp = q_temp; + move16(); + } + ELSE + { + b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], reference_power[k + ( ch_idx + 1 ) * num_freq_bands], &b_exp ); /*q(15-b_exp)*/ + + mpy_a_a_b = Mpy_32_32( a, Mpy_32_16_1( a, b ) ); // Q = (h_dirac_output_synthesis_state->q_direct_responses + (15 - b_exp) - 15) + (h_dirac_output_synthesis_state->q_direct_responses) - 31 + mpy_diff_aab = Mpy_32_32( L_sub( one_in_qdiff, diffuseness[k] ), mpy_a_a_b ); // Q = 2*(h_dirac_output_synthesis_state->q_direct_responses) - b_exp - 31 + q_diffuseness -31 + mpy_diff_c = Mpy_32_32( diffuseness[k], c ); // Q = q_diffuseness - 4 + diff_aab_exp = sub( q_temp, b_exp ); // sub(sub(add(sub(31 + 62, h_dirac_output_synthesis_state->direct_responses_q), b_exp), h_dirac_output_synthesis_state->direct_responses_q), q_diffuseness); + } + Word16 minq = sub( s_min( diff_aab_exp, diff_c_exp ), 1 ); + Word32 op1 = L_shr( mpy_diff_aab, sub( diff_aab_exp, minq ) ); + Word32 op2 = L_shr( mpy_diff_c, sub( diff_c_exp, minq ) ); + sqr_inp = L_add( op1, op2 ); + sqr_exp = sub( 31, minq ); + } + sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ + sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ + + + IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) + { + IF( GT_16( sqr_exp, cy_cross_dir_smooth_e ) ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( sqr_exp, cy_cross_dir_smooth_e ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth->Q( 31- sqr_exp )*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + ELSE + { + sqr = L_shr( sqr, sub( cy_cross_dir_smooth_e, sqr_exp ) ); /*Q(31- sqr_exp)->h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ + } + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k]*/ + move32(); + } + ELSE + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q(31- sqr_exp)*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; + move16(); + } + } + +#else + FOR( ; k < num_freq_bands; k++ ) + { + a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses + move32(); + IF( reference_power[k + num_freq_bands] == 0 ) + { + b = 0; + move16(); + b_exp = 0; + move16(); + } + ELSE + { + IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] == 0 ) + { + b = MAX_16; + move16(); + b_exp = 0; + move16(); + } + ELSE + { + b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], reference_power[k + ( ch_idx + 1 ) * num_freq_bands], &b_exp ); /*q(15-b_exp)*/ + } + } + + mpy_a_a_b = Mpy_32_32( a, Mpy_32_16_1( a, b ) ); // Q = (h_dirac_output_synthesis_state->q_direct_responses + (15 - b_exp) - 15) + (h_dirac_output_synthesis_state->q_direct_responses) - 31 + mpy_diff_aab = Mpy_32_32( L_sub( L_shl( 1, q_diffuseness ), diffuseness[k] ), mpy_a_a_b ); // Q = 2*(h_dirac_output_synthesis_state->q_direct_responses) - b_exp - 31 + q_diffuseness -31 + mpy_diff_c = Mpy_32_32( diffuseness[k], c2 ); // Q = q_diffuseness - 4 + q_diff_aab = add( add( h_dirac_output_synthesis_state->direct_responses_q, sub( sub( 15, b_exp ), 15 ) ), add( sub( h_dirac_output_synthesis_state->direct_responses_q, 31 ), sub( q_diffuseness, 31 ) ) ); + q_diff_c = sub( q_diffuseness, 4 ); + Word16 minq = sub( s_min( q_diff_aab, q_diff_c ), 1 ); + Word32 op1 = L_shr( mpy_diff_aab, sub( q_diff_aab, minq ) ); + Word32 op2 = L_shr( mpy_diff_c, sub( q_diff_c, minq ) ); + sqr_inp = L_add( op1, op2 ); + sqr_exp = sub( 31, minq ); + sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ + sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ + IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) + { + IF( GT_16( sqr_exp, cy_cross_dir_smooth_e ) ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( sqr_exp, cy_cross_dir_smooth_e ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth->Q( 31- sqr_exp )*/ + move32(); + Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + ELSE + { + sqr = L_shr( sqr, sub( cy_cross_dir_smooth_e, sqr_exp ) ); /*Q(31- sqr_exp)->h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ + } + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k]*/ + move32(); + } + ELSE + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q(31- sqr_exp)*/ + move32(); + Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + } +#endif + } + ELSE + { + Word32 sqr_inp, sqr; + Word16 sqr_exp; + Word32 One_in_qdiff = L_shl( 1, sub( q_diffuseness, 1 ) ); + Word32 diff = L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr_fx /*q29=0.5 * q30*/, ONE_IN_Q29 /*0.5 Q30*/ ); // Q30 + Word16 sq_e = sub( 32, q_diffuseness ); // 31-(q_diffuseness-1) + /*Diffuseness modellling nrg compensation*/ + FOR( k = 0; k < num_freq_bands_diff; k++ ) + { + /*diffuseness[k] * 0.5f * ( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr - 1.f ) )*/ + sqr_inp = Madd_32_32( One_in_qdiff, diffuseness[k], diff ); // Q = q_diffuseness - 1 + sqr_exp = sq_e; + move16(); + sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ + sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ + IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) + { + IF( LT_16( cy_cross_dir_smooth_e, sqr_exp ) ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( sqr_exp, cy_cross_dir_smooth_e ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth->Q(31- sqr_exp)*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + ELSE + { + sqr = L_shr( sqr, sub( cy_cross_dir_smooth_e, sqr_exp ) ); /*Q(31-sqr_exp)->h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ + } + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k]*/ + move32(); + } + ELSE + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr; /*Q(31-sqr_exp)*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + } + FOR( ; k < num_freq_bands; k++ ) + { + sqr_inp = Madd_32_32( One_in_qdiff, diffuseness[k], L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_decorr_fx, ONE_IN_Q29 /*1 Q29*/ ) ); // Q = q_diffuseness - 1 + sqr_exp = sq_e; + move16(); + sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ + sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ + IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) + { + IF( GT_16( sqr_exp, cy_cross_dir_smooth_e ) ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( sqr_exp, cy_cross_dir_smooth_e ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth, Q( 31- sqr_exp )*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); + move16(); + } + ELSE + { + sqr = L_shr( sqr, sub( cy_cross_dir_smooth_e, sqr_exp ) ); /*Q( 31- sqr_exp ), h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ + } + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k]*/ + move32(); + } + ELSE + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q(31-sqr_exp)*/ + move32(); + exp_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; + move16(); + } + } + } + } + Word16 temp = exp_temp_cy_cross_dir_smooth_fx[0]; /*q0*/ + move16(); + FOR( Word16 kk = 1; kk < ( num_freq_bands * num_channels_dir ); kk++ ) + { + temp = s_max( exp_temp_cy_cross_dir_smooth_fx[kk], temp ); + } + + + /*Directional gain (panning)*/ + Word16 temp_q = sub( add( h_dirac_output_synthesis_state->direct_power_factor_q, h_dirac_output_synthesis_state->direct_responses_q ), 31 ); + Word16 temp_exp = sub( 31, temp_q ); + + IF( LT_16( temp, temp_exp ) ) + { + FOR( Word16 kk = 0; kk < ( num_freq_bands * num_channels_dir ); kk++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[kk] = L_shl( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[kk], sub( exp_temp_cy_cross_dir_smooth_fx[kk], temp_exp ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ->temp_q*/ + move32(); + } + h_dirac_output_synthesis_state->q_cy_cross_dir_smooth = temp_q; + move16(); + } + ELSE + { + FOR( Word16 kk = 0; kk < ( num_freq_bands * num_channels_dir ); kk++ ) + { + h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[kk] = L_shl( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[kk], sub( exp_temp_cy_cross_dir_smooth_fx[kk], temp ) ); /*exp_temp_cy_cross_dir_smooth_fx[kk]->temp*/ + move32(); + } + h_dirac_output_synthesis_state->q_cy_cross_dir_smooth = sub( 31, temp ); + move16(); + } + free( exp_temp_cy_cross_dir_smooth_fx ); +#else /* OPT_SBA_DEC_PATH */ /*Direct gain*/ - tmp16 = imult1616( num_freq_bands, num_channels_dir ); + + Word16 *Q_temp_cy_cross_dir_smooth_fx = (Word16 *) malloc( num_freq_bands * num_channels_dir * sizeof( Word16 ) ); + + Word16 tmp16 = imult1616( num_freq_bands, num_channels_dir ); FOR( Word16 kk = 0; kk < tmp16; kk++ ) { h_dirac_output_synthesis_state->Q_temp_cy_cross_dir_smooth_fx[kk] = h_dirac_output_synthesis_state->q_cy_cross_dir_smooth; @@ -1182,6 +1514,8 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( h_dirac_output_synthesis_state->q_cy_cross_dir_smooth = temp_q; move16(); } +#endif /* OPT_SBA_DEC_PATH */ + Word16 temp_q1 = sub( h_dirac_output_synthesis_state->q_cy_cross_dir_smooth, temp_q ); FOR( ch_idx = s_min( 4, nchan_transport ); ch_idx < num_channels_dir; ch_idx++ ) { @@ -1577,7 +1911,6 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd_fx( } q_shift = sub( 26, h_dirac_output_synthesis_state.q_cy_cross_dir_smooth_prev ); - move16(); /* Direct gains */ IF( hodirac_flag ) @@ -1693,11 +2026,20 @@ void ivas_dirac_dec_output_synthesis_process_subframe_gain_shd_fx( /*Direct input->output*/ p_gains_dir = h_dirac_output_synthesis_state.cy_cross_dir_smooth_prev_fx; // (p_gains_dir_q) p_gains_dir_prev = h_dirac_output_synthesis_state.gains_dir_prev_fx; +#ifdef OPT_SBA_DEC_PATH + q_shift = sub( h_dirac_output_synthesis_state.q_cy_cross_dir_smooth_prev, h_dirac_output_synthesis_state.gains_dir_prev_q ); +#endif /* OPT_SBA_DEC_PATH */ FOR( ch_idx = 0; ch_idx < num_channels_dir; ch_idx++ ) { +#ifdef OPT_SBA_DEC_PATH + Scale_sig32( &h_dirac_output_synthesis_state.gains_dir_prev_fx[ch_idx * num_freq_bands], + num_freq_bands, + q_shift ); /*h_dirac_output_synthesis_state.gains_dir_prev_q->h_dirac_output_synthesis_state.q_cy_cross_dir_smooth_prev*/ +#else /* OPT_SBA_DEC_PATH */ Scale_sig32( &h_dirac_output_synthesis_state.gains_dir_prev_fx[ch_idx * num_freq_bands], num_freq_bands, sub( h_dirac_output_synthesis_state.q_cy_cross_dir_smooth_prev, h_dirac_output_synthesis_state.gains_dir_prev_q ) ); /*h_dirac_output_synthesis_state.gains_dir_prev_q->h_dirac_output_synthesis_state.q_cy_cross_dir_smooth_prev*/ +#endif /* OPT_SBA_DEC_PATH */ } h_dirac_output_synthesis_state.gains_dir_prev_q = h_dirac_output_synthesis_state.q_cy_cross_dir_smooth_prev; move16();