Commit 10834a17 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files
Merge branch 'main' of ssh://forge.3gpp.org:29419/ivas-codec-pc/ivas-codec into external-renderer-delay-alignment
parents 6869f126 ea0d9cd2
Loading
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@
#define IVAS_MAX16B_FLT 32767.0f
#define IVAS_MIN16B_FLT ( -32768.0f )

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
#define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f )
#endif

#if !defined( DEBUGGING ) && !defined( WMOPS )
static
#endif
@@ -1160,20 +1164,39 @@ int main(
        }
    }

#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
    /* Set the total number of objects */
#endif
    if ( args.inConfig.numAudioObjects > 0 )
    {
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
        /* Set the total number of objects */
#endif
        if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }

#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS
        /* Set the metadata delay for objects */
#endif
        if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) );
            goto cleanup;
        }
#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS

        /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */
        if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL )
        {
            for ( i = 0; i < args.inConfig.numAudioObjects; ++i )
            {
                args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB;
            }
        }
#endif
    }

    IVAS_REND_LfePanMtx lfePanMatrix;
+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@
#define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */
#define NONBE_1339_FIXOSBA_EXT_LOUDNESS                 /* FhG: issue 1339: apply scaling with EXT output in OSBA high-BR mode */
#define NONBE_1352_HARMONIZE_OSBA_LOUDNESS             /* FhG: do not scale OSBA inputs by 0.5 any more */
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */

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

+3 −1
Original line number Diff line number Diff line
@@ -1743,9 +1743,11 @@ int16_t is_numeric_float(
    float x )
{
#ifdef CODE_IMPROVEMENTS
    int16_t retval;
#define WMC_TOOL_SKIP
    return (int16_t) ( !isnan( x ) && !isinf( x ) );
    retval = (int16_t) ( !isnan( x ) && !isinf( x ) );
#undef WMC_TOOL_SKIP
    return retval;
#else
#ifndef BASOP_NOGLOB
    union float_int
+29 −0
Original line number Diff line number Diff line
@@ -489,6 +489,13 @@ static void ivas_omasa_dmx(
    }

    for ( i = 0; i < nchan_ism; i++ )
    {
#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING
        if ( nchan_transport == 1 )
        {
            v_add( data_out_f[0], data_in_f[i], data_out_f[0], input_frame );
        }
        else
        {
            azimuth = ism_azimuth[i];
            elevation = ism_elevation[i];
@@ -510,6 +517,28 @@ static void ivas_omasa_dmx(
                prev_gains[i][j] = gains[j];
            }
        }
#else
        azimuth = ism_azimuth[i];
        elevation = ism_elevation[i];

        ivas_ism_get_stereo_gains( azimuth, elevation, &gains[0], &gains[1] );

        /* Downmix using the panning gains */
        for ( j = 0; j < nchan_transport; j++ )
        {
            if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0f )
            {
                for ( k = 0; k < input_frame; k++ )
                {
                    g1 = interpolator[k];
                    g2 = 1.0f - g1;
                    data_out_f[j][k] += ( g1 * gains[j] + g2 * prev_gains[i][j] ) * data_in_f[i][k];
                }
            }
            prev_gains[i][j] = gains[j];
        }
#endif
    }

    for ( i = 0; i < nchan_transport; i++ )
    {
+7 −3
Original line number Diff line number Diff line
@@ -3598,11 +3598,15 @@ static void *getInputByIndex(
        case IVAS_REND_AUDIO_CONFIG_TYPE_MASA:
            return (input_masa *) inputsArray + index;
        default:
            break;
    }

    /* this should be unreachable */
    assert( 0 );

    /* include a final return to make the linter happy and avoid problems with wmc_tool (see #1355) */
    return NULL;
}
}
#endif

static ivas_error findFreeInputSlot(