Commit e56ea072 authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Merge remote-tracking branch 'origin/main' into 1154-add-rtpdump-support

parents 5ed666f3 cfabda27
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@
    <ClCompile Include="..\lib_lc3plus\ari_codec.c" />
    <ClCompile Include="..\lib_lc3plus\attack_detector.c" />
    <ClCompile Include="..\lib_lc3plus\constants.c" />
    <ClCompile Include="..\lib_lc3plus\com_entropy.c" />
    <ClCompile Include="..\lib_lc3plus\cutoff_bandwidth.c" />
    <ClCompile Include="..\lib_lc3plus\dct4.c" />
    <ClCompile Include="..\lib_lc3plus\dec_entropy.c" />
+11 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
#include "lib_rend.h"
#include <assert.h>
#include <math.h>
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
#include <stdint.h>
#endif
#include <string.h>
#include "audio_file_reader.h"
#include "audio_file_writer.h"
@@ -189,7 +192,11 @@ typedef struct
    float lfeConfigElevation;
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    int16_t syncMdDelay;
#else
    float syncMdDelay;
#endif
    IVAS_RENDER_FRAMESIZE render_framesize;
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
    AcousticEnvironmentSequence aeSequence;
@@ -2844,7 +2851,11 @@ static void parseOption(
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
            /* Metadata Delay to sync with audio delay in ms */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
            args->syncMdDelay = (int16_t) strtol( optionValues[0], NULL, 10 );
#else
            args->syncMdDelay = strtof( optionValues[0], NULL );
#endif
            break;
        default:
            assert( 0 && "This should be unreachable - all command line options should be explicitly handled." );
+24 −0
Original line number Diff line number Diff line
@@ -275,8 +275,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp );
                    const float wIm = sinf( angle_tmp );
#else
                    const float wRe = cosf( scale * k );
                    const float wIm = sinf( scale * k );
#endif

                    y[k] /*pt 1*/ = wRe * re[k] + wIm * im[k];
                    y[length - k] = wIm * re[k] - wRe * im[k];
@@ -287,8 +293,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp );
                    const float wIm = sinf( angle_tmp );
#else
                    const float wRe = cosf( scale * k );
                    const float wIm = sinf( scale * k );
#endif

                    y[Nm1 - k] = wRe * re[k] + wIm * im[k];
                    y[k - 1] = wIm * re[k] - wRe * im[k];
@@ -304,8 +316,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp ) * 0.5f;
                    const float wIm = sinf( angle_tmp ) * 0.5f;
#else
                    const float wRe = cosf( scale * k ) * 0.5f;
                    const float wIm = sinf( scale * k ) * 0.5f;
#endif

                    re[k] = wRe * x[k] + wIm * x[length - k];
                    im[k] = wRe * x[length - k] - wIm * x[k];
@@ -316,8 +334,14 @@ void edxt(
            {
                for ( k = Nm1 >> 1; k > 0; k-- )
                {
#ifdef NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2
                    volatile float angle_tmp = scale * k;
                    const float wRe = cosf( angle_tmp ) * 0.5f;
                    const float wIm = sinf( angle_tmp ) * 0.5f;
#else
                    const float wRe = cosf( scale * k ) * 0.5f;
                    const float wIm = sinf( scale * k ) * 0.5f;
#endif

                    re[k] = wRe * x[Nm1 - k] + wIm * x[k - 1];
                    im[k] = wRe * x[k - 1] - wIm * x[Nm1 - k];
+3 −0
Original line number Diff line number Diff line
@@ -1226,6 +1226,9 @@ enum
#define OMASA_GAIN_EDIT_THR                     0.06f                       /* OMASA gain change threshold */
#define OMASA_AZI_EDIT_THR                      1.0f                        /* OMASA-DISC azimuth change threshold */
#define OMASA_ELE_EDIT_THR                      2.0f                        /* OMASA-DISC elevation change threshold */
#ifdef NONBE_1380_OMASA_BUILD_DIFF
#define OMASA_PAN_TBL_LEN                       601
#endif

#define MASA_JBM_RINGBUFFER_FRAMES              3

+64 −1
Original line number Diff line number Diff line
@@ -61,7 +61,11 @@
#define GAMMA_ISM_MEDIUM_IMP4 1.0f
#define GAMMA_ISM_HIGH_IMP4   1.2f


#ifdef NONBE_1380_OMASA_BUILD_DIFF
#define PAN_MAX_DEG           30.0f
#define ONE_OVER_PAN_STEP_DEG 10.0f
#define SIN_LS_ANGLE          0.5f /* sinf( 30.0f * PI_OVER_180 ) */
#endif
/*---------------------------------------------------------------
 * ivas_omasa_ism_mode_select()
 *
@@ -496,6 +500,64 @@ void ivas_get_stereo_panning_gains(
    const float eleDeg,
    float panningGains[2] )
{
#ifdef NONBE_1380_OMASA_BUILD_DIFF
    float aziPlusEle, aziMinusEle, y;

    /* use identity sin(A+B) + sin(A−B) = 2 sinA cosB */
    aziPlusEle = aziDeg + eleDeg;
    aziMinusEle = aziDeg - eleDeg;

    /* wrap into -180..+180 */
    while ( aziPlusEle > 180.0f )
    {
        aziPlusEle -= 360.0f;
    }
    while ( aziPlusEle < -180.0f )
    {
        aziPlusEle += 360.0f;
    }
    while ( aziMinusEle > 180.0f )
    {
        aziMinusEle -= 360.0f;
    }
    while ( aziMinusEle < -180.0f )
    {
        aziMinusEle += 360.0f;
    }

    /* compute Y-coordinate corresponding to the azimuth and elevation: y = sin(azi) * cos(ele) = (sin(azi+ele) + sin(azi-ele)) / 2 */
    y = ( sinf( aziPlusEle * PI_OVER_180 ) + sinf( aziMinusEle * PI_OVER_180 ) ) * 0.5f;

    if ( y >= SIN_LS_ANGLE )
    { /* Left side */
        panningGains[0] = 1.0f;
        panningGains[1] = 0.0f;
    }
    else if ( y <= -SIN_LS_ANGLE )
    { /* Right side */
        panningGains[0] = 0.0f;
        panningGains[1] = 1.0f;
    }
    else /* Tangent panning law */
    {
        /* from sin(angle) to index assuming range -30..+30 degrees with 0.1-degree spacing */
        float angleDeg, pos;
        int16_t idx;

        /* Convert azi and ele to an azi value of the cone of confusion */
        angleDeg = asinf( y ) * _180_OVER_PI;
        angleDeg = fmaxf( fminf( angleDeg, PAN_MAX_DEG ), -PAN_MAX_DEG );

        /* compute the panning gains from the mapped azimuth using a look-up table */
        pos = ( angleDeg + PAN_MAX_DEG ) * ONE_OVER_PAN_STEP_DEG; /* ideal floating index */
        idx = (int16_t) roundf( pos );

        idx = max( 0, min( idx, OMASA_PAN_TBL_LEN - 1 ) );

        panningGains[0] = ivas_tan_panning_gain_tbl[idx];
        panningGains[1] = ivas_tan_panning_gain_tbl[OMASA_PAN_TBL_LEN - 1 - idx];
    }
#else
    float aziRad, eleRad;
    float y, mappedX, aziRadMapped, A, A2, A3;
    const float LsAngleRad = 30.0f * PI_OVER_180;
@@ -524,6 +586,7 @@ void ivas_get_stereo_panning_gains(
        panningGains[0] = sqrtf( A3 );
        panningGains[1] = sqrtf( 1.0f - A3 );
    }
#endif

    return;
}
Loading