Commit e7ef5b8b authored by Jan Kiene's avatar Jan Kiene
Browse files

add reading in from fx logout

parent 1b32d091
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@

#ifdef DEBUGGING
// #define DEBUG_WRITE_OUT_SPECTRUM_B4_STEREO_DECISION
// #define READ_IN_MS_DEC_SPEC_FROM_FX
/*#define DBG_BITSTREAM_ANALYSIS*/                  /* Write bitstream with annotations to a text file */

#define DISABLE_DFT_STEREO_ASSERT               /* This assert is hit for -10 dB tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, bandwidth switching] */
+25 −2
Original line number Diff line number Diff line
@@ -1020,6 +1020,29 @@ static void MsStereoDecision(
    ctxM = &ctxMem[2];
    ctxS = &ctxMem[3];

#ifdef READ_IN_MS_DEC_SPEC_FROM_FX
    int32_t fx_buffer[512];
    int16_t q_spec;
    float scale_fac;

    dbgread( &q_spec, sizeof( int16_t ), 1, "q_spec" );
    scale_fac = 1 / powf( 2, q_spec );

    // Left spec
    dbgread( &fx_buffer[0], sizeof( int32_t ), 512, "specL_fx" );
    for ( i = 0; i < 512; ++i )
    {
        specL[i] = fx_buffer[i] * scale_fac;
    }

    // Right spec
    dbgread( &fx_buffer[0], sizeof( int32_t ), 512, "specR_fx" );
    for ( i = 0; i < 512; ++i )
    {
        specR[i] = fx_buffer[i] * scale_fac;
    }
#endif

    GLR = SQ_gain_estimate_stereo( specL, specR, nBitsAvailable, length );

    for ( i = 0; i < length; i++ )