Commit 5d812f05 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[pre-merge] fix more inconsistencies + accomodate change to AudioFileReader_open()

parent 005ccc4b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ int main(
    }

    uint32_t inFileSampleRate = 0;
    if ( AudioFileReader_open( &audioReader, audioFilePath, inFileSampleRate ) != IVAS_ERR_OK )
    if ( AudioFileReader_open( &audioReader, audioFilePath, args.sampleRate ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "Error opening file: %s\n", audioFilePath );
        exit( -1 );
+1 −1
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@
*******************************************************************************************************/

#include <stdint.h>
#include <math.h>
#include "options.h"
#include "prot.h"
#include "ivas_prot.h"
#include "ivas_cnst.h"
#include "ivas_rom_rend.h"
#include "ivas_stat_dec.h"
#include <math.h>
#include "ivas_rom_binaural_crend_head.h"
#ifdef EXT_RENDERER
#include "lib_rend.h"
+26 −0
Original line number Diff line number Diff line
@@ -39,6 +39,16 @@
#include "wmops.h"
#include <assert.h>

#ifndef EXT_RENDERER
/*----------------------------------------------------------------------------------*
 * Local constants
 *----------------------------------------------------------------------------------*/

#define LIMITER_THRESHOLD      32729 /* -0.01 dBFS */
#define LIMITER_ATTACK_SECONDS 0.005f

#endif

/*-------------------------------------------------------------------*
 * detect_strong_saturations()
 *
@@ -63,11 +73,19 @@ static int16_t detect_strong_saturations(
        *strong_saturation_cnt = 50;
        apply_strong_limiting = 1;
    }
#ifdef EXT_RENDERER
    else if ( max_val > 3 * IVAS_LIMITER_THRESHOLD && *strong_saturation_cnt > 0 )
#else
    else if ( max_val > 3 * LIMITER_THRESHOLD && *strong_saturation_cnt > 0 )
#endif
    {
        apply_strong_limiting = 1;
    }
#ifdef EXT_RENDERER
    else if ( max_val > 10 * IVAS_LIMITER_THRESHOLD )
#else
    else if ( max_val > 10 * LIMITER_THRESHOLD )
#endif
    {
        *strong_saturation_cnt += 20;
        *strong_saturation_cnt = min( *strong_saturation_cnt, 50 );
@@ -122,7 +140,11 @@ IVAS_LIMITER_HANDLE ivas_limiter_open(
    hLimiter->sampling_rate = sampling_rate;
    hLimiter->gain = 1.f;
    hLimiter->release_heuristic = 0.f;
#ifdef EXT_RENDERER
    hLimiter->attack_constant = powf( 0.01f, 1.0f / ( IVAS_LIMITER_ATTACK_SECONDS * sampling_rate ) );
#else
    hLimiter->attack_constant = powf( 0.01f, 1.0f / ( LIMITER_ATTACK_SECONDS * sampling_rate ) );
#endif
    hLimiter->strong_saturation_count = 0;
#ifdef DEBUGGING
    hLimiter->cnt_frames_limited = 0;
@@ -194,7 +216,11 @@ void ivas_limiter_dec(
        channels[c] = output[c];
    }

#ifdef EXT_RENDERER
    limiter_process( hLimiter, output_frame, IVAS_LIMITER_THRESHOLD, BER_detect, &hLimiter->strong_saturation_count );
#else
    limiter_process( hLimiter, output_frame, LIMITER_THRESHOLD, BER_detect, &hLimiter->strong_saturation_count );
#endif

    return;
}
+5 −0
Original line number Diff line number Diff line
@@ -79,8 +79,13 @@ ivas_error ivas_ls_custom_open(
 *-------------------------------------------------------------------------*/

void ivas_ls_custom_setup(
#ifdef EXT_RENDERER
    IVAS_OUTPUT_SETUP_HANDLE hOutSetup,         /* o  : IVAS output setup handle        */
    const LSSETUP_CUSTOM_STRUCT *hLsSetupCustom /* i  : Custom loudspeaker setup handle */
#else
    IVAS_OUTPUT_SETUP_HANDLE hOutSetup,        /* o  : IVAS output setup handle        */
    const LSSETUP_CUSTOM_HANDLE hLsSetupCustom /* i  : Custom loudspeaker setup handle */
#endif
)
{
    hOutSetup->output_config = AUDIO_CONFIG_LS_CUSTOM;
+4 −2
Original line number Diff line number Diff line
@@ -31,10 +31,10 @@
*******************************************************************************************************/

#include <stdint.h>
#include <math.h>
#include "options.h"
#include "prot.h"
#include "ivas_prot.h"
#include <math.h>
#include "wmops.h"
#include "ivas_rom_com.h"
#ifdef EXT_RENDERER
@@ -271,7 +271,9 @@ void ObjRenderIVASFrame(
    for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ )
    {
        /* Update the listener's location/orientation */
        TDREND_Update_listener_orientation( st_ivas->hBinRendererTd, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Quaternions[subframe_idx] : NULL );
        TDREND_Update_listener_orientation( st_ivas->hBinRendererTd,
                                            st_ivas->hDecoderConfig->Opt_Headrotation,
                                            ( st_ivas->hHeadTrackData != NULL ) ? &st_ivas->hHeadTrackData->Quaternions[subframe_idx] : NULL );

        if ( ( st_ivas->hRenderConfig != NULL ) && ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) )
        {
Loading