Commit d68c8f84 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch...

Merge branch '1161-enable-force-tcx10-tcx20-on-the-encoder-command-line-in-debugging-mode' into 'main'

Resolve "Enable -force TCX10|TCX20 on the encoder command-line in DEBUGGING mode"

Closes #1161

See merge request !941
parents d830a9f9 34d391e0
Loading
Loading
Loading
Loading
Loading
+41 −1
Original line number Diff line number Diff line
@@ -353,6 +353,15 @@ int main(
        goto cleanup;
    }

#ifdef SUPPORT_FORCE_TCX10_TCX20
#ifdef DEBUGGING
    if ( arg.forcedMode == IVAS_ENC_FORCE_TCX10 && totalBitrate < 48000 )
    {
        fprintf( stderr, "Warning: Enforcing the TCX10 mode is only supported for bitrates higher or equal than 48 kbps!\n\n" );
    }
#endif
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure and initialize (allocate memory for static variables) the encoder
     *------------------------------------------------------------------------------------------*/
@@ -998,7 +1007,24 @@ static bool parseCmdlIVAS_enc(
            }
            else
            {
#ifdef SUPPORT_FORCE_TCX10_TCX20
                if ( arg->forcedMode == IVAS_ENC_FORCE_TCX10 )
                {
                    strcpy( stmp, "TCX10" );
                }
                else if ( arg->forcedMode == IVAS_ENC_FORCE_TCX20 )
                {
                    strcpy( stmp, "TCX20" );
                }
                else
                {
                    strncpy( stmp, argv[i + 1], sizeof( stmp ) );
                }

                fprintf( stdout, "Forcing codec to:       %s\n", stmp );
#else
                fprintf( stdout, "Forcing codec to:       %s\n", argv[i + 1] );
#endif
            }

            i += 2;
@@ -1919,10 +1945,24 @@ static IVAS_ENC_FORCED_MODE parseForcedMode(
    {
        return IVAS_ENC_FORCE_GSC;
    }
    if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 ) )
    if ( ( strcmp( forcedModeChar, "TCX" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX'" ) == 0 )
#ifdef SUPPORT_FORCE_TCX10_TCX20
         || ( strcmp( forcedModeChar, "TCX20" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX20'" ) == 0 )
#endif
    )
    {
#ifdef SUPPORT_FORCE_TCX10_TCX20
        return IVAS_ENC_FORCE_TCX20;
#else
        return IVAS_ENC_FORCE_TCX;
#endif
    }
#ifdef SUPPORT_FORCE_TCX10_TCX20
    if ( ( strcmp( forcedModeChar, "TCX10" ) == 0 ) || ( strcmp( forcedModeChar, "'TCX10'" ) == 0 ) )
    {
        return IVAS_ENC_FORCE_TCX10;
    }
#endif
    if ( ( strcmp( forcedModeChar, "HQ" ) == 0 ) || ( strcmp( forcedModeChar, "'HQ'" ) == 0 ) )
    {
        return IVAS_ENC_FORCE_HQ;
+6 −0
Original line number Diff line number Diff line
@@ -190,8 +190,14 @@
#define FORCE_MUSIC                     101             /* debugging - force music on the command line */
#define FORCE_ACELP                     102             /* debugging - force ACELP core on the command line */
#define FORCE_GSC                       103             /* debugging - force GSC core on the command line */
#ifdef SUPPORT_FORCE_TCX10_TCX20
#define FORCE_TCX10                     104             /* debugging - force TCX10 core on the command line */
#define FORCE_TCX20                     105             /* debugging - force TCX20 core on the command line */
#define FORCE_HQ                        106             /* debugging - force HQ core on the command line */
#else
#define FORCE_TCX                       104             /* debugging - force TCX core on the command line */
#define FORCE_HQ                        105             /* debugging - force HQ core on the command line */
#endif
#define FORCE_TD_RENDERER               201
#define FORCE_CLDFB_RENDERER            202
#endif
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
#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 DBG_WAV_WRITER*/                    /* Enable dbgwrite_wav() function for generating ".wav" files */
#define SUPPORT_FORCE_TCX10_TCX20             /* VA: Enable -force tcx10|tcx20 command-line option */
#endif

#define SUPPORT_JBM_TRACEFILE                   /* Support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */
+0 −1
Original line number Diff line number Diff line
@@ -981,7 +981,6 @@ static void init_modes_ivas_fx(
        move16();
    }


    /* TCX mode (TCX20 TCX10_10 or NO_TCX) */
    if ( st->hTcxEnc != NULL )
    {
+7 −0
Original line number Diff line number Diff line
@@ -244,10 +244,17 @@ void ivas_decision_matrix_enc_fx(
        {
            st->core = ACELP_CORE;
        }
#ifdef SUPPORT_FORCE_TCX10_TCX20
        else if ( st->force == FORCE_TCX20 || st->force == FORCE_TCX10 ) /* Initalizations should always happen with TCX20*/
        {
            st->core = TCX_20_CORE;
        }
#else
        else if ( st->force == FORCE_TCX )
        {
            st->core = TCX_20_CORE;
        }
#endif
        else if ( st->force == FORCE_HQ && st->element_mode != IVAS_CPE_MDCT && element_brate >= IVAS_24k4 )
        {
            st->core = HQ_CORE;
Loading