Commit 667c5e04 authored by vaclav's avatar vaclav
Browse files

Merge branch '1901-basop-PortFlpMr1688' into 'main'

[Rend non-BE] Port MR1688 and MR1729 from float to BASOP

Closes #1901

See merge request !2090
parents 85251a18 8a1a3090
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -174,6 +174,10 @@ typedef struct
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    int8_t orientation_tracking;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    int16_t Opt_Headrotation;
    int16_t Opt_ExternalOrientation;
#endif
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
    IVAS_REND_COMPLEXITY_LEVEL complexityLevel;
@@ -979,7 +983,12 @@ int main(

    Word32 nonDiegeticPanGain_fx = ( args.nonDiegeticPanGain == 1.0f ) ? ONE_IN_Q31 : ( args.nonDiegeticPanGain == -1.0f ) ? L_negate( ONE_IN_Q31 )
                                                                                                                           : (Word32) ( args.nonDiegeticPanGain * ( 1LL << Q31 ) );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    IF( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, nonDiegeticPanGain_fx, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
@@ -2770,7 +2779,13 @@ static CmdlnArgs defaultArgs(
    clearString( args.renderConfigFilePath );
    clearString( args.externalOrientationFilePath );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    args.Opt_Headrotation = 0;
    args.Opt_ExternalOrientation = 0;
#endif

    args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;

    args.nonDiegeticPan = 0;
    args.nonDiegeticPanGain = 0.f;

@@ -2862,6 +2877,9 @@ static void parseOption(
            break;
        case CmdLnOptionId_trajFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_Headrotation = 1;
#endif
            strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_outputMetadata:
@@ -2882,6 +2900,9 @@ static void parseOption(
            break;
        case CmdLnOptionId_exteriorOrientationFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_ExternalOrientation = 1;
#endif
            strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_customHrtfFile:
@@ -3015,6 +3036,13 @@ static CmdlnArgs parseCmdlnArgs(
        exit( -1 ); /* Error printout handled by failing function */
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        args.Opt_Headrotation = 1;
    }
#endif

    return args;
}

+0 −2
Original line number Diff line number Diff line
@@ -4461,8 +4461,6 @@ ivas_error read_indices_fx(

    st_ivas->BER_detect = 0;
    move16();
    st_ivas->num_bits = num_bits;
    move16();
    sts = reset_elements( st_ivas );

#ifdef DEBUGGING
+12 −7
Original line number Diff line number Diff line
@@ -4027,12 +4027,14 @@ void sns_avq_dec_stereo_fx(
    Word32 *SNS_Ql,       /* o  : Quantized SNS vectors (left channel)    */
    Word16 *q_l,
    Word32 *SNS_Qr, /* o  : Quantized SNS vectors (right channe)    */
    Word16 *q_r );
    Word16 *q_r 
);

void dequantize_sns_fx(
    Word16 indices[CPE_CHANNELS][NPRM_LPC_NEW],
    Word32 snsQ_out[CPE_CHANNELS][NB_DIV][M],
    Decoder_State **sts );
    Decoder_State **sts 
);

void inverseMS_fx(
    const Word16 L_frame, /* i  : frame length						Q0*/
@@ -4141,7 +4143,8 @@ Word16 ivas_smc_gmm_fx(
    const Word16 flag_spitch,             /* i  : flag to indicate very short stable pitch            */
    Word16 Qfact_PS,
    Word16 Q_esp,
    Word16 Qfact_PS_past );
    Word16 Qfact_PS_past 
);

void ivas_signaling_enc_fx(
    Encoder_State *st,                /* i/o: encoder state structure                          */
@@ -4187,12 +4190,13 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx(
    const Word16 subframe_idx,
    const Word16 core,
    const Word16 crossfade_gain,
    const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode );

    const TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode 
);

Word16 rand_triangular_signed_fx(
    Word16 *seed,
    Word16 *exp_fac );
    Word16 *exp_fac 
);

Word64 var_32_fx(
    const Word32 *x,  /* i  : input vector                          */
@@ -4202,7 +4206,8 @@ Word64 var_32_fx(

ivas_error ivas_jbm_dec_tc_fx(
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure                                      */
    Word32 *data_fx );
    Word32 *data_fx 
);

ivas_error ivas_jbm_dec_flush_renderer_fx(
    Decoder_Struct *st_ivas,                     /* i/o: IVAS decoder structure    */
+3 −2
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@
#define FIX_1917_DIRAC_RENDER_PTR_INCR                       /* FhG: fix wrong pointer increment in ivas_dirac_dec_render_sf_fx() for object rendering */
#define FIX_CDLFB_BUFFER_SCALING                             /* FhG: fix wrong buffer scaling in ivas_dirac_dec_render_sf_fx() for object rendering */
#define FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW                /* FhG: bit-exact, replace carry and overflow operations by 64-bit operations, MR 1931 */
#define	NONBE_SVD_OPTIMIZATION                               /* FhG: reduce WMOPS of HouseHolderReduction() in ivas_svd_dec.c() by removing redundant mathematics and using 64 bit additions */
#define FIX_1766_TCX2ACELP_BWE_ISSUE                         /* VA : Fix rare BWE issue when switching from TCX to ACELP */
#define FIX_1781_SPECTRAL_GAPS                               /* FhG: Change internal calculation of tcx_noise_factor_ivas_fx() to 32-bit*/
#define FIX_ISSUE_1811_EXCEEDING_W_SHIFTS                    /* FhG: limit exceeding 64bit shifts */
@@ -133,7 +134,7 @@
#define NONBE_FIX_1141_OSBA_ROOM_RENDERING              /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect  */
#define NONBE_1360_LFE_DELAY                            /* Dlb: LFE delay alignment when rendering in CLDFB domain*/
#define NONBE_1229_FIX_ISM1_DPID                        /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */
#define NONBE_SVD_OPTIMIZATION                          /* FhG: issue 1367 */
#define FIX_1135_EXT_RENDERER_HANDLES                   /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */
#define FIX_1209_SID_SIGNALING                          /* VA: issue 1209: remove dead code in IVAS SID signaling */
#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_1131_ACELP_OOB                            /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */
+0 −3
Original line number Diff line number Diff line
@@ -3191,8 +3191,6 @@ ivas_error ivas_init_decoder_fx(
     * Allocate floating-point output audio buffers
     *-----------------------------------------------------------------*/

    st_ivas->p_out_len = ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate );
    move16();
    FOR( n = 0; n < ivas_get_nchan_buffers_dec_fx( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
    {
        /* note: these are intra-frame heap memories */
@@ -3202,7 +3200,6 @@ ivas_error ivas_init_decoder_fx(
        }
        set32_fx( st_ivas->p_output_fx[n], 0, 48000 / FRAMES_PER_SEC );
    }

    FOR( ; n < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; n++ )
    {
        st_ivas->p_output_fx[n] = NULL;
Loading