Commit fea97932 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

cherry-pick commit b3e6e7ff

"correction lfe handling in MC to binaural case, bugs fix"
manual merge of some files
parent e5b65932
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -4,18 +4,20 @@
IVAS_cod
IVAS_dec
IVAS_rend
IVAS_crend_unit_test
obj/
*.a
*.o
*.P

# default CMake
build/**/*
build*/**/*

# Compiler output VS2017
IVAS_cod.exe
IVAS_dec.exe
IVAS_rend.exe
IVAS_crend_unit_test.exe
*.user
.vs/
Debug_*/
@@ -54,3 +56,6 @@ tests/ref
__pycache__/
*.py[cod]
*$py.class

#history
.history/
+6 −0
Original line number Diff line number Diff line
@@ -152,6 +152,11 @@ file(GLOB libUtilSrcs "lib_util/*.c")
file(GLOB libUtilHeaders "lib_util/*.h")
add_library(lib_util ${libUtilSrcs} ${libUtilHeaders})

file(GLOB libCRendSrcs "scripts/ivas_pytests/tests/unit_tests/crend/*.c")
file(GLOB libCRendHeaders "scripts/ivas_pytests/tests/unit_tests/crend/*.h")
add_executable(IVAS_crend_unit_test ${libCRendSrcs} ${libCRendHeaders})
target_link_libraries(IVAS_crend_unit_test lib_dec lib_rend lib_util lib_com lib_debug)

add_executable(IVAS_cod apps/encoder.c)
target_link_libraries(IVAS_cod lib_enc lib_util)
if(WIN32)
@@ -172,4 +177,5 @@ if(COPY_EXECUTABLES_TO_ROOT)
  add_custom_command(TARGET IVAS_cod POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_cod>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET IVAS_dec POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_dec>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET IVAS_rend POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_rend>" "${CMAKE_CURRENT_SOURCE_DIR}/")
  add_custom_command(TARGET IVAS_crend_unit_test POST_BUILD VERBATIM COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:IVAS_crend_unit_test>" "${CMAKE_CURRENT_SOURCE_DIR}/")
endif()
 No newline at end of file
+9 −9
Original line number Diff line number Diff line
@@ -1649,7 +1649,7 @@ static void splitConfigFile( const char *mdfFilePath,
        fprintf( stderr, "Error reading metadata\n" );
        exit( -1 );
    }
    *wavFileNameLength = strlen( wavFileName );
    *wavFileNameLength = (uint32_t) strlen( wavFileName );

    mdlength = bufferlength - currentPositionIdxs;
    /* "+1" for null termination */
@@ -2151,7 +2151,7 @@ static void printSupportedAudioConfigs()

static void convert_backslash( char *str )
{
    int i, len;
    int32_t i, len;

    /* check that all backslashes are correct on the given platform */
    len = strlen( str );
+2 −0
Original line number Diff line number Diff line
@@ -193,6 +193,8 @@ typedef enum

#define IVAS_MAX_SBA_ORDER                      3                           /* Maximum supported Ambisonics order */

#define IVAS_LIMITER_THRESHOLD      32729 /* -0.01 dBFS */
#define IVAS_LIMITER_ATTACK_SECONDS 0.005f

/*----------------------------------------------------------------------------------*
 * IVAS Bitrates
+4 −12
Original line number Diff line number Diff line
@@ -39,14 +39,6 @@
#include "wmops.h"
#include <assert.h>

/*----------------------------------------------------------------------------------*
 * Local constants
 *----------------------------------------------------------------------------------*/

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


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

    limiter_process( hLimiter, output_frame, LIMITER_THRESHOLD, BER_detect, &hLimiter->strong_saturation_count );
    limiter_process( hLimiter, output_frame, IVAS_LIMITER_THRESHOLD, BER_detect, &hLimiter->strong_saturation_count );

    return;
}
Loading