Commit 7b73ca37 authored by norvell's avatar norvell
Browse files

Port MR1531 under define CONF_DISTATT

parent 2b9ec3df
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -478,7 +478,16 @@ int main(
            renderConfig.directivity_fx[i * 3 + 1] = (Word16) ( renderConfig.directivity[i * 3 + 1] * ( 1u << 6 ) );
            renderConfig.directivity_fx[i * 3 + 2] = (Word16) ( renderConfig.directivity[i * 3 + 2] * ( ( 1u << 15 ) - 1 ) );
        }

#ifdef CONF_DISTATT
        if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
            goto cleanup;
        }
        renderConfig.distAtt_fx[0] = (Word32) ( renderConfig.distAtt[0] * ( 1u << 27 ) );
        renderConfig.distAtt_fx[1] = (Word32) ( renderConfig.distAtt[1] * ( 1u << 30 ) );
        renderConfig.distAtt_fx[2] = (Word32) ( renderConfig.distAtt[2] * ( 1u << 30 ) );
#endif
        if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ||
               arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@
#include "basop_settings.h"
#include "cnst.h"

#ifdef DEBUGGING
#include "debug.h"
#endif

extern const Word32 SqrtTable[32];     // Q31
extern const Word16 SqrtDiffTable[32]; /* Q15 */

+4 −0
Original line number Diff line number Diff line
@@ -347,6 +347,10 @@ typedef struct _IVAS_RENDER_CONFIG
    ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
    Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15}
#ifdef CONF_DISTATT
    float distAtt[3];
    Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

typedef struct
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@
#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF              /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */

#define FIX_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */

/* #################### End BASOP porting switches ############################ */

+18 −1
Original line number Diff line number Diff line
@@ -59,7 +59,11 @@ ivas_error ivas_td_binaural_open_fx(
        *num_src = st_ivas->nchan_ism;
        move16();
    }
#ifdef CONF_DISTATT
    return ivas_td_binaural_open_unwrap_fx( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, *num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity_fx, st_ivas->hRenderConfig->distAtt_fx, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns, SrcInd );
#else
    return ivas_td_binaural_open_unwrap_fx( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, *num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity_fx, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns, SrcInd );
#endif
}


@@ -328,7 +332,19 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural(
        {
            continue;
        }

#ifdef CONF_DISTATT
        IF( ( error = ivas_td_binaural_open_unwrap_fx( &st_ivas->hHrtfTD,
                                                       st_ivas->hDecoderConfig->output_Fs,
                                                       st_ivas->nchan_transport,
                                                       st_ivas->ivas_format,
                                                       st_ivas->transport_config,
                                                       st_ivas->hRenderConfig->directivity_fx,
                                                       st_ivas->hRenderConfig->distAtt_fx,
                                                       st_ivas->hTransSetup,
                                                       &st_ivas->hTdRendHandles[i],
                                                       &st_ivas->binaural_latency_ns,
                                                       SrcInd ) ) != IVAS_ERR_OK )
#else
        IF( ( error = ivas_td_binaural_open_unwrap_fx( &st_ivas->hHrtfTD,
                                                       st_ivas->hDecoderConfig->output_Fs,
                                                       st_ivas->nchan_transport,
@@ -339,6 +355,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural(
                                                       &st_ivas->hTdRendHandles[i],
                                                       &st_ivas->binaural_latency_ns,
                                                       SrcInd ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
Loading