Commit 0b14a5fe authored by vaclav's avatar vaclav
Browse files

Merge branch '880-functions-renaming-after-nonbe_unified_decoding_paths' into 'main'

Resolve "Functions renaming and leftovers after NONBE_UNIFIED_DECODING_PATHS"

See merge request !1246
parents 8174126e 1ce53d0c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -167,11 +167,11 @@ typedef enum
#define IVAS_NUM_SUPPORTED_FS                   3                           /* number of supported sampling-rates in IVAS */

#define CLDFB_SLOT_NS                           1250000L                    /* 1.25ms: CLDFB slot length */
#define MAX_JBM_SUBFRAMES_5MS                   8
#define DEFAULT_JBM_SUBFRAMES_5MS               4
#define JBM_CLDFB_SLOTS_IN_SUBFRAME             4
#define MAX_JBM_CLDFB_TIMESLOTS                 32
#define DEFAULT_JBM_CLDFB_TIMESLOTS             16
#define DEFAULT_JBM_SUBFRAMES_5MS               4                           /* == IVAS_MAX_PARAM_SPATIAL_SUBFRAMES */
#define MAX_JBM_SUBFRAMES_5MS                   ( DEFAULT_JBM_SUBFRAMES_5MS * 2 )
#define JBM_CLDFB_SLOTS_IN_SUBFRAME             4                           /* == IVAS_MAX_PARAM_SPATIAL_SUBFRAMES */
#define DEFAULT_JBM_CLDFB_TIMESLOTS             CLDFB_NO_COL_MAX
#define MAX_JBM_CLDFB_TIMESLOTS                 ( DEFAULT_JBM_CLDFB_TIMESLOTS * 2 )
#define MAX_JBM_L_FRAME48k                      ( IVAS_MAX_FRAME_SIZE * 2 ) /* 1920:  max. time-scaled frame buffer length (per channel) in samples */
#define MAX_JBM_L_FRAME_NS                      40000000L                   /* 40 ms: time-scaled frame size in ns, proportional to MAX_JBM_L_FRAME48k  */
#define MAX_SPAR_INTERNAL_CHANNELS              IVAS_SPAR_MAX_CH
+39 −39
Original line number Diff line number Diff line
@@ -322,11 +322,24 @@ void stereo_dmx_evs_close_encoder(
    STEREO_DMX_EVS_ENC_HANDLE *hStereoDmxEVS                    /* i/o: Stereo downmix for EVS encoder handle   */
);

