Commit 8ba6150f authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into basop-2442-masa-2tc-rendering-to-mono-large-diff-signal-12-khz
parents b69ec432 91dbe989
Loading
Loading
Loading
Loading
Loading
+95 −0
Original line number Diff line number Diff line
@@ -498,6 +498,7 @@ int main(
        }
    }

#ifndef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT
#ifdef DEBUGGING
    /*-----------------------------------------------------------------*
     * Preview bitstream and print config information
@@ -587,6 +588,7 @@ int main(
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }
#endif
#endif

    /*-------------------------------------------------------------------*
@@ -777,6 +779,99 @@ int main(
        hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID;
    }

#ifdef FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT
#ifdef DEBUGGING
    /*-----------------------------------------------------------------*
     * Preview bitstream and print config information
     *-----------------------------------------------------------------*/

    if ( arg.voipMode )
    {
        if ( ( error = printBitstreamInfoVoip( arg, hBsReader, hIvasDec ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Error while previewing VoIP bitstream: %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
    }
    else
    {
        uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8];
        int16_t num_bits;
        int16_t bfi = 0;
        do
        {
            if ( BS_Reader_ReadFrame_short( hBsReader, bit_stream, &num_bits, &bfi ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename );
                goto cleanup;
            }
        } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 );

        BS_Reader_Rewind( hBsReader );

        IVAS_DEC_PrintConfigWithBitstream( hIvasDec, arg.quietModeEnabled, bit_stream, num_bits );

#ifdef VARIABLE_SPEED_DECODING
        if ( arg.tsmEnabled )
        {
            if ( arg.tsmScaleFileEnabled )
            {
                fprintf( stdout, "Variable speed file:    %s\n", arg.tsmScaleFileName );
            }
            else
            {
                fprintf( stdout, "Variable speed factor:  %i\n", arg.tsmScale );
            }
        }
#endif
    }

    /*-----------------------------------------------------------------*
     * Open Error pattern file for simulation
     *-----------------------------------------------------------------*/

    if ( arg.FEPatternFileName != NULL )
    {
        if ( ( FEC_pattern = fopen( arg.FEPatternFileName, "rb" ) ) == NULL )
        {
            fprintf( stderr, "Error: Missing or incorrect FEC filename specification\n\n" );
            usage_dec();
            goto cleanup;
        }
    }

#ifdef DEBUG_SBA_AUDIO_DUMP
    ivas_open_sba_decoder_debug_files( arg.output_Fs, 1, 1 );
#endif

    /*-----------------------------------------------------------------*
     * Print information about FEC
     *-----------------------------------------------------------------*/

    if ( !arg.voipMode && ( arg.FEPatternFileName != NULL || arg.FER > 0 ) )
    {
        if ( arg.FEPatternFileName != NULL )
        {
            fprintf( stdout, "FEC:                    %s\n", arg.FEPatternFileName );
        }
        else
        {
            fprintf( stdout, "FEC:                    %.2f %%\n", arg.FER );
        }
    }
#else
    /*-----------------------------------------------------------------*
     * Print config information
     *-----------------------------------------------------------------*/

    if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }
#endif
#endif

    /*------------------------------------------------------------------------------------------*
     * Allocate output data buffer
     *------------------------------------------------------------------------------------------*/
+1 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@
#define FIX_1585_ASAN_FORMAT_SW_ALT                     /* VA,FhG: float issues 1585,1593: alternative fix memory leaks with format switching */
#define FIX_2570_BUF_OVFL                               /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */
#define FIX_1594_TDM_LAST_RATIO                         /* VA: float issue 1594: remove obsolete argument 'tdm_last_ratio' from stereo_memory_enc () */
#define FIX_1550_WRONG_RENDER_FRAMESIZE_PRINTOUT        /* Dolby: float issue 1550: Wrong render framesize printout */

/* #################### End BE switches ################################## */