Commit 2977d4d7 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[cleanup] accept LIB_DEC_REVISION

parent 5eca250c
Loading
Loading
Loading
Loading
+0 −44
Original line number Diff line number Diff line
@@ -406,14 +406,9 @@ int main(
    asked_frame_size = arg.renderFramesize;
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;

#ifdef LIB_DEC_REVISION
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled,
                                       arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled,
                                       arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx,
                                       arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -908,30 +903,18 @@ static bool parseCmdlIVAS_dec(

        if ( strcmp( argv_to_upper, "-VOIP" ) == 0 )
        {
#ifdef LIB_DEC_REVISION
            arg->voipMode = true;
#else
            arg->voipMode = 1;
#endif
            i++;
        }
        else if ( strcmp( argv_to_upper, "-VOIP_HF_ONLY=0" ) == 0 )
        {
#ifdef LIB_DEC_REVISION
            arg->voipMode = true;
#else
            arg->voipMode = 1;
#endif
            arg->inputFormat = IVAS_DEC_INPUT_FORMAT_RTPDUMP;
            i++;
        }
        else if ( strcmp( argv_to_upper, "-VOIP_HF_ONLY=1" ) == 0 )
        {
#ifdef LIB_DEC_REVISION
            arg->voipMode = true;
#else
            arg->voipMode = 1;
#endif
            arg->inputFormat = IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF;
            i++;
        }
@@ -1012,10 +995,8 @@ static bool parseCmdlIVAS_dec(
            {
                if ( !is_digits_only( argv[i] ) )
                {
#ifdef LIB_DEC_REVISION
                    fprintf( stderr, "Error: Render frame size is invalid or not specified!\n\n" );
                    usage_dec();
#endif

                    return false;
                }
@@ -1633,15 +1614,6 @@ static ivas_error initOnFirstGoodFrame(
        return error;
    }

#ifndef LIB_DEC_REVISION
    int32_t pcmFrameSize;

    if ( ( error = IVAS_DEC_GetPcmFrameSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_GetPcmFrameSize, error code: %d\n", error );
        return error;
    }
#endif
    if ( isSplitRend )
    {
        /* Open split rendering metadata writer */
@@ -1699,7 +1671,6 @@ static ivas_error initOnFirstGoodFrame(
        }
    }

#ifdef LIB_DEC_REVISION
    int16_t pcmFrameSize;
    if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK )
    {
@@ -1707,15 +1678,12 @@ static ivas_error initOnFirstGoodFrame(
        return error;
    }

#endif
    int16_t *zeroBuf = malloc( pcmFrameSize * sizeof( int16_t ) );
#ifdef LIB_DEC_REVISION
    if ( zeroBuf == NULL )
    {
        fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" );
        return IVAS_ERR_FAILED_ALLOC;
    }
#endif
    memset( zeroBuf, 0, pcmFrameSize * sizeof( int16_t ) );

    for ( int16_t i = 0; i < numInitialBadFrames; ++i )
@@ -1922,7 +1890,6 @@ static ivas_error decodeG192(
    RenderConfigReader *renderConfigReader = NULL;

#ifdef VARIABLE_SPEED_DECODING
#ifdef LIB_DEC_REVISION
    if ( arg.tsmEnabled )
    {
        if ( ( error = IVAS_DEC_EnableTsm( hIvasDec ) ) != IVAS_ERR_OK )
@@ -1932,7 +1899,6 @@ static ivas_error decodeG192(
        }
    }

#endif
#endif
    if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK )
    {
@@ -2258,11 +2224,7 @@ static ivas_error decodeG192(
            }
            else
            {
#ifdef LIB_DEC_REVISION
                if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetSamplesRenderer(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
@@ -2301,9 +2263,7 @@ static ivas_error decodeG192(
            {
                if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK )
                {
#ifdef LIB_DEC_REVISION
                    fprintf( stderr, "Error in initOnFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
#endif
                    goto cleanup;
                }
            }
@@ -3070,11 +3030,7 @@ static ivas_error decodeVoIP(
        {
            if ( ( error = IVAS_DEC_HasDecodedFirstGoodFrame( hIvasDec, &decodedGoodFrame ) ) != IVAS_ERR_OK )
            {
#ifdef LIB_DEC_REVISION
                fprintf( stderr, "Error in IVAS_DEC_HasDecodedFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
#else
                fprintf( stderr, "Error in IVAS_DEC_HasDecodedFirstGoodFrame, code: %d\n", error );
#endif
                goto cleanup;
            }

+0 −4
Original line number Diff line number Diff line
@@ -4222,10 +4222,6 @@ Word64 var_32_fx(

ivas_error ivas_jbm_dec_tc_fx(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                      */
#ifndef LIB_DEC_REVISION
    ,
    Word32 *data_fx 
#endif
);

ivas_error ivas_jbm_dec_flush_renderer_fx(
+0 −1
Original line number Diff line number Diff line
@@ -109,7 +109,6 @@
#define FIX_1384_MSAN_ivas_spar_dec_open                /* VA: issue 1386: fix use-of-uninitialized value in ivas_spar_dec_open() */
#define FIX_1388_MSAN_ivas_init_decoder                 /* VA: issue 1388: fix use-of-uninitialized value in ivas_init_decoder() */
#define FIX_1288_SPLIT_REND_XSAN                        /* Dlb: Fix asan, msan and usan issues in split rendering mode*/
#define LIB_DEC_REVISION                                /* VA: cleaning and simplification of lib_dec.c */
#define UNIFIED_DECODING_PATHS_LEFTOVERS                /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */
#define FIX_NCHAN_BUFFERS                               /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */
#define FIX_RENDERER_STACK                              /* VA: issue 1322: reduction of renderers' buffers size */
+0 −12
Original line number Diff line number Diff line
@@ -82,10 +82,6 @@ static Word16 ceil_fx16(

ivas_error ivas_jbm_dec_tc_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure         */
#ifndef LIB_DEC_REVISION
    ,
    Word32 *data_fx /*Q11*/
#endif
)
{
    Word16 ch, n, output_frame, nchan_out, i, ii;
@@ -1487,15 +1483,7 @@ ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
 * Write IVAS transport channels
 *----------------------------------------------------------------*/

#ifdef LIB_DEC_REVISION
IF( st_ivas->hDecoderConfig->Opt_tsm == 0 )
#else
IF( EQ_16( st_ivas->hDecoderConfig->Opt_tsm, 1 ) )
{
    ivas_syn_output_f_fx( p_output_fx, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data_fx );
}
ELSE
#endif
{
    /* directly copy to tc buffers */
    /*note : the q of cldfb buffers (imag/real) are needed to be Q_p_output - 5 here 6 is taken for that*/
+0 −16
Original line number Diff line number Diff line
@@ -111,9 +111,6 @@ ivas_error IVAS_DEC_Configure(
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
    const UWord32 sampleRate,                               /* i  : output sampling frequency                                               */
    const IVAS_AUDIO_CONFIG outputConfig,                   /* i  : output configuration                                                    */
#ifndef LIB_DEC_REVISION
    const bool tsmEnabled,                                  /* i  : enable time scale modification                                          */
    #endif
    const IVAS_RENDER_FRAMESIZE renderFramesize,            /* i  : rendering frame size                                                    */
    const bool customLsOutputEnabled,                       /* i  : enable custom loudspeaker setup handle                                  */
    const bool hrtfReaderEnabled,                           /* i  : enable HRTF binary file input                                           */
@@ -158,11 +155,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder(
);

/*! r: decoder error code */
#ifdef LIB_DEC_REVISION
ivas_error IVAS_DEC_GetSamplesRenderer(
#else
ivas_error IVAS_DEC_GetSamples(
#endif
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
    const Word16 nSamplesAsked,                             /* i  : number of samples wanted by the caller                                  */
    Word16 *pcmBuf,                                         /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels Q0 */
@@ -287,11 +280,9 @@ ivas_error IVAS_DEC_VoIP_SetScale(
);

#ifdef VARIABLE_SPEED_DECODING
#ifdef LIB_DEC_REVISION
ivas_error IVAS_DEC_EnableTsm(
    IVAS_DEC_HANDLE hIvasDec                    /* i/o: IVAS decoder handle                                                     */
);
#endif

ivas_error IVAS_DEC_TSM_SetQuality(
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
@@ -465,13 +456,6 @@ ivas_error IVAS_DEC_HasDecodedFirstGoodFrame(
    bool *hasDecodedFirstGoodFrame                          /* o  : flag indicating if the decoder has decoded a good frame since it was configured */
);

#ifndef LIB_DEC_REVISION
/*! r: error code */
ivas_error IVAS_DEC_GetPcmFrameSize(
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
    Word32 *pcmFrameSize                                    /* o  : total size of the PCM output frame. This takes into account the number of output channels Q0 */
);
#endif
/*! r: true if decoder has no data in VoIP jitter buffer */
bool IVAS_DEC_VoIP_IsEmpty(
    IVAS_DEC_HANDLE hIvasDec,                               /* i/o: IVAS decoder handle                                                     */
Loading