Commit fe6bb5cc authored by vaclav's avatar vaclav
Browse files

Merge branch 'main' into discISM_DTX

parents cba58af8 8a1e7a57
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -1295,6 +1295,22 @@ static ivas_error initOnFirstGoodFrame(
    ivas_error error = IVAS_ERR_UNKNOWN;

    /* Now delay, number of output channels and frame size are known */
#ifdef FIX_371_DELAY_REPORT
    if ( ( error = IVAS_DEC_GetDelay( hIvasDec, pFullDelayNumSamples, delayTimeScale ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
        return error;
    }

    if ( !arg.delayCompensationEnabled )
    {
#ifdef BINAURALIZATION_DELAY_REPORT
        pFullDelayNumSamples[0] = 0;
#else
        *pFullDelayNumSamples = 0;
#endif
    }
#else
    if ( arg.delayCompensationEnabled )
    {
        if ( ( error = IVAS_DEC_GetDelay( hIvasDec, pFullDelayNumSamples, delayTimeScale ) ) != IVAS_ERR_OK )
@@ -1311,6 +1327,7 @@ static ivas_error initOnFirstGoodFrame(
        *pFullDelayNumSamples = 0;
#endif
    }
#endif
#ifdef BINAURALIZATION_DELAY_REPORT
    *pRemainingDelayNumSamples = pFullDelayNumSamples[0];
#else
@@ -1813,7 +1830,11 @@ static ivas_error decodeG192(
        if ( delayNumSamples_orig[2] > 0 )
        {
            printf( "HRIR/BRIR delay:        %4.2f ms   (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[2] / (float) delayTimeScale, delayNumSamples_orig[2], delayTimeScale );
#ifdef FIX_371_DELAY_REPORT
            printf( "Total delay:            %4.2f ms   (%3u samples at timescale %5u)\n", 1000.f * ( delayNumSamples_orig[1] + delayNumSamples_orig[2] ) / (float) delayTimeScale, delayNumSamples_orig[1] + delayNumSamples_orig[2], delayTimeScale );
#else
            printf( "Total delay:            %4.2f ms   (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[0] / (float) delayTimeScale, delayNumSamples_orig[0], delayTimeScale );
#endif
        }
#else
        fprintf( stdout, "\nDecoder delay:          %-5u [samples]  - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale );
@@ -2314,7 +2335,11 @@ static ivas_error decodeVoIP(
        if ( delayNumSamples_orig[2] > 0 )
        {
            printf( "HRIR/BRIR delay:        %4.2f ms   (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[2] / (float) delayTimeScale, delayNumSamples_orig[2], delayTimeScale );
#ifdef FIX_371_DELAY_REPORT
            printf( "Total delay:            %4.2f ms   (%3u samples at timescale %5u)\n", 1000.f * ( delayNumSamples_orig[1] + delayNumSamples_orig[2] ) / (float) delayTimeScale, delayNumSamples_orig[1] + delayNumSamples_orig[2], delayTimeScale );
#else
            printf( "Total delay:            %4.2f ms   (%3u samples at timescale %5u)\n", 1000.f * delayNumSamples_orig[0] / (float) delayTimeScale, delayNumSamples_orig[0], delayTimeScale );
#endif
        }
#else
        printf( "\nDecoder delay:       %5u [samples]  - Timescale: %5u\n", delayNumSamples_orig, delayTimeScale );
+3 −0
Original line number Diff line number Diff line
@@ -964,6 +964,9 @@ typedef enum

#ifdef FIX_350_MASA_DELAY_COMP
#define DELAY_MASA_PARAM_DEC_SFR                2                           /* Delay to be compensation for MASA parameters in the decoder (subframes) */
#ifdef FIX_373_MASA_DELAY_COMP_MSAN
#define SPH_IDX_FRONT ( MASA_NO_POINTS_EQUATOR / 2 )                        /* Spherical index corresponding to front direction for setting as default value */
#endif
#endif

#define DIRAC_SLOT_NS                           1250000L                    /* time duration of a time slot, 1.25ms (==DELAY_RENERER_NS/MAX_PARAM_SPATIAL_SUBFRAMES) */
+26 −0
Original line number Diff line number Diff line
@@ -314,6 +314,10 @@ void masa_sample_rate_band_correction(
    int16_t *band_mapping,            /* i/o: Band mapping used and modified        */
    IVAS_QMETADATA_HANDLE hQMetaData, /* i/o: QMetadata structure for modification  */
    const int32_t sampling_rate       /* i  : Sampling rate                         */
#ifdef FIX_373_MASA_DELAY_COMP_MSAN
    ,
    MASA_DECODER_EXT_OUT_META_HANDLE hExtOutMeta /* i/o: MASA decoder metadata ext out buffer */
#endif
)
{
    uint8_t band, sf;
@@ -386,6 +390,28 @@ void masa_sample_rate_band_correction(
            hQMetaData->twoDirBands[band] = 0;
        }
    }
#ifdef FIX_373_MASA_DELAY_COMP_MSAN
    if ( hExtOutMeta != NULL )
    {
        /* in decoder, zero the EXT out MASA meta buffer */
        for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ )
        {
            for ( band = config->numCodingBands; band < MASA_FREQUENCY_BANDS; band++ )
            {
                hExtOutMeta->directionIndex[0][sf][band] = SPH_IDX_FRONT;
                hExtOutMeta->directToTotalRatio[0][sf][band] = 0u;
                hExtOutMeta->spreadCoherence[0][sf][band] = 0u;

                hExtOutMeta->directionIndex[1][sf][band] = SPH_IDX_FRONT;
                hExtOutMeta->directToTotalRatio[1][sf][band] = 0u;
                hExtOutMeta->spreadCoherence[1][sf][band] = 0u;

                hExtOutMeta->surroundCoherence[sf][band] = 0u;
                hExtOutMeta->diffuseToTotalRatio[sf][band] = UINT8_MAX;
            }
        }
    }
#endif

    return;
}
+3 −0
Original line number Diff line number Diff line
@@ -4625,6 +4625,9 @@ void masa_sample_rate_band_correction(
    int16_t *band_mapping,                                      /* i/o: Band mapping used and modified                  */
    IVAS_QMETADATA_HANDLE hQMetaData,                           /* i/o: QMetadata structure for modification            */
    const int32_t sampling_rate                                 /* i  : sampling rate                                   */
#ifdef FIX_373_MASA_DELAY_COMP_MSAN
    , MASA_DECODER_EXT_OUT_META_HANDLE hExtOutMeta             /* i/o: MASA decoder metadata ext out buffer             */
#endif
);

void invdct4_transform(
+4 −0
Original line number Diff line number Diff line
@@ -151,11 +151,15 @@
#define FIX_376_SBA_ROTATE                              /*DLB: Fix for issue 376*/
#define TD5                                             /* Eri: Contribution 17: Extended metadata for 6 DoF rendering in TD renderer */
#define TD5_FIX_INVALID_MEMORY_ACCESS                   /* FhG: Resolves segfault in case IVAS_REND_InitConfig gets initialized with rendererConfigEnabled:=false && ISM are being rendered */
#define FIX_371_DELAY_REPORT                            /* Issue 371: div. by zero with -no_delay_cmp */
#define FIX_373_MASA_DELAY_COMP_MSAN                    /* Nokia: Issue 373: MASA audio/meta delay compensation. MSAN bugfix */

#ifdef FIX_I109_ORIENTATION_TRACKING
#define OTR_REFERENCE_VECTOR_TRACKING                 /* FhG: enables the reference position orientation tracking mode */
#endif

#define FIX_380_BFI_PARAMISM                            /* VA: issue 380 - fix metadata recovery in ParamISM BFI */

#define DISCRETE_ISM_DTX_CNG                            /* FhG/VA: contribution 15 - DTX/CNG for (discrete) ISM */
#define FIX_DTX_BRATE_LIMIT                             /* VA: limit the DTX usage in background noise to lower bitrates similarly as in other IVAS formats */
#ifdef DISCRETE_ISM_DTX_CNG
Loading