Commit 2a0924b8 authored by Nicolas Roussin's avatar Nicolas Roussin
Browse files

Fix ivas_iir_2_filter_fx32.

parent c280a982
Loading
Loading
Loading
Loading
Loading
+15 −24
Original line number Diff line number Diff line
@@ -80,17 +80,14 @@ void ivas_filters_init_fx(
#endif
        }

        filter_state->state_fx[IVAS_FILTER_STAGE_0][0] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_0][1] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_0][2] = 0;
#ifdef OPT_2239_IVAS_FILTER_PROCESS
        filter_state->state64_fx[IVAS_FILTER_STAGE_0][0] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_0][1] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_0][2] = 0;
        move64();
        move64();
        move64();
#else
        filter_state->state_fx[0][0] = 0;
        filter_state->state_fx[0][1] = 0;
        filter_state->state_fx[0][2] = 0;
        move32();
        move32();
        move32();
@@ -138,13 +135,13 @@ void ivas_filters_init_fx(
#endif
        }

        filter_state->state_fx[IVAS_FILTER_STAGE_0][0] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_0][1] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_0][2] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_1][0] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_1][1] = 0;
        filter_state->state_fx[IVAS_FILTER_STAGE_1][2] = 0;
#ifdef OPT_2239_IVAS_FILTER_PROCESS
        filter_state->state64_fx[IVAS_FILTER_STAGE_0][0] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_0][1] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_0][2] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_1][0] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_1][1] = 0;
        filter_state->state64_fx[IVAS_FILTER_STAGE_1][2] = 0;
        move64();
        move64();
        move64();
@@ -152,12 +149,6 @@ void ivas_filters_init_fx(
        move64();
        move64();
#else
        filter_state->state_fx[0][0] = 0;
        filter_state->state_fx[0][1] = 0;
        filter_state->state_fx[0][2] = 0;
        filter_state->state_fx[1][0] = 0;
        filter_state->state_fx[1][1] = 0;
        filter_state->state_fx[1][2] = 0;
        move32();
        move32();
        move32();
@@ -238,7 +229,7 @@ static void ivas_iir_2_filter_fx32(
        shift = filter_state->num_q[stage][0] + q - state_q;
        tmp_prod = W_shr( W_mult0_32_32( filter_state->num_fx[stage][0], in ), shift );

        pIn_Out_fx[i] = out = W_extract_l( W_add( filter_state->state64_fx[stage][0], tmp_prod ) );
        pIn_Out_fx[i] = out = W_extract_h( W_add( filter_state->state_fx[stage][0], tmp_prod ) );
        move32();

        FOR( j = 1; j < filter_state->filt_len; j++ )
@@ -246,12 +237,12 @@ static void ivas_iir_2_filter_fx32(
            shift = filter_state->num_q[stage][j] + q - state_q;
            tmp_prod = W_shr( W_mult0_32_32( filter_state->num_fx[stage][j], in ), shift );

            tmp = W_add( filter_state->state64_fx[stage][j], tmp_prod );
            tmp = W_add( filter_state->state_fx[stage][j], tmp_prod );

            shift = filter_state->den_q[stage][j] + q - state_q;
            tmp_prod = W_shr( W_mult0_32_32( filter_state->den_fx[stage][j], out ), shift );

            filter_state->state64_fx[stage][j - 1] = W_sub( tmp, tmp_prod );
            filter_state->state_fx[stage][j - 1] = W_sub( tmp, tmp_prod );
            move32();
        }
    }
@@ -311,7 +302,7 @@ static void ivas_iir_2_filter_fx64(
        shift = ( filter_state->num_q[stage][0] + q - 31 ) - q;
        tmp_prod = W_shr( Mpy_64_32( in, filter_state->num_fx[stage][0] ), shift );

        pIn_Out_fx[i] = out = W_add( filter_state->state64_fx[stage][0], tmp_prod );
        pIn_Out_fx[i] = out = W_add( filter_state->state_fx[stage][0], tmp_prod );
        move32();

        FOR( j = 1; j < filter_state->filt_len; j++ )
@@ -319,12 +310,12 @@ static void ivas_iir_2_filter_fx64(
            shift = ( filter_state->num_q[stage][j] + q - 31 ) - q;
            tmp_prod = W_shr( Mpy_64_32( in, filter_state->num_fx[stage][j] ), shift );

            tmp = W_add( filter_state->state64_fx[stage][j], tmp_prod );
            tmp = W_add( filter_state->state_fx[stage][j], tmp_prod );

            shift = ( filter_state->den_q[stage][j] + q - 31 ) - q;
            tmp_prod = W_shr( Mpy_64_32( out, filter_state->den_fx[stage][j] ), shift );

            filter_state->state64_fx[stage][j - 1] = W_sub( tmp, tmp_prod );
            filter_state->state_fx[stage][j - 1] = W_sub( tmp, tmp_prod );
            move32();
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -657,7 +657,7 @@ typedef struct ivas_filters_process_state_t
    Word32 num_fx[IVAS_FILTER_MAX_STAGES][IVAS_BIQUAD_FILT_LEN];
    Word32 den_fx[IVAS_FILTER_MAX_STAGES][IVAS_BIQUAD_FILT_LEN];
#ifdef OPT_2239_IVAS_FILTER_PROCESS
    Word64 state64_fx[IVAS_FILTER_MAX_STAGES][IVAS_BIQUAD_FILT_LEN];
    Word64 state_fx[IVAS_FILTER_MAX_STAGES][IVAS_BIQUAD_FILT_LEN];
    Word16 num_q[IVAS_FILTER_MAX_STAGES][IVAS_BIQUAD_FILT_LEN];
    Word16 den_q[IVAS_FILTER_MAX_STAGES][IVAS_BIQUAD_FILT_LEN];
#else