Commit ea4d4587 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/float-pc' into 1368_ref_PortFlpMR1325

parents 5ced6fe9 c2f9dfb3
Loading
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -1508,7 +1508,23 @@ static bool parseCmdlIVAS_dec(
     * Mandatory input arguments
     *-----------------------------------------------------------------*/

    if ( i < argc - 3 )
    if ( i < argc - 4 )
    {
        for ( i = 1; i < argc; i++ )
        {
            if ( argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Wrong order of command-line arguments (optional arguments are first)\n\n" );
                usage_dec();
                return false;
            }
        }

        fprintf( stderr, "Error: Too many mandatory command-line arguments\n\n" );
        usage_dec();
        return false;
    }
    else if ( i < argc - 3 )
    {
        arg->outputConfig = cmdline2config( argv[i] );
        if ( arg->outputConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
+0 −2
Original line number Diff line number Diff line
@@ -320,9 +320,7 @@ typedef enum
#define ISM_Q_STEP                              2.5f
#define ISM_Q_STEP_BORDER                       5.0f

#ifdef NONBE_FIX_944_FEC_OMASA_1SEP_OBJ_MASA
#define ISM_FEC_MAX                             10
#endif

#define ISM_RADIUS_NBITS                        6 
#define ISM_RADIUS_MIN                          0.0f
+4 −0
Original line number Diff line number Diff line
@@ -5489,7 +5489,11 @@ void ivas_mono_dmx_renderer_close(
    MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer              /* i/ i/o: Mono downmix structure                       */
);

#ifdef NONBE_FIX_967_ISM_MONO_DMX
void ivas_ism_mono_dmx(
#else
void ivas_mono_downmix_render_passive(
#endif
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                */
    float *output_f[],                                          /* i/o: synthesized core-coder transport channels/mono output */
    const int16_t output_frame                                  /* i  : output frame length                                   */
+5 −3
Original line number Diff line number Diff line
@@ -160,7 +160,6 @@
#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO            /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */

#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/
#define FIX_954_OTR_REF_VEC                             /* FhG: Fix forward vector direction for OTR REF VEC mode */
#define NONBE_1211_DTX_BR_SWITCHING                     /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */
#define NONBE_FIX_1189_GSC_IVAS_OMASA                   /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
@@ -182,11 +181,14 @@
#define ISAR_BITSTREAM_UPDATE_LC3PLUS                   /* FhG: Multiple improvements to the ISAR bitstream when LC3plus is used. See MR 1456 for details. */
#endif
#define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM   /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */
#define NONBE_FIX_944_FEC_OMASA_1SEP_OBJ_MASA                 /* Nokia: issue 944: fix FEC error in OMASA */
#define NONBE_FIX_949_MC_5MS_FRAMING                    /*Dlb: Issue 949: fix for 5ms framing/rendering in MC mode */
#define NONBE_FIX_952_MC_PARAMUPMIX_5MS                       /* Dlb : issue 952 : Differences between 5ms and 20ms rendering for ParamUpmix*/
#define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER           /* Qualcomm: issue 953: fix order or ER channels in LC mode*/
#define FIX_955_FASTCONV_REND_IN_ISM                    /* VA: put FastConv rendering call under DEBUGGING */
#define NONBE_FIX_967_ISM_MONO_DMX                            /* FhG: issue 967: accumulating energies in ISM mono DMX */
#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX      /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/
#define FIX_959_MASA_LINEAR_REND                        /* VA: issue 959: remove unused calling of ivas_sba_linear_renderer() in MASA rendering */


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

/* clang-format on */
+111 −32
Original line number Diff line number Diff line
@@ -154,6 +154,24 @@ void ivas_ism_render_sf(
    float gain, prev_gain;
    float tc_local[MAX_NUM_OBJECTS][L_FRAME48k];
    float *p_tc[MAX_NUM_OBJECTS];
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    int16_t ism_md_subframe_update_jbm, slots_to_render, first_sf, last_sf, subframe_idx;
    int16_t n_samples_rendered_loop;
#endif

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */
    slots_to_render = min( st_ivas->hTcBuffer->num_slots - st_ivas->hTcBuffer->slots_rendered, n_samples_to_render / st_ivas->hTcBuffer->n_samples_granularity );
    first_sf = st_ivas->hTcBuffer->subframes_rendered;
    last_sf = first_sf;
    n_samples_rendered_loop = 0;

    while ( slots_to_render > 0 )
    {
        slots_to_render -= st_ivas->hTcBuffer->subframe_nbslots[last_sf];
        last_sf++;
    }
#endif

    num_objects = st_ivas->nchan_transport;
    if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
@@ -166,6 +184,18 @@ void ivas_ism_render_sf(
    tc_offset = st_ivas->hTcBuffer->n_samples_rendered;
    interp_offset = st_ivas->hTcBuffer->n_samples_rendered;

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    /* Number of subframes to delay metadata to sync with audio */
    if ( st_ivas->hDecoderConfig->Opt_delay_comp )
    {
        ism_md_subframe_update_jbm = max( 0, st_ivas->hTcBuffer->nb_subframes - 3 );
    }
    else
    {
        ism_md_subframe_update_jbm = st_ivas->hTcBuffer->nb_subframes - 2;
    }
#endif

    if ( st_ivas->hDecoderConfig->Opt_tsm )
    {
        for ( i = 0; i < num_objects; i++ )
@@ -187,9 +217,21 @@ void ivas_ism_render_sf(
        set_f( output_f[i], 0.0f, n_samples_to_render );
    }

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
    for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
    {
        int16_t n_samples_in_subframe;

        n_samples_in_subframe = st_ivas->hTcBuffer->n_samples_granularity * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx];
#endif

        if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 )
        {
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
            ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_in_subframe, n_samples_in_subframe, st_ivas->hIsmRendererData->interpolator );
#else
        ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
#endif
            interp_offset = 0;
        }

@@ -198,8 +240,18 @@ void ivas_ism_render_sf(
            /* Combined rotation: rotate the object positions depending the head and external orientations */
            if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[st_ivas->hCombinedOrientationData->subframe_idx] == 1 )
            {
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                if ( subframe_idx >= ism_md_subframe_update_jbm )
                {
                    rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup );
                }
                else
                {
                    rotateAziEle( st_ivas->hIsmMetaData[i]->last_azimuth, st_ivas->hIsmMetaData[i]->last_elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[st_ivas->hCombinedOrientationData->subframe_idx], st_ivas->hIntSetup.is_planar_setup );
                }
#else
            rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &azimuth, &elevation, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup );

#endif
                if ( st_ivas->hEFAPdata != NULL )
                {
                    efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], azimuth, elevation, EFAP_MODE_EFAP );
@@ -220,10 +272,18 @@ void ivas_ism_render_sf(
                {
                    g1 = &st_ivas->hIsmRendererData->interpolator[interp_offset];
                    tc = p_tc[i];
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                    for ( k = 0; k < n_samples_in_subframe; k++ )
#else
                for ( k = 0; k < n_samples_to_render; k++ )
#endif
                    {
                        g2 = 1.0f - *g1;
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
                        output_f[j2][k + n_samples_rendered_loop] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ );
#else
                    output_f[j2][k] += ( *( g1++ ) * gain + g2 * prev_gain ) * *( tc++ );
#endif
                    }
                }

@@ -233,10 +293,29 @@ void ivas_ism_render_sf(
                    st_ivas->hIsmRendererData->prev_gains[i][j] = gain;
                }
            }
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
            p_tc[i] += n_samples_in_subframe;
#endif
        }

        /* update combined orientation access index */
#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
        ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_in_subframe );
#else
    ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, n_samples_to_render );
#endif

#ifdef NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX
        n_samples_rendered_loop += n_samples_in_subframe;
        if ( st_ivas->renderer_type == RENDERER_TD_PANNING )
        {
            st_ivas->hTcBuffer->subframes_rendered += 1;
            st_ivas->hTcBuffer->slots_rendered += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx];
        }
        tc_offset += n_samples_in_subframe;
        interp_offset += n_samples_in_subframe;
    }
#endif

    return;
}
Loading