Commit 861e260f authored by Jan Kiene's avatar Jan Kiene
Browse files

add reading in float spectrum

parent 9ee15094
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@

#define DEBUGGING                             /* Allows debugging message to be printed out during runtime */
#ifdef DEBUGGING
#define DEBUG_READ_IN_SPECTRUM_B4_STEREO_DECISION
#define DEBUG_MODE_INFO                       /* Define to output most important parameters to the subdirectory "res/" */
#define DEBUG_MODE_INFO_TWEAK                 /* Enable command line switch to specify subdirectory for debug info output inside "./res/" */
#define DEBUG_FORCE_MDCT_STEREO_MODE          /* Force stereo mode decision for MDCT stereo: -stereo 3 1 forces L/R coding and -stereo 3 2 forces full M/S coding */
+13 −0
Original line number Diff line number Diff line
@@ -469,6 +469,19 @@ void stereo_coder_tcx_fx(
            nAvailBitsMS[k] = idiv1616( nAvailBitsMS[k], nSubframes ); /* Q0 */
            move16();

#ifdef DEBUG_READ_IN_SPECTRUM_B4_STEREO_DECISION
            // read in float spectra written out from ivas-float-update
            float in_buf[2][L_FRAME48k];
            dbgread(&in_buf[0][0], L_FRAME48k, 1, "left_spec_log");
            dbgread(&in_buf[1][0], L_FRAME48k, 1, "right_spec_log");

            float q_fac = pow(2, q_spec);
            for (int i = 0; i < L_FRAME48k; ++i)
            {
                sts[0]->hTcxEnc->spectrum_fx[k][i] = (Word32)(in_buf[0][i] * q_fac);
                sts[1]->hTcxEnc->spectrum_fx[k][i] = (Word32)(in_buf[1][i] * q_fac);
            }
#endif
            MsStereoDecision_fx( sfbConf, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], inv_spectrum_fx[0][k], inv_spectrum_fx[1][k], q_spec, &hStereoMdct->mdct_stereo_mode[k], &ms_mask[k][0], nAvailBitsMS[k] );

            IF( sts[0]->igf )