Commit d88b361c authored by norvell's avatar norvell
Browse files

Merge with main and update name of macro

parents 658c4ce1 bb76a1ab
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1818,7 +1818,7 @@ ltv-usan:
    - ivas-linux-fast
  artifacts:
    name: "$CI_JOB_NAME--main--sha-$CI_COMMIT_SHORT_SHA"
    expire_in: 4 weeks
    expire_in: 7 weeks
    when: always
    paths:
      - ep_015.g192
+68 −1
Original line number Diff line number Diff line
@@ -445,8 +445,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;
@@ -750,6 +756,13 @@ 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
@@ -1051,18 +1064,30 @@ 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++;
        }
@@ -1212,6 +1237,10 @@ 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;
                }

@@ -1793,6 +1822,7 @@ static ivas_error initOnFirstGoodFrame(
        return error;
    }

#ifndef LIB_DEC_REVISION
    int32_t pcmFrameSize;

    if ( ( error = IVAS_DEC_GetPcmFrameSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK )
@@ -1800,7 +1830,7 @@ static ivas_error initOnFirstGoodFrame(
        fprintf( stderr, "\nError in IVAS_DEC_GetPcmFrameSize, error code: %d\n", error );
        return error;
    }

#endif
    if ( isSplitRend )
    {
        /* Open split rendering metadata writer */
@@ -1858,7 +1888,23 @@ static ivas_error initOnFirstGoodFrame(
        }
    }

#ifdef LIB_DEC_REVISION
    int16_t pcmFrameSize;
    if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_GetOutputBufferSize, error code: %d\n", error );
        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 )
@@ -2072,6 +2118,19 @@ static ivas_error decodeG192(
    SplitFileReadWrite *splitRendWriter = NULL;
    int16_t isSplitRend, isSplitCoded;

#ifdef VARIABLE_SPEED_DECODING
#ifdef LIB_DEC_REVISION
    if ( arg.tsmEnabled )
    {
        if ( ( error = IVAS_DEC_EnableTsm( hIvasDec ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_DEC_EnableTsm, code: %d\n", error );
            return error;
        }
    }

#endif
#endif
    if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error );
@@ -3386,7 +3445,12 @@ 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;
            }

@@ -3398,6 +3462,9 @@ 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;
                }
            }
+13 −0
Original line number Diff line number Diff line
@@ -806,8 +806,12 @@ 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(
@@ -5804,6 +5808,15 @@ 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                     */
    const uint16_t nSamplesAsked,                               /* i  : number of samples requested             */
+4 −1
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@

/*#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 ################################## */
@@ -174,7 +175,9 @@
#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_1300_TDREND_JBM_SHORT_FRAMES              /* Eri: issue 1300: The JBM operates on 1.25 ms granularity, compatible with CLDFB. The TD renderer needs adaptations to handle such short frames. */
#define NONBE_1300_TDREND_LARGE_ITD                     /* Eri: issue 1300: There was a bug feeding 1.25 ms frames to the TD renderer, causing out-of-buffer access. This was resolved. However, it is still possible that modeled HRTF with large ITDs could trigger out-of-buffer access. This adds a check to prevent this.*/
#define NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT               /* Nokia: issue 1305: Fix OMASA ext output in case of object editing */


/* ##################### End NON-BE switches ########################### */

+26 −0
Original line number Diff line number Diff line
@@ -66,8 +66,12 @@ static void ivas_jbm_masa_sf_to_slot_map( Decoder_Struct *st_ivas, const int16_t
 *--------------------------------------------------------------------------*/

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  : transport channel signals      */
#endif
)
{
    int16_t n, output_frame, nchan_out;
@@ -727,11 +731,16 @@ ivas_error ivas_jbm_dec_tc(
     * Write IVAS transport channels
     *----------------------------------------------------------------*/

#ifdef LIB_DEC_REVISION
    if ( st_ivas->hDecoderConfig->Opt_tsm == 0 )
#else
    if ( st_ivas->hDecoderConfig->Opt_tsm == 1 )
    {

        ivas_syn_output_f( p_output, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data );
    }
    else
#endif
    {
        /* directly copy to tc buffers */
        ivas_jbm_dec_copy_tc_no_tsm( st_ivas, p_output, output_frame );
@@ -2876,6 +2885,13 @@ void ivas_dec_prepare_renderer(
        {
            ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
        }
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
        /* MASA transport gaining for edited disc OMASA EXT. For ISMs, only metadata is modified */
        if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasaIsmData->masa_gain_is_edited == 1 )
        {
            ivas_omasa_gain_masa_tc( st_ivas->hTcBuffer->tc, st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->nchan_ism, st_ivas->hTcBuffer->n_samples_available );
        }
#endif
    }
    else if ( st_ivas->ivas_format == STEREO_FORMAT )
    {
@@ -2951,6 +2967,16 @@ void ivas_dec_prepare_renderer(
            {
                ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
            }
#ifdef NONBE_FIX_1305_OMASA_OBJ_EDIT_EXT
            /* MASA transport gaining for edited param_one OMASA EXT. For ISMs, only metadata is modified.  */
            if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->hMasaIsmData->masa_gain_is_edited == 1 )
            {
                for ( n = 0; n < CPE_CHANNELS; n++ )
                {
                    v_multc( st_ivas->hTcBuffer->tc[n], st_ivas->hMasaIsmData->gain_masa_edited, st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available );
                }
            }
#endif
        }
        else
        {
Loading