Commit d5668a87 authored by bayers's avatar bayers
Browse files

reenable default coding path for split rendering

parent ed974298
Loading
Loading
Loading
Loading
+43 −11
Original line number Diff line number Diff line
@@ -143,6 +143,9 @@ typedef struct
    IVAS_DEC_COMPLEXITY_LEVEL complexityLevel;
#ifdef API_5MS
    bool tsmEnabled;
#ifdef API_5MS_BASELINE
    bool enable5ms;
#endif
#endif
#ifdef DEBUGGING
    IVAS_DEC_FORCED_REND_MODE forcedRendMode;
@@ -439,10 +442,17 @@ int main(
    if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED || arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM )
    {
        arg.enableHeadRotation = true;
#ifdef API_5MS_BASELINE
        arg.enable5ms = false;
#endif
    }
#endif
#ifdef API_5MS
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.tsmEnabled, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.tsmEnabled,
#ifdef API_5MS_BASELINE
                                       arg.enable5ms,
#endif
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputFormat, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
@@ -973,6 +983,9 @@ static bool parseCmdlIVAS_dec(
    arg->non_diegetic_pan_gain = 0.f;
#ifdef API_5MS
    arg->tsmEnabled = false;
#ifdef API_5MS_BASELINE
    arg->enable5ms = false;
#endif
#endif
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
@@ -1129,6 +1142,9 @@ static bool parseCmdlIVAS_dec(
            int32_t tmp = 100;
#ifdef API_5MS
            arg->tsmEnabled = true;
#ifdef API_5MS_BASELINE
            arg->enable5ms = true;
#endif
#else
            arg->variableSpeedMode = true;
#endif
@@ -1188,6 +1204,9 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-T" ) == 0 )
        {
            arg->enableHeadRotation = true;
#ifdef API_5MS_BASELINE
            arg->enable5ms = true;
#endif
            i++;

            if ( argc - i <= 4 || argv[i][0] == '-' )
@@ -1895,7 +1914,11 @@ static ivas_error decodeG192(
    nSamplesAvailableNext = 0;

    vec_pos_update = 0;
    if ( arg.enableHeadRotation )
    if ( arg.enableHeadRotation
#ifdef API_5MS_BASELINE
         && arg.enable5ms
#endif
    )
    {
        nOutSamples = (int16_t) ( arg.output_Fs / 1000 * HEADROTATION_FETCH_FRAMESIZE_MS );
        vec_pos_len = IVAS_MAX_PARAM_SPATIAL_SUBFRAMES;
@@ -1911,6 +1934,8 @@ static ivas_error decodeG192(
    splitRendBits.bits_read = 0;
    splitRendBits.bits_written = 0;
    splitRendBits.buf_len = MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES;
    splitRendBits.pose_correction = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE;
    splitRendBits.codec = IVAS_SPLIT_REND_CODEC_NONE;
    hSplitRendFileReadWrite = NULL;
#endif

@@ -1971,6 +1996,12 @@ static ivas_error decodeG192(
                Quaternion.x = 0.0f;
                Quaternion.y = 0.0f;
                Quaternion.z = 0.0f;

#ifdef API_5MS
                Pos.x = 0.0f;
                Pos.y = 0.0f;
                Pos.z = 0.0f;
#endif
            }
            else
            {
@@ -2323,7 +2354,8 @@ static ivas_error decodeG192(

            if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos
#ifdef SPLIT_REND_WITH_HEAD_ROT
    ,DEFAULT_AXIS
                                                       ,
                                                       DEFAULT_AXIS
#endif
                                                       ) ) != IVAS_ERR_OK )
            {
+2 −2
Original line number Diff line number Diff line
@@ -305,11 +305,11 @@ void stereo_dmx_evs_close_encoder(
    STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS                    /* i/o: Stereo downmix for EVS encoder handle   */
);

#ifndef API_5MS
#if !defined(API_5MS) || defined (API_5MS_BASELINE) 
ivas_error ivas_dec(
    Decoder_Struct *st_ivas,                                    /* i  : IVAS decoder structure                  */
    int16_t *data                                               /* o  : output synthesis signal                 */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT && !defined(API_5MS)
    ,
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits
#endif
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@
#ifdef API_5MS
#define JITTER_MEM_OPTIM_RENDERING
#define LIB_REND_API_5MS                            /* FhG: Adds 5ms framing capability to lib_rend */ /* TODO(sgi): needs to be joined with API_5MS */
#define API_5MS_BASELINE
#endif
#define LIB_REND_FIX_HRTFPARAMBIN_MEMLEAK
// 5 ms branch switches end
+46 −9
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@

#include <stdint.h>
#include "options.h"
#ifndef API_5MS
#if !defined( API_5MS ) || defined( API_5MS_BASELINE )
#include "cnst.h"
#include "ivas_cnst.h"
#include "rom_com.h"
@@ -55,7 +55,7 @@
ivas_error ivas_dec(
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure      */
    int16_t *data            /* o  : output synthesis signal     */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT && !defined( API_5MS )
    ,
    IVAS_SPLIT_REND_BITS_HANDLE hSplitRendBits
#endif
@@ -121,7 +121,7 @@ ivas_error ivas_dec(
        return error;
    }

#ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined SPLIT_REND_WITH_HEAD_ROT && !defined(API_5MS)
    if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
         ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
    {
@@ -215,7 +215,12 @@ ivas_error ivas_dec(
            {
                ivas_param_ism_params_to_masa_param_mapping( st_ivas );

                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport );
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport
#ifdef LIB_REND_API_5MS
                                         ,
                                         MAX_PARAM_SPATIAL_SUBFRAMES
#endif
                );
            }
            else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
            {
@@ -292,6 +297,10 @@ ivas_error ivas_dec(
            {
                if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL,
                                                       NULL, NULL, NULL, p_output, output_Fs
#ifdef LIB_REND_API_5MS
                                                       ,
                                                       MAX_PARAM_SPATIAL_SUBFRAMES
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                       ,
                                                       0
@@ -469,7 +478,12 @@ ivas_error ivas_dec(
        /* Loudspeakers, Ambisonics or Binaural rendering */
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, nchan_remapped );
            ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, nchan_remapped
#ifdef LIB_REND_API_5MS
                                     ,
                                     MAX_PARAM_SPATIAL_SUBFRAMES
#endif
            );
        }
        else if ( st_ivas->ivas_format == MASA_FORMAT )
        {
@@ -482,7 +496,12 @@ ivas_error ivas_dec(
            }
            else if ( st_ivas->renderer_type == RENDERER_DIRAC )
            {
                ivas_dirac_dec( st_ivas, output, nchan_remapped );
                ivas_dirac_dec( st_ivas, output, nchan_remapped
#ifdef LIB_REND_API_5MS
                                ,
                                MAX_PARAM_SPATIAL_SUBFRAMES
#endif
                );
            }
        }
        else if ( !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 )
@@ -547,6 +566,10 @@ ivas_error ivas_dec(
#endif
                    if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig,
                                                           st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs
#ifdef LIB_REND_API_5MS
                                                           ,
                                                           MAX_PARAM_SPATIAL_SUBFRAMES
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
                                                           ,
                                                           0
@@ -812,11 +835,21 @@ ivas_error ivas_dec(
            /* Rendering */
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
            {
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport );
                ivas_dirac_dec_binaural( st_ivas, st_ivas->hCombinedOrientationData, output, st_ivas->nchan_transport
#ifdef LIB_REND_API_5MS
                                         ,
                                         MAX_PARAM_SPATIAL_SUBFRAMES
#endif
                );
            }
            else if ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ) /* rendering to CICPxx and Ambisonics */
            {
                ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport );
                ivas_dirac_dec( st_ivas, output, st_ivas->nchan_transport
#ifdef LIB_REND_API_5MS
                                ,
                                MAX_PARAM_SPATIAL_SUBFRAMES
#endif
                );

                if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
                {
@@ -838,7 +871,7 @@ ivas_error ivas_dec(
    }


#ifdef SPLIT_REND_WITH_HEAD_ROT
#if defined( SPLIT_REND_WITH_HEAD_ROT ) && !defined(API_5MS)
    /*split rendering process calls*/
    if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ||
         ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
@@ -851,7 +884,11 @@ ivas_error ivas_dec(
        pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;

        ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend,
#ifdef API_5MS
                                            st_ivas->hHeadTrackData->Quaternion,
#else
                                            st_ivas->hHeadTrackData->Quaternions,
#endif
                                            st_ivas->hRenderConfig->split_rend_config.splitRendBitRate,
                                            st_ivas->hRenderConfig->split_rend_config.codec,
                                            hSplitBinRend->hSplitRendBits,
+4 −0
Original line number Diff line number Diff line
@@ -926,7 +926,11 @@ ivas_error ivas_dirac_dec_config(
    if ( dec_config_flag == DIRAC_OPEN )
    {
#ifdef API_5MS
#ifdef API_5MS_BASELINE
        if ( st_ivas->hDecoderConfig->Opt_5ms && st_ivas->hTcBuffer == NULL )
#else
        if ( st_ivas->hTcBuffer == NULL )
#endif
#else
        if ( st_ivas->hDecoderConfig->voip_active == 1 && st_ivas->hTcBuffer == NULL )
#endif
Loading