ivas_error ivas_dec(
    Decoder_Struct *st_ivas,                                    /* i  : IVAS decoder structure                  */
ivas_error ivas_dec_tmp( // this will be removed in the following step
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    int16_t *data                                               /* o  : output synthesis signal                 */
);

ivas_error ivas_dec(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);

ivas_error ivas_dec_render(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const uint16_t nSamplesAsked,                               /* i  : number of samples wanted                */
    uint16_t *nSamplesRendered,                                 /* o  : number of samples rendered              */
    uint16_t *nSamplesAvailableNext,                            /* o  : number of samples still available in the rendering pipeline */
    const PCM_RESOLUTION pcm_resolution,                        /* i  : type for the decoded PCM resolution     */
    void *data                                                  /* o  : output synthesis signal                 */
);

ivas_error ivas_dec_get_format(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);
@@ -813,22 +826,9 @@ void QuaternionInverse(


/*----------------------------------------------------------------------------------*
 * JBM prototypes
 * Internal rendering prototypes
 *----------------------------------------------------------------------------------*/

ivas_error ivas_jbm_dec_tc(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                                      */
);

ivas_error ivas_jbm_dec_render(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const uint16_t nSamplesAsked,                               /* i  : number of samples wanted                                    */
    uint16_t *nSamplesRendered,                                 /* o  : number of samples rendered                                  */
    uint16_t *nSamplesAvailableNext,                            /* o  : number of samples still available in the rendering pipeline */
    const PCM_RESOLUTION pcm_resolution,                        /* i  : type for the decoded PCM resolution                         */
    void *data                                                  /* o  : output synthesis signal                                     */
);

ivas_error ivas_jbm_dec_flush_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const int16_t tc_granularity_new,                           /* i  : new renderer granularity                                    */
@@ -842,7 +842,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
    void *data                                                  /* o  : output synthesis signal                                     */
);

void ivas_jbm_dec_feed_tc_to_renderer(
void ivas_dec_feed_tc_to_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const int16_t nSamplesForRendering,                         /* i  : number of TC samples available for rendering                */
    int16_t *nSamplesResidual                                   /* o  : number of samples not fitting into the renderer grid and buffer for the next call*/
@@ -856,77 +856,77 @@ ivas_error ivas_jbm_dec_set_discard_samples(
    Decoder_Struct *st_ivas                                     /* i/o: main IVAS decoder structre                                  */
);

void ivas_jbm_dec_get_adapted_linear_interpolator(
void ivas_dec_get_adapted_linear_interpolator(
    const int16_t default_interp_length,                        /* i  : default length of the (full-frame) interpolator             */
    const int16_t interp_length,                                /* i  : length of the interpolator to be created                    */
    float *interpolator                                         /* o  : the interpolator                                            */
);

void ivas_jbm_dec_get_adapted_subframes(
void ivas_dec_get_adapted_subframes(
    const int16_t nCldfbTs,                                     /* i  : number of time slots in the current frame                   */
    int16_t *subframe_nbslots,                                  /* i/o: subframe grid                                               */
    int16_t *nb_subframes                                       /* i/o: number of subframes in the frame                            */
);

void ivas_jbm_dec_get_md_map(
void ivas_dec_get_md_map(
    const int16_t default_len,                                  /* i  : default frame length in metadata slots                      */
    const int16_t len,                                          /* i  : length of the modfied frames in metadata slots              */
    const int16_t len,                                          /* i  : length of the modified frames in metadata slots             */
    const int16_t subframe_len,                                 /* i  : default length of a subframe                                */
    const int16_t offset,                                       /* i  : current read offset into the md buffer                      */
    const int16_t offset,                                       /* i  : current read offset into the MD buffer                      */
    const int16_t buf_len,                                      /* i  : length of the metadata buffer                               */
    int16_t *map                                                /* o  : metadata index map                                          */
);

int16_t ivas_jbm_dec_get_num_tc_channels( 
int16_t ivas_dec_get_num_tc_channels( 
    Decoder_Struct *st_ivas                                     /* i  : IVAS decoder handle                                         */
);

void ivas_jbm_dec_get_md_map_even_spacing(
    const int16_t len,                                          /* i  : length of the modfied frames in metadata slots              */
void ivas_dec_get_md_map_even_spacing(
    const int16_t len,                                          /* i  : length of the modefied frames in metadata slots             */
    const int16_t subframe_len,                                 /* i  : default length of a subframe                                */
    const int16_t offset,                                       /* i  : current read offset into the md buffer                      */
    const int16_t offset,                                       /* i  : current read offset into the MD buffer                      */
    const int16_t buf_len,                                      /* i  : length of the metadata buffer                               */
    int16_t *map                                                /* o  : metadata index map                                          */
);

TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode(
TC_BUFFER_MODE ivas_dec_get_tc_buffer_mode(
    Decoder_Struct *st_ivas                                     /* i  : IVAS decoder handle                                         */
);

/*! r: render granularity */
int16_t ivas_jbm_dec_get_render_granularity(
int16_t ivas_dec_get_render_granularity(
    const RENDERER_TYPE renderer_type,                          /* i  : renderer type                                               */
    const RENDERER_TYPE renderer_type_sec,                      /* i  : secondary renderer type                                     */
    const int32_t output_Fs                                     /* i  : sampling rate                                               */
);

ivas_error ivas_jbm_dec_tc_buffer_open(
ivas_error ivas_dec_tc_buffer_open(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const TC_BUFFER_MODE tc_buffer_mode,                        /* i  : buffer mode                                                 */
    const int16_t nchan_transport_jbm,                          /* i  : number of real transport channels                           */
    const int16_t nchan_transport_rend,                         /* i  : new number of TCs for rendering                             */
    const int16_t nchan_transport_internal,                     /* i  : number of totally buffered channels                         */
    const int16_t nchan_full,                                   /* i  : number of channels to fully store                           */
    const int16_t n_samples_granularity                         /* i  : granularity of the renderer/buffer                          */
);

ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
ivas_error ivas_dec_tc_buffer_reconfigure(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                      */
    const TC_BUFFER_MODE tc_buffer_mode,                        /* i  : new buffer mode                                             */
    const int16_t nchan_transport_jbm,                          /* i  : new number of real transport channels                       */
    const int16_t nchan_transport_rend,                         /* i  : new number of TCs for rendering                             */
    const int16_t nchan_transport_internal,                     /* i  : new number of totally buffered channels                     */
    const int16_t nchan_full,                                   /* i  : new number of channels to fully store                       */
    const int16_t n_samples_granularity                         /* i  : new granularity of the renderer/buffer                      */
);

void ivas_jbm_dec_tc_buffer_close(
void ivas_dec_tc_buffer_close(
    DECODER_TC_BUFFER_HANDLE *phTcBuffer                        /* i/o: TC buffer handle                                            */
);

void ivas_jbm_dec_td_renderers_adapt_subframes(
void ivas_dec_td_renderers_adapt_subframes(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                                      */
);

ivas_error ivas_jbm_dec_metadata_open(
ivas_error ivas_jbm_dec_masa_metadata_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                                      */
);

@@ -5578,7 +5578,7 @@ ivas_error ivas_osba_data_open(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder handle                     */
);

ivas_error ivas_osba_dirac_td_binaural_jbm(
ivas_error ivas_osba_dirac_td_binaural(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const uint16_t nSamplesAsked,                               /* i  : number of CLDFB slots requested         */
    uint16_t *nSamplesRendered,                                 /* o  : number of CLDFB slots rendered          */
@@ -5746,7 +5746,7 @@ ivas_error ivas_omasa_ism_metadata_dec(
    int16_t nb_bits_metadata[]                                  /* o  : number of ISM metadata bits             */
);

ivas_error ivas_omasa_dirac_td_binaural_jbm(
ivas_error ivas_omasa_dirac_td_binaural(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                     */
    const uint16_t nSamplesAsked,                               /* i  : number of samples requested             */
    uint16_t *nSamplesRendered,                                 /* o  : number of samples rendered              */
@@ -5790,7 +5790,7 @@ void ivas_omasa_gain_masa_tc(
    const int16_t output_frame                                  /* i  : output frame length per channel         */
);

void ivas_omasa_dirac_rend_jbm(
void ivas_omasa_dirac_rend(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                     */
    const uint16_t nSamplesAsked,                               /* i  : number of samples requested             */
    uint16_t *nSamplesRendered,                                 /* o  : number of samples rendered              */
@@ -5815,7 +5815,7 @@ void ivas_omasa_separate_object_renderer_close(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                  */
);

void ivas_omasa_separate_object_render_jbm(
void ivas_omasa_separate_object_render(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                  */
    const uint16_t nSamplesRendered,                            /* i  : number of samples rendered              */
    float input_f[][L_FRAME48k],                                /* i  : separated object signal                 */
+1 −1
Original line number Diff line number Diff line
@@ -2011,7 +2011,7 @@ void generate_masking_noise_lb_dirac(
            n_samples_start += hFdCngCom->frameSize;
        }

        /* move generated noise to the 5ms subframe starts in the tc buffer according to the output sampling frequency to avoid
        /* move generated noise to the 5ms subframe starts in the TC buffer according to the output sampling frequency to avoid
           overwriting it with the synthesis in case of shared tc and synth channel memory, i.e. non-TSM mode */
        slot_size_cng = hFdCngCom->frameSize / DEFAULT_JBM_CLDFB_TIMESLOTS;
        /* move start indices forward to the end of the last subframe */
+2 −2
Original line number Diff line number Diff line
@@ -51,12 +51,12 @@
 * Principal IVAS decoder routine
 *--------------------------------------------------------------------------*/

ivas_error ivas_dec(
ivas_error ivas_dec_tmp(     // this will be removed in the following step
    Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure      */
    int16_t *data            /* o  : output synthesis signal     */
)
{
    // TODO: move here function ivas_jbm_dec_tc() and rename it to ivas_dec()
    // TODO: move here function ivas_dec()
    st_ivas->ivas_format = UNDEFINED_FORMAT; // temp. to avoid compilation warnings
    data[0] = 0;                             // temp. to avoid compilation warnings

+6 −7
Original line number Diff line number Diff line
@@ -1484,9 +1484,9 @@ void ivas_dirac_dec_set_md_map(
    num_slots_in_subfr = CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES;
    hSpatParamRendCom->subframes_rendered = 0;

    ivas_jbm_dec_get_adapted_subframes( nCldfbTs, hSpatParamRendCom->subframe_nbslots, &hSpatParamRendCom->nb_subframes );
    ivas_dec_get_adapted_subframes( nCldfbTs, hSpatParamRendCom->subframe_nbslots, &hSpatParamRendCom->nb_subframes );

    /* copy also to tc buffer */
    /* copy also to TC buffer */
    /* only for non-combined formats and combinded formats w/o discrete objects */
    if ( ( st_ivas->ivas_format != MASA_ISM_FORMAT || st_ivas->ism_mode != ISM_MASA_MODE_DISC ) && !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) )
    {
@@ -1495,20 +1495,19 @@ void ivas_dirac_dec_set_md_map(
    }

    /* set mapping according to dirac_read_idx */

    set_s( hSpatParamRendCom->render_to_md_map, 0, MAX_JBM_SUBFRAMES_5MS * JBM_CLDFB_SLOTS_IN_SUBFRAME );

    if ( st_ivas->ivas_format == MASA_FORMAT )
    {
        ivas_jbm_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
        ivas_dec_get_md_map_even_spacing( nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
    }
    else if ( hDirAC == NULL || hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
    {
        ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
        ivas_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, 0, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
    }
    else
    {
        ivas_jbm_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, hSpatParamRendCom->dirac_read_idx, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
        ivas_dec_get_md_map( DEFAULT_JBM_CLDFB_TIMESLOTS, nCldfbTs, num_slots_in_subfr, hSpatParamRendCom->dirac_read_idx, hSpatParamRendCom->dirac_md_buffer_length, hSpatParamRendCom->render_to_md_map );
    }

    if ( hDirAC == NULL || hDirAC->hConfig == NULL || hDirAC->hConfig->dec_param_estim == 0 )
@@ -2313,7 +2312,7 @@ void ivas_dirac_dec_render_sf(

            if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] )
            {
                ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
                ivas_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
                st_ivas->hIsmRendererData->interp_offset = 0;
            }

Loading