Commit fe26d687 authored by multrus's avatar multrus
Browse files

Merge branch '20231122_cleanup' into 'main'

20231122 cleanup

See merge request !1240
parents bbdf1492 8537b01e
Loading
Loading
Loading
Loading
Loading
+0 −53
Original line number Diff line number Diff line
@@ -2123,35 +2123,6 @@ static ivas_error decodeG192(
    /* we always start with needing a new frame */
    needNewFrame = true;

#ifndef FIX_899_VARIABLE_SPEED_DECODING
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
    /*------------------------------------------------------------------------------------------*
     * Open TSM scale file or set global TSM scale
     *------------------------------------------------------------------------------------------*/

    if ( arg.tsmEnabled )
    {
        if ( arg.tsmScaleFileEnabled )
        {
            if ( ( tsmScaleFileReader = TsmScaleFileReader_open( arg.tsmScaleFileName ) ) == NULL )
            {
                fprintf( stderr, "\nError: Can't open TSM scale file %s \n\n", arg.tsmScaleFileName );
                goto cleanup;
            }
        }
        else
        {
            if ( ( error = IVAS_DEC_VoIP_SetScale( hIvasDec, arg.tsmScale, arg.tsmScale ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_DEC_VoIP_SetScale failed: %s \n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
        }
    }
#endif
#endif
#endif

    if ( !arg.quietModeEnabled )
    {
@@ -2196,7 +2167,6 @@ static ivas_error decodeG192(
    }
#endif

#ifdef FIX_899_VARIABLE_SPEED_DECODING
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
    /*------------------------------------------------------------------------------------------*
@@ -2232,7 +2202,6 @@ static ivas_error decodeG192(
        }
    }
#endif
#endif
#endif

    /*------------------------------------------------------------------------------------------*
@@ -2387,14 +2356,10 @@ static ivas_error decodeG192(
                        fprintf( stderr, "\nError: input bitstream file couldn't be read: %s \n\n", arg.inputBitstreamFilename );
                        goto cleanup;
                    }
#ifdef FIX_899_VARIABLE_SPEED_DECODING
                    int16_t maxScaling;
                    /* max scaling as abs diff to the normal frame size in samples */
                    maxScaling = (int16_t) ceilf( (float) abs( arg.tsmScale - 100 ) / 100.0f * (float) ( nOutSamples * vec_pos_len ) );
                    if ( ( error = IVAS_DEC_VoIP_SetScale( hIvasDec, maxScaling, arg.tsmScale ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = IVAS_DEC_VoIP_SetScale( hIvasDec, scale, scale ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nIVAS_DEC_VoIP_SetScale failed: %s \n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
@@ -2466,7 +2431,6 @@ static ivas_error decodeG192(
#ifdef SPLIT_REND_WITH_HEAD_ROT
            }
#endif
#ifdef FIX_899_VARIABLE_SPEED_DECODING
            if ( needNewFrame )
            {
                frame++;
@@ -2481,7 +2445,6 @@ static ivas_error decodeG192(
#endif
                }
            }
#endif

        } while ( nSamplesRendered < nOutSamples && error == IVAS_ERR_OK );

@@ -2605,22 +2568,6 @@ static ivas_error decodeG192(
            }
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#ifndef FIX_899_VARIABLE_SPEED_DECODING
        if ( needNewFrame )
        {
            frame++;
            if ( !arg.quietModeEnabled )
            {
                fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
#ifdef DEBUGGING
                if ( IVAS_DEC_GetBerDetectFlag( hIvasDec ) )
                {
                    fprintf( stdout, "\n   Decoding error: BER detected in frame %d !!!!!\n", frame - 1 );
                }
#endif
            }
        }
#endif
#ifdef WMOPS
        if ( vec_pos_update == 0 )
        {
+0 −40
Original line number Diff line number Diff line
@@ -1690,47 +1690,11 @@ static bool parseCmdlIVAS_enc(

            i++;
        }
#ifdef FIX_643_PCA_OPTION
        else if ( strcmp( argv_to_upper, "-PCA" ) == 0 )
        {
            arg->pca = 1;
            i++;
        }
#else
        else if ( strcmp( argv_to_upper, "-BYPASS" ) == 0 ) // TODO: should be renamed to "-pca"
        {
            i++;
            if ( i < argc - 4 )
            {
                switch ( atoi( argv[i] ) )
                {
                    case 1:
                    {
                        arg->pca = 0;
                        break;
                    }
                    case 2:
                    {
                        arg->pca = 1;
                        break;
                    }
                    default:
                    {
                        fprintf( stderr, "Error: SBA PCA bypass argument is out of range (%d), expected 1 or 2\n", (int32_t) atoi( argv[i] ) );
                        usage_enc();
                        return false;
                    }
                }
                i++;
            }
            else
            {
                fprintf( stderr, "Error: SBA unspecified PCA BYPASS value \n\n" );
                usage_enc();
                return false;
            }
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -1927,11 +1891,7 @@ static void usage_enc( void )
    fprintf( stdout, "-mime               : Mime output bitstream file format\n" );
    fprintf( stdout, "                      The encoder produces TS26.445 Annex.2.6 Mime Storage Format, (not RFC4867 Mime Format).\n" );
    fprintf( stdout, "                      default output bitstream file format is G.192\n" );
#ifdef FIX_643_PCA_OPTION
    fprintf( stdout, "-pca                : activate PCA in SBA format FOA at 256 kbps \n" );
#else
    fprintf( stdout, "-bypass mode        : SBA PCA by-pass, mode = (1, 2), 1 = PCA off, 2 = signal adaptive, default is 1\n" );
#endif
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
#ifdef DEBUGGING
+0 −20
Original line number Diff line number Diff line
@@ -1795,7 +1795,6 @@ int main(
                exit( -1 );
            }

#ifdef NONBE_FIX_225_MASA_EXT_REND
            if ( isCurrentFrameMultipleOf20ms )
            {
                if ( masaReaders[i] != NULL )
@@ -1814,19 +1813,6 @@ int main(
                    }
                }
            }
#else
            if ( masaReaders[i] != NULL )
            {
                /* This will update data in hMasaMetadata[i] */
                MasaFileReader_readNextFrame( masaReaders[i] );

                if ( ( error = IVAS_REND_FeedInputMasaMetadata( hIvasRend, masaIds[i], hMasaMetadata[i] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) );
                    exit( -1 );
                }
            }
#endif
        }


@@ -2531,13 +2517,7 @@ static IVAS_AUDIO_CONFIG parseAudioConfig(
        switch ( charBuf[4] )
        {
            case '1':
#ifdef NONBE_FIX_225_MASA_EXT_REND
                return IVAS_AUDIO_CONFIG_MASA1;
#else
                fprintf( stderr, "1TC MASA support is not functional and is pending on DirAC renderer refactoring.\n" );
                exit( EXIT_FAILURE );
                /*return IVAS_AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings
#endif
            case '2':
                return IVAS_AUDIO_CONFIG_MASA2;
            default:
+0 −5
Original line number Diff line number Diff line
@@ -199,9 +199,7 @@ ivas_error pre_proc_front_ivas(
    const int16_t force_front_vad,                              /* i  : flag to force VAD decision                 */
    const int16_t front_vad_dtx_flag,                           /* i  : front-VAD DTX flag to overwrite VAD decision*/
    const IVAS_FORMAT ivas_format,                              /* i  : IVAS format                                */
#ifdef NONBE_FIX_788_SBA_DTX_BR_SWITCHING
    const int16_t MCT_flag, /* i  : hMCT handle allocated (1) or not (0)    */
#endif
    const int32_t ivas_total_brate                              /* i  : IVAS total bitrate                         */
);

@@ -1941,9 +1939,6 @@ void stereo_icBWE_decproc(
int16_t select_stereo_mode(
    CPE_ENC_HANDLE hCPE,                                        /* i/o: CPE encoder structure                           */
    const IVAS_FORMAT ivas_format                               /* i  : IVAS format                                     */
#ifndef NONBE_FIX_874_OMASA_BRSW_2TD
   ,const int32_t ivas_total_brate                              /* i  : IVAS total brate                                */
    #endif
);

void stereo_classifier_init(
+0 −12
Original line number Diff line number Diff line
@@ -307,19 +307,8 @@ void tdm_bit_alloc(
    else
    {
        *total_brate_sec = min( *total_brate_sec, element_brate_wo_meta - ( 5900 + BWE_brate ) );
#ifndef NONBE_FIX_874_OMASA_BRSW_2TD
        if ( coder_type == INACTIVE )
        {
            *total_brate_sec = max( *total_brate_sec, tdm_bit_allc_tbl[0][0] ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
        }
        else
        {
            *total_brate_sec = max( *total_brate_sec, 3500 ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
        }
#endif
    }

#ifdef NONBE_FIX_874_OMASA_BRSW_2TD
    if ( coder_type == INACTIVE )
    {
        *total_brate_sec = max( *total_brate_sec, tdm_bit_allc_tbl[0][0] ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
@@ -328,7 +317,6 @@ void tdm_bit_alloc(
    {
        *total_brate_sec = max( *total_brate_sec, 3500 ); /* sanity check to ensure the secondary channel always gets the minimal bitrate it needs */
    }
#endif

    /* Secondary channel bitrate adjusment                                                      */
    /* First, adjust the bitrate depending of what is transmitted                               */
Loading