Commit bd8e347b authored by bayers's avatar bayers
Browse files

Merge remote-tracking branch 'remotes/origin/main' into...

Merge remote-tracking branch 'remotes/origin/main' into 459-ho-dirac-bit-rate-switching-metadata-buffers-are-not-reallocated-correctly
parents 45269717 a771c04e
Loading
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -552,7 +552,11 @@ int main(

    if ( arg.hrtfReaderEnabled )
    {
#ifdef UPDATE_SBA_FILTER
        IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
#else
        IVAS_DEC_HRTF_HANDLE hHrtfTD;
#endif

        IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );

@@ -563,7 +567,11 @@ int main(
        }


#ifdef UPDATE_SBA_FILTER
        IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
#else
        IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF;
#endif
        IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );

        if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
@@ -571,14 +579,22 @@ int main(
            fprintf( stderr, "\nError in loading HRTF binary file %s for CRend \n\n", arg.hrtfCRendFileName );
            goto cleanup;
        }
#ifdef UPDATE_SBA_FILTER
        IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv = NULL;
#else
        IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv;
#endif
        IVAS_DEC_GetHrtfFastConvHandle( hIvasDec, &hHrtfFastConv );

        if ( ( error = load_fastconv_HRTF_from_binary( hHrtfFastConv, hrtfReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in loading HRTF binary file %s for FastConv \n\n", arg.hrtfCRendFileName );
        }
#ifdef UPDATE_SBA_FILTER
        IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin = NULL;
#else
        IVAS_DEC_HRTF_PARAMBIN_HANDLE hHrtfParambin;
#endif
        IVAS_DEC_GetHrtfParamBinHandle( hIvasDec, &hHrtfParambin );

        if ( ( error = load_parambin_HRTF_from_binary( hHrtfParambin, hrtfReader ) ) != IVAS_ERR_OK )
@@ -667,10 +683,18 @@ cleanup:

    if ( arg.hrtfReaderEnabled )
    {
#ifdef UPDATE_SBA_FILTER
        IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
#else
        IVAS_DEC_HRTF_HANDLE hHrtfTD;
#endif
        IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD );
        dealloc_HRTF_binary( hHrtfTD );
#ifdef UPDATE_SBA_FILTER
        IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF = NULL;
#else
        IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF;
#endif
        IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF );
        destroy_SetOfHRTF( hSetOfHRTF );
    }
@@ -1743,7 +1767,6 @@ static ivas_error decodeG192(
            }
        }


        /* Write current frame */
        if ( decodedGoodFrame )
        {
@@ -1829,6 +1852,7 @@ static ivas_error decodeG192(
     *------------------------------------------------------------------------------------------*/

    memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) );

    if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) );
+14 −1
Original line number Diff line number Diff line
@@ -69,10 +69,17 @@ int32_t get_delay(
        {
            delay = IVAS_ENC_DELAY_NS;

#ifdef FIX_356_ISM_METADATA_SYNC
            if ( ivas_format == ISM_FORMAT || ivas_format == MASA_FORMAT )
            {
                delay = 0; /* All delay is compensated in the decoder with MASA/ISM */
            }
#else
            if ( ivas_format == MASA_FORMAT )
            {
                delay = 0; /* All delay is compensated in the decoder with MASA */
            }
#endif
        }

        if ( ivas_format == SBA_FORMAT )
@@ -104,11 +111,17 @@ int32_t get_delay(
                delay += IVAS_FB_DEC_DELAY_NS;
            }


#ifdef FIX_356_ISM_METADATA_SYNC
            if ( ivas_format == ISM_FORMAT || ivas_format == MASA_FORMAT )
            {
                delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with ISM/MASA */
            }
#else
            if ( ivas_format == MASA_FORMAT )
            {
                delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with MASA */
            }
#endif
        }
    }

+10 −0
Original line number Diff line number Diff line
@@ -1512,7 +1512,11 @@ typedef enum

#define BINAURAL_MAXBANDS                       60                          /* Max number of bands */
#define BINAURAL_CONVBANDS                      50                          /* Bands upto which convolution is performed */
#ifdef UPDATE_SBA_FILTER
#define BINAURAL_NTAPS                           5
#else
#define BINAURAL_NTAPS                           7
#endif
#define BINAURAL_NTAPS_MAX                      96

#define HRTF_SH_ORDER                           3
@@ -1530,7 +1534,13 @@ typedef enum
{
    BINAURAL_INPUT_AUDIO_CONFIG_INVALID,
    BINAURAL_INPUT_AUDIO_CONFIG_COMBINED,       /* 5_1, 5_1_2, 5_1_4, 7_1, 7_1_4 */
#ifdef UPDATE_SBA_FILTER    
    BINAURAL_INPUT_AUDIO_CONFIG_HOA3,            /*  HOA3 */
    BINAURAL_INPUT_AUDIO_CONFIG_HOA2,            /* HOA2 */
    BINAURAL_INPUT_AUDIO_CONFIG_FOA,            /* FOA */
#else    
    BINAURAL_INPUT_AUDIO_CONFIG_HOA,            /* FOA, HOA2, HOA3 */
#endif    
    BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED       /* Not used */

} BINAURAL_INPUT_AUDIO_CONFIG;
+61 −5
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ typedef enum
    IVAS_ERR_INVALID_SAMPLING_RATE,
    IVAS_ERR_NOT_CONFIGURED,
    IVAS_ERR_INVALID_STEREO_MODE,
    IVAS_ERR_INVALID_CICP_INDEX,
    IVAS_ERR_INVALID_CICP_INDEX, /* ToDo: rename, CICP not used in IVAS anymore */
    IVAS_ERR_INVALID_BITRATE,
    IVAS_ERR_INVALID_MASA_CONFIG,
    IVAS_ERR_TOO_MANY_INPUTS,
