Commit 827e95d8 authored by eichenseer's avatar eichenseer
Browse files

Merge branch 'main' into discISM_DTX

parents e7425889 9e5e915b
Loading
Loading
Loading
Loading
+19 −12
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ typedef enum
    IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT,
    IVAS_ERR_ISM_INVALID_METADATA_VALUE,
    IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE,
#ifdef FIX_372_LIB_REND_VALIDATE_IO
    IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED,
#endif
#ifdef DEBUGGING
    IVAS_ERR_INVALID_FORCE_MODE,
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
@@ -145,18 +148,7 @@ typedef enum

static inline const char *ivas_error_to_string( ivas_error error_code )
{
    /* For error categories that are likely to still have many changes to
     * specific error codes, return one string per category */
    if ( ( error_code & 0xF000 ) == 0x1000 )
    {
        return "API error";
    }
    if ( ( error_code & 0xF000 ) == 0x2000 )
    {
        return "data error";
    }

    /* For categories that are unlikely to change, use more specific strings */
    /* Try to match to a specific string */
    switch ( error_code )
    {
        case IVAS_ERR_OK:
@@ -179,6 +171,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Wrong number of channels";
        case IVAS_ERR_INVALID_BUFFER_SIZE:
            return "Invalid buffer size";
#ifdef FIX_372_LIB_REND_VALIDATE_IO
        case IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED:
            return "Unsupported input/output config pair";
#endif
        case IVAS_ERR_FAILED_FILE_OPEN:
            return "File open error";
        case IVAS_ERR_FAILED_FILE_WRITE:
@@ -193,6 +189,17 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            break;
    }

    /* For error categories that are likely to still have many changes to
     * specific error codes, return one string per category */
    if ( ( error_code & 0xF000 ) == 0x1000 )
    {
        return "API error";
    }
    if ( ( error_code & 0xF000 ) == 0x2000 )
    {
        return "data error";
    }

    return "Unknown error";
}

+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,9 @@
#define ISM_HIGHEST_BITRATE                             /* VA: Issue 284: Update highest bitrate limit in ISM format */
#define TUNE_360_OBJECT_WITH_NOISE                      /* VA: issue 360: consider objects being speech+noise for active speech coding */
#define FIX_350_MASA_DELAY_COMP                         /* Nokia: Issue 350: MASA audio/meta delay compensation */
#define FIX_372_LIB_REND_VALIDATE_IO                    /* FhG: Issue 372: IVAS_rend segfaults with unsupported I/O configs - add validation checks of I/O config */

#define FIX_376_SBA_ROTATE                             /*DLB: Fix for issue 376*/

#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 */
+55 −0
Original line number Diff line number Diff line
@@ -1050,6 +1050,21 @@ static CREND_WRAPPER defaultCrendWrapper(
    return w;
}

#ifdef FIX_372_LIB_REND_VALIDATE_IO
static bool isIoConfigPairSupported( IVAS_REND_AudioConfig inConfig, IVAS_REND_AudioConfig outConfig )
{
    /* Rendering mono or stereo to binaural is not supported */
    if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_MONO || inConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) &&
         getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL )
    {
        return false;
    }

    /* If not returned so far, config pair is supported */
    return true;
}
#endif

static ivas_error setRendInputActiveIsm(
    void *input,
    const IVAS_REND_AudioConfig inConfig,
@@ -1065,6 +1080,13 @@ static ivas_error setRendInputActiveIsm(
    rendCtx = inputIsm->base.ctx;
    outConfig = *rendCtx.pOutConfig;

#ifdef FIX_372_LIB_REND_VALIDATE_IO
    if ( !isIoConfigPairSupported( inConfig, outConfig ) )
    {
        return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED;
    }
#endif

    initRendInputBase( &inputIsm->base, inConfig, id, rendCtx );

    inputIsm->currentPos = defaultObjectPosition();
@@ -1956,6 +1978,13 @@ static ivas_error setRendInputActiveMc(
    rendCtx = inputMc->base.ctx;
    outConfig = *rendCtx.pOutConfig;

#ifdef FIX_372_LIB_REND_VALIDATE_IO
    if ( !isIoConfigPairSupported( inConfig, outConfig ) )
    {
        return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED;
    }
#endif

    initRendInputBase( &inputMc->base, inConfig, id, rendCtx );
    setZeroPanMatrix( inputMc->panGains );
    inputMc->customLsInput = defaultCustomLs();
@@ -2216,6 +2245,13 @@ static ivas_error setRendInputActiveSba(
    rendCtx = inputSba->base.ctx;
    outConfig = *rendCtx.pOutConfig;

#ifdef FIX_372_LIB_REND_VALIDATE_IO
    if ( !isIoConfigPairSupported( inConfig, outConfig ) )
    {
        return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED;
    }
#endif

    initRendInputBase( &inputSba->base, inConfig, id, rendCtx );
    setZeroPanMatrix( inputSba->hoaDecMtx );
#ifdef FIX_197_CREND_INTERFACE
@@ -2618,6 +2654,13 @@ static ivas_error setRendInputActiveMasa(
    outConfig = *rendCtx.pOutConfig;
    (void) hRendCfg; /* Suppress warning */

#ifdef FIX_372_LIB_REND_VALIDATE_IO
    if ( !isIoConfigPairSupported( inConfig, outConfig ) )
    {
        return IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED;
    }
#endif

    initRendInputBase( &inputMasa->base, inConfig, id, rendCtx );

    if ( ( error = getAudioConfigNumChannels( inConfig, &numInChannels ) ) != IVAS_ERR_OK )
@@ -4278,7 +4321,18 @@ static ivas_error rotateFrameSba(
                                          ( 1 - headRotData->crossfade[i] ) * gains_prev[n][m] * ( *readPtr );
                    }
                }
#ifdef FIX_376_SBA_ROTATE
                /* write back the result */
                for ( n = m1; n < m2; n++ )
                {
                    writePtr = getSmplPtr( outAudio, n, subframe_idx * subframe_len + i );
                    ( *writePtr ) = tmpRot[n - m1];
                }
                m1 = m2;
                m2 += 2 * ( l + 1 ) + 1;
#endif
            }
#ifndef FIX_376_SBA_ROTATE
            /* write back the result */
            for ( n = m1; n < m2; n++ )
            {
@@ -4287,6 +4341,7 @@ static ivas_error rotateFrameSba(
            }
            m1 = m2;
            m2 += 2 * ( l + 1 ) + 1;
#endif
        }

        /*unoptimized code for reference (full matrix multiplication)*/
(131 B)

File changed.

No diff preview for this file type.

(131 B)

File changed.

No diff preview for this file type.

Loading