Commit 2252cb05 authored by Jan Kiene's avatar Jan Kiene
Browse files

add logging of bits

parent fbe6551e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -43,8 +43,11 @@

#define DEBUGGING                             /* Allows debugging message to be printed out during runtime */
#ifdef DEBUGGING
#define DEBUG_READ_IN_SPECTRUM_B4_STEREO_DECISION
// #define DEBUG_READ_IN_SPECTRUM_B4_STEREO_DECISION
#define DEBUG_MODE_INFO                       /* Define to output most important parameters to the subdirectory "res/" */
#ifdef DEBUG_MODE_INFO
#define DEBUG_MODE_MDCT
#endif
#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 */
/*#define DEBUG_FORCE_DIR*/                       /* Force modes/parameters by reading from external binary files */
+10 −0
Original line number Diff line number Diff line
@@ -1205,6 +1205,10 @@ static void MsStereoDecision_fx(

    /*find_max_lastnz(ctxL,ctxR,ctxM,ctxS);*/
    
#ifdef DEBUG_MODE_MDCT
    dbgwrite(&sfbParam->nBandsStereoCore, sizeof(int16_t), 1, 1, "./res/nBandsStereoCore");
#endif

    FOR( sfb = 0; sfb < sfbParam->nBandsStereoCore; sfb++ )
    {
        const Word16 startline = sfbParam->sfbOffset[sfb];
@@ -1235,6 +1239,12 @@ static void MsStereoDecision_fx(
            context_update_fx( ctxR, ctxS, endline );
            bitsBW = add( bitsBW, add( bitsL, bitsR ) ); /* Q0 */
        }
#ifdef DEBUG_MODE_MDCT
        dbgwrite( &bitsL, sizeof( int16_t ), 1, 1, "./res/bitsL" );
        dbgwrite( &bitsR, sizeof( int16_t ), 1, 1, "./res/bitsR" );
        dbgwrite( &bitsM, sizeof( int16_t ), 1, 1, "./res/bitsM" );
        dbgwrite( &bitsS, sizeof( int16_t ), 1, 1, "./res/bitsS" );
#endif
    }

    bitsBW = add( bitsBW, sfbParam->nBandsStereoCore ); /* Signaling bits Q0*/