Commit 4516ec22 authored by vaclav's avatar vaclav
Browse files
parents 173041d2 b1e5cf91
Loading
Loading
Loading
Loading
+1 −43
Original line number Diff line number Diff line
@@ -433,18 +433,14 @@ 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, 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,
                                       arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -744,13 +740,11 @@ int main(
    }

    pcmBuf = malloc( pcmBufSize * sizeof( int16_t ) );
#ifdef LIB_DEC_REVISION
    if ( pcmBuf == NULL )
    {
        fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" );
        goto cleanup;
    }
#endif

    /*-----------------------------------------------------------------*
     * Decoding
@@ -1056,30 +1050,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++;
        }
@@ -1229,10 +1211,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;
                }

@@ -1814,15 +1794,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 */
@@ -1880,7 +1851,6 @@ static ivas_error initOnFirstGoodFrame(
        }
    }

#ifdef LIB_DEC_REVISION
    int16_t pcmFrameSize;
    if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK )
    {
@@ -1888,15 +1858,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 )
@@ -2111,7 +2078,6 @@ static ivas_error decodeG192(
    int16_t isSplitRend, isSplitCoded;

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

#endif
#endif
    if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK )
    {
@@ -3437,12 +3402,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;
            }

@@ -3454,9 +3414,7 @@ static ivas_error decodeVoIP(
                if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, NULL, 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;
                }
            }
+3 −19
Original line number Diff line number Diff line
@@ -985,9 +985,7 @@ int main(

    while ( 1 )
    {
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        int16_t bfi = 0;
#endif
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;

@@ -995,12 +993,10 @@ int main(
        if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame )
        {
            ivas_error error_tmp;

            numSamplesRead = (int16_t) inBufferSize;
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST

            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bfi );
#else
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten );
#endif
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1067,24 +1063,13 @@ int main(
        /* Read from split renderer bfi file if specified */
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        {
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            int16_t bfi;
#endif
            if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }

#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                exit( -1 );
            }
#endif
        }
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST

        if ( splitBinNeedsNewFrame )
        {
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
@@ -1093,7 +1078,6 @@ int main(
                goto cleanup;
            }
        }
#endif

        for ( i = 0; i < args.inConfig.numBinBuses; ++i )
        {
+1 −17
Original line number Diff line number Diff line
@@ -656,13 +656,11 @@ void ivas_renderer_select(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);

#ifdef NONBE_1303_REND_GRANULARITY
/*! r: secondary binaural renderer type */
RENDERER_TYPE ivas_renderer_secondary_select(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);

#endif
ivas_error ivas_mc_enc_config(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
@@ -806,12 +804,7 @@ void ivas_apply_non_diegetic_panning(
 *----------------------------------------------------------------------------------*/

ivas_error ivas_jbm_dec_tc(
#ifdef LIB_DEC_REVISION
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                                      */
#else
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    float *data                                                 /* o  : output synthesis signals                                    */
#endif
);

ivas_error ivas_jbm_dec_render(
@@ -896,16 +889,9 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode(

/*! r: render granularity */
int16_t ivas_jbm_dec_get_render_granularity(
#ifdef NONBE_1303_REND_GRANULARITY
    const RENDERER_TYPE renderer_type,                          /* i  : renderer type                                               */
    const RENDERER_TYPE renderer_type_sec,                      /* i  : secondary renderer type                                     */
    const int32_t output_Fs                                     /* i  : sampling rate                                               */
#else
    const RENDERER_TYPE rendererType, /* i  : renderer type     */
    const IVAS_FORMAT ivas_format,    /* i  : ivas format */
    const MC_MODE mc_mode,            /* i  : MC mode */
    const int32_t output_Fs           /* i  : sampling rate     */
#endif
);

ivas_error ivas_jbm_dec_tc_buffer_open(
@@ -5808,14 +5794,12 @@ void ivas_omasa_render_objects_from_mix(
    const int16_t output_frame                                  /* i  : output frame length per channel        */
);

#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
void ivas_omasa_gain_masa_tc(
    float *output[],                                            /* i/o: output synthesis signal                 */
    const float gainMasa,                                       /* i  : gain for MASA transport channels        */
    const int16_t nchan_transport_ism,                          /* i  : number of ISM TCs                       */
    const int16_t output_frame                                  /* i  : output frame length per channel         */
);
#endif

void ivas_omasa_dirac_rend_jbm(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                     */
+0 −5
Original line number Diff line number Diff line
@@ -160,7 +160,6 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define LIB_DEC_REVISION                                /* VA: cleaning and simplification of lib_dec.c */


/* #################### End BE switches ################################## */
@@ -171,11 +170,7 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ 
#define NONBE_1293_CRASH_FIRST_FRAME_LOST               /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_1118_EVS_LR_HQ_BITERROR                   /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */
#define NONBE_1303_REND_GRANULARITY                     /* VA: issue 1303: Renderer granularity revision */
#define NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT               /* Nokia: issue 1305: Fix OMASA ext output in case of object editing */


/* ##################### End NON-BE switches ########################### */
+0 −4
Original line number Diff line number Diff line
@@ -635,7 +635,6 @@ void hq_lr_dec(

            IF( sub( i, highband ) >= 0 )
            {
#ifdef NONBE_1118_EVS_LR_HQ_BITERROR
                /* safety check in case of bit errors */
                if ( Ep_fx[i] > 536788991 /* max(Q30) */ )
                {
@@ -644,12 +643,10 @@ void hq_lr_dec(
                    return;
                }

#endif
                enerH_fx = L_add( enerH_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */
            }
            ELSE IF( sub( i, lowband ) >= 0 )
            {
#ifdef NONBE_1118_EVS_LR_HQ_BITERROR
                /* safety check in case of bit errors */
                if ( Ep_fx[i] > 536788991 /* max(Q30) */ )
                {
@@ -658,7 +655,6 @@ void hq_lr_dec(
                    return;
                }

#endif
                enerL_fx = L_add( enerL_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */
            }
        }
Loading