Commit 3b963946 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 1217-enable-object-edit-tests

parents 90f0a2bd 162fd3a2
Loading
Loading
Loading
Loading
Loading
+40 −31
Original line number Diff line number Diff line
@@ -202,11 +202,7 @@ static int16_t app_own_random( int16_t *seed );
static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar );
#endif
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, const int16_t num_subframes, ObjectEditFileReader *objectEditFileReader );
#else
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader );
#endif
#else
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters );
#endif
@@ -2003,7 +1999,22 @@ static ivas_error initOnFirstGoodFrame(
            if ( numInitialBadFrames > 0 )
            {
                /* Duplicate good first frame metadata to fill the beginning of stream. */
#ifdef NONBE_FIX_1261_MASA_EXT_META_JBM
                int16_t fullDelayNumSamplesLocal[3];
                int32_t delayTimeScaleLocal;
                float delayMs;
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                hMasaExtOutMeta = NULL;

                /* fullDelayNumSamples is zeroed so need to re-fetch delay info */
                if ( ( error = IVAS_DEC_GetDelay( hIvasDec, fullDelayNumSamplesLocal, &delayTimeScaleLocal ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
                delayMs = (float) ( fullDelayNumSamplesLocal[0] ) / (float) ( delayTimeScaleLocal );
#else
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL;
#endif

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
@@ -2013,7 +2024,9 @@ static ivas_error initOnFirstGoodFrame(

                for ( int16_t j = 0; j < numInitialBadFrames; ++j )
                {
#ifndef NONBE_FIX_1261_MASA_EXT_META_JBM
                    float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale );
#endif
                    if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) );
@@ -2475,11 +2488,7 @@ static ivas_error decodeG192(

                    /* Do object metadata editing here ... */
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
                    do_object_editing( &editableParameters, num_subframes, objectEditFileReader );
#else
                    do_object_editing( &editableParameters, objectEditFileReader );
#endif
#else
                    do_object_editing( &editableParameters );
#endif
@@ -3288,20 +3297,17 @@ static ivas_error decodeVoIP(
        }

#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
        if ( arg.objEditEnabled && ( arg.objEditFileName != NULL ) )
        {
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
            if ( frame * num_subframes % IVAS_MAX_PARAM_SPATIAL_SUBFRAMES == 0 )
            {
        if ( arg.objEditEnabled && arg.objEditFileName != NULL && vec_pos_update == 0 )
#else
        if ( arg.objEditEnabled && ( arg.objEditFileName != NULL ) )
#endif
        {
            if ( ( error = ObjectEditFileReader_readNextFrame( objectEditFileReader ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError: could not read object editing instructions from file: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                return error;
            }
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
            }
#endif
        }
#endif

@@ -3406,11 +3412,7 @@ static ivas_error decodeVoIP(

                /* Do object metadata editing here ... */
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
                do_object_editing( &editableParameters, num_subframes, objectEditFileReader );
#else
                do_object_editing( &editableParameters, objectEditFileReader );
#endif
#else
                do_object_editing( &editableParameters );
#endif
@@ -3541,17 +3543,32 @@ static ivas_error decodeVoIP(
            }
        }

#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#else
        if ( !arg.quietModeEnabled )
        {
            fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        frame++;
#endif
        if ( vec_pos_update == 0 )
        {
            systemTime_ms += vec_pos_len * systemTimeInc_ms;
        }

#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
        if ( vec_pos_update == 0 )
        {
            frame++;
            if ( !arg.quietModeEnabled )
            {
                fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
            }
        }
#endif

#ifdef WMOPS
        update_mem();
        update_wmops();
@@ -3715,9 +3732,6 @@ cleanup:
static void do_object_editing(
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
    IVAS_EDITABLE_PARAMETERS *editableParameters,
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
    const int16_t num_subframes,
#endif
    ObjectEditFileReader *objectEditFileReader )
#else
    IVAS_EDITABLE_PARAMETERS *editableParameters )
@@ -3816,12 +3830,7 @@ static void do_object_editing(
        /* breakover object gains */
        for ( obj_idx = 0; obj_idx < editableParameters->num_obj; obj_idx++ )
        {
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
            editableParameters->ism_metadata[obj_idx].gain = 0.5f + (float) ( ( ( frame * num_subframes / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) + obj_idx * 50 ) % 250 ) / 250.0f;

#else
            editableParameters->ism_metadata[obj_idx].gain = 0.5f + (float) ( ( frame + obj_idx * 50 ) % 250 ) / 250.0f;
#endif
        }

        editableParameters->gain_bed = 0.5f;
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ SUBPAGE_TMPL_CSS = """
.tbase .tleft{text-align:left;horizontal-align:bottom}
.tbase .tincrease{text-align:left;background-color:#ff5500;border-color:inherit;font-weight:bold;}
.tbase .treduce{text-align:left;background-color:#acff00;border-color:inherit;font-weight:bold;}

thead {position:sticky;top:0;background-color:#ffffffd0}
.arrowup {font-weight:bold;font-size:200%;}
.arrowdown {font-weight:bold;font-size:200%;}
</style>
+3 −1
Original line number Diff line number Diff line
@@ -172,7 +172,9 @@
#define NONBE_1217_OBJ_EDIT_FOA                         /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */
#define NONBE_1215_FIX_JBM_MAX_SCALING                  /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */
#define NONBE_FIX_1255_OBJ_EDIT_JBM                     /* VA: issue 1255: restore object editing in JBM */

#define NONBE_FIX_1189_GSC_IVAS_OMASA                   /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */
#define NONBE_1214_PLC_LSF_MEMORY                       /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */
#define NONBE_FIX_1261_MASA_EXT_META_JBM                /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */

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

+4 −0
Original line number Diff line number Diff line
@@ -483,7 +483,11 @@ ivas_error acelp_core_dec(

        if ( st->element_mode > EVS_MONO && st->idchan == 0 && !( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) && !tdm_low_rate_mode )
        {
#ifdef NONBE_FIX_1189_GSC_IVAS_OMASA
            if ( st->coder_type == AUDIO || ( st->coder_type == INACTIVE && st->inactive_coder_type_flag ) )
#else
            if ( st->coder_type == AUDIO || ( st->coder_type == INACTIVE && st->total_brate <= MAX_GSC_INACTIVE_BRATE ) )
#endif
            {
                st->GSC_IVAS_mode = get_next_indice( st, 2 );
            }
+6 −0
Original line number Diff line number Diff line
@@ -263,8 +263,14 @@ ivas_error core_switching_pre_dec(
        st->uv_count = 0;
    }

#ifdef NONBE_1214_PLC_LSF_MEMORY
    if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ ||
         ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) ||
         ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ )
#else
    if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 &&
                                                                                                    st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) )
#endif
    {
        if ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD )
        {
Loading