Commit e7bab8bf authored by TYAGIRIS's avatar TYAGIRIS
Browse files

copy prior frame q factor for P coeffs

parent d5538f18
Loading
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -488,6 +488,7 @@ ivas_error ivas_spar_md_enc_process_fx(
    Word16 q_Wscale[IVAS_MAX_NUM_BANDS];
#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING
    Word32 P_quant_re_prior[SPAR_DIRAC_SPLIT_START_BAND][FOA_CHANNELS - 1];
    Word16 Q_P_quant_re_prior[SPAR_DIRAC_SPLIT_START_BAND];
#endif

    /*extra 16 bits for arithmetic coder as overshoot check is after a symbol is written*/
@@ -617,11 +618,12 @@ ivas_error ivas_spar_md_enc_process_fx(
    }

#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING
    if ( hEncoderConfig->ivas_total_brate < IVAS_24k4 )
    IF( LT_32( hEncoderConfig->ivas_total_brate, IVAS_24k4 ) )
    {
        for ( b = 0; b < num_bands * bands_bw; b++ )
        FOR( b = 0; b < i_mult( num_bands, bands_bw ); b++ )
        {
            Copy32( hMdEnc->spar_md.band_coeffs[b].P_quant_re_fx, P_quant_re_prior[b], FOA_CHANNELS - 1 );
            Copy32( hMdEnc->spar_md.band_coeffs[b].P_quant_re_fx, P_quant_re_prior[b], sub( FOA_CHANNELS, 1 ) );
            Q_P_quant_re_prior[b] = hMdEnc->spar_md.band_coeffs[b].q_P_re_fx;
        }
    }
#endif
@@ -961,13 +963,15 @@ ivas_error ivas_spar_md_enc_process_fx(
    }
    /* Reuse mixer matrix values for unsent bands */
#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING
    IF( hEncoderConfig->ivas_total_brate < IVAS_24k4 )
    IF( LT_32( hEncoderConfig->ivas_total_brate, IVAS_24k4 ) )
    {
        FOR( k = num_bands - 1; k >= 0; k-- )
        {
            FOR( b = bands_bw - 1; b >= 0; b-- )
            {
                Copy32( hMdEnc->spar_md.band_coeffs[k].P_quant_re_fx, hMdEnc->spar_md.band_coeffs[bands_bw * k + b].P_quant_re_fx, FOA_CHANNELS - 1 );
                Copy32( hMdEnc->spar_md.band_coeffs[k].P_quant_re_fx, hMdEnc->spar_md.band_coeffs[add( i_mult( bands_bw, k ), b )].P_quant_re_fx, sub( FOA_CHANNELS, 1 ) );
                hMdEnc->spar_md.band_coeffs[add( i_mult( bands_bw, k ), b )].q_P_re_fx = hMdEnc->spar_md.band_coeffs[k].q_P_re_fx;
                move16();
            }
        }
    }
@@ -993,8 +997,12 @@ ivas_error ivas_spar_md_enc_process_fx(
                }
            }
#ifdef NONBE_FIX_907_VLBR_DIRAC_BAND_MAPPING
            Copy32( P_quant_re_prior[b], hMdEnc->spar_md.band_coeffs[b].P_quant_re_fx, FOA_CHANNELS - 1 );
            Copy32( P_quant_re_prior[b + 1], hMdEnc->spar_md.band_coeffs[b + 1].P_quant_re_fx, FOA_CHANNELS - 1 );
            Copy32( P_quant_re_prior[b], hMdEnc->spar_md.band_coeffs[b].P_quant_re_fx, sub( FOA_CHANNELS, 1 ) );
            Copy32( P_quant_re_prior[b + 1], hMdEnc->spar_md.band_coeffs[b + 1].P_quant_re_fx, sub( FOA_CHANNELS, 1 ) );
            hMdEnc->spar_md.band_coeffs[b].q_P_re_fx = Q_P_quant_re_prior[b];
            hMdEnc->spar_md.band_coeffs[b + 1].q_P_re_fx = Q_P_quant_re_prior[b + 1];
            move16();
            move16();
#endif
        }
    }