@@ -72,17 +72,15 @@ typedef enum
    IVAS_ERR_INVALID_SPAR_CONFIG,
    IVAS_ERR_WRONG_PARAMS,
    IVAS_ERR_INIT_ERROR,
    IVAS_ERR_DECODER_ERROR,
    IVAS_ERR_WRONG_MODE,
    IVAS_ERR_INVALID_OUTPUT_FORMAT,
    IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED,
    IVAS_ERR_INVALID_HRTF,
    IVAS_ERR_INVALID_INPUT_FORMAT,
    IVAS_ERR_INVALID_INDEX,
    IVAS_ERR_INVALID_INDEX, /* ToDo: should be merged with IVAS_ERR_INDEX_OUT_OF_BOUNDS */
    IVAS_ERR_NOT_SUPPORTED_OPTION,
    IVAS_ERR_NOT_IMPLEMENTED,
    IVAS_ERR_WAITING_FOR_BITSTREAM,
    IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH,
    IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT,
    IVAS_ERR_ISM_INVALID_METADATA_VALUE,
    IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE,
@@ -131,7 +129,7 @@ typedef enum
     *    renderer (lib_rend only)            *
     *----------------------------------------*/

    IVAS_ERR_NUM_CHANNELS_UNKNOWN,
    IVAS_ERR_NUM_CHANNELS_UNKNOWN = 0x6000,
    IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT,
    IVAS_ERR_INVALID_INPUT_ID,
    IVAS_ERR_WRONG_NUM_CHANNELS,
@@ -182,6 +180,64 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Parse error";
        case IVAS_ERR_END_OF_FILE:
            return "End of file";
        case IVAS_ERR_WRONG_PARAMS:
            return "Wrong function parameters";
        case IVAS_ERR_INVALID_BANDWIDTH:
            return "Invalid bandwidth";
        case IVAS_ERR_INVALID_DTX_UPDATE_RATE:
            return "Invalid DTX update rate";
        case IVAS_ERR_NOT_CONFIGURED:
            return "Handle has not been configured";
        case IVAS_ERR_INVALID_STEREO_MODE:
            return "Invalid stereo mode";
        case IVAS_ERR_INVALID_CICP_INDEX:
            return "Invalid speaker layout";
        case IVAS_ERR_INVALID_BITRATE:
            return "Invalid bitrate";
        case IVAS_ERR_INVALID_MASA_CONFIG:
            return "Invalid MASA config";
        case IVAS_ERR_TOO_MANY_INPUTS:
            return "Too many object inputs provided";
        case IVAS_ERR_INDEX_OUT_OF_BOUNDS:
            return "Index out of bounds";
        case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED:
            return "Reconfigure not supported";
        case IVAS_ERR_INVALID_FEC_OFFSET:
            return "Invalid FEC offset";
        case IVAS_ERR_INVALID_INPUT_BUFFER_SIZE:
            return "Invalid input buffer size";
        case IVAS_ERR_DTX_NOT_SUPPORTED:
            return "DTX is not supported in this IVAS format and element mode";
        case IVAS_ERR_UNEXPECTED_NULL_POINTER:
            return "Unexpected NULL pointer";
        case IVAS_ERR_METADATA_NOT_EXPECTED:
            return "Metadata input not expected for current configuration";
#ifdef DEBUGGING
        case IVAS_ERR_INVALID_FORCE_MODE:
            return "Invalid force mode";
#endif
        case IVAS_ERR_NOT_IMPLEMENTED:
            return "Not implemented";
        case IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT:
            return "Invalid metadata file format";
        case IVAS_ERR_ISM_INVALID_METADATA_VALUE:
            return "Invalid metadata value provided";
        case IVAS_ERR_NOT_SUPPORTED_OPTION:
            return "Option not supported in this set-up";
        case IVAS_ERR_INIT_ERROR:
            return "Initialization error";
        case IVAS_ERR_INVALID_BITSTREAM:
            return "Invalid bitstream";
        case IVAS_ERR_WRONG_MODE:
            return "Wrong mode";
        case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED:
            return "Head rotation not supported";
        case IVAS_ERR_INVALID_HRTF:
            return "Unsupported HRTF filter set";
        case IVAS_ERR_INVALID_INPUT_FORMAT:
            return "Invalid format of input bitstream";
        case IVAS_ERR_INVALID_INDEX:
            return "Invalid index";
        default:
            break;
    }
+9 −6
Original line number Diff line number Diff line
@@ -58,12 +58,15 @@ typedef struct
{
    int16_t ism_metadata_flag;      /* flag whether metadata are coded in particular frame of particular object */
    int16_t last_ism_metadata_flag; /* last frame ism_metadata_flag */
    int16_t non_diegetic_flag;      /* Non-diegetic (non-headtracked) object flag */

    float azimuth;   /* azimuth value read from the input metadata file */
    float elevation;                /* azimuth value read from the input metadata file */
    float radius;
    float yaw;                            /* azimuth orientation value read from the input metadata file */
    float pitch;                          /* elevation orientation value read from the input metadata file */
    float elevation; /* elevation value read from the input metadata file */
    float radius;    /* radius value read from the input metadata file */
    float yaw;       /* yaw value read from the input metadata file */
    float pitch;     /* pitch value read from the input metadata file */

    int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */

    ISM_METADATA_ANGLE position_angle;    /* Angle structs for azimuth and elevation */
    ISM_METADATA_ANGLE orientation_angle; /* Angle structs for yaw and pitch */
    int16_t last_radius_idx;              /* last frame index of coded radius */
Loading