Commit a0d60297 authored by bayers's avatar bayers
Browse files

WSOLA TSM is now working with float in/out buffers (internally it was always...

WSOLA TSM is now working with float in/out buffers (internally it was always float anyway), fixed a few rendering paths
parent ababf3f4
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -206,7 +206,10 @@ typedef enum
#define MAX_CLDFB_DIGEST_CHANNELS               4
typedef enum
{
    TC_BUFFER_MODE_FULL=1,
    TC_BUFFER_MODE_NONE = 0,
    TC_BUFFER_MODE_RENDERER,
    TC_BUFFER_MODE_OUT,
    TC_BUFFER_MODE_FULL,
    TC_BUFFER_MODE_RESIDUAL  
} TC_BUFFER_MODE;
#endif
+22 −7
Original line number Diff line number Diff line
@@ -283,6 +283,15 @@ uint32_t ivas_syn_output(
    int16_t *synth_out                                          /* o  : integer 16 bits synthesis signal        */
);

#ifdef FLOAT_TSM
void ivas_syn_output_f(
    float *synth[], /* i/o: float synthesis signal              */
    const int16_t output_frame, /* i  : output frame length (one channel)   */
    const int16_t n_channels,   /* i  : number of output channels           */
    float *synth_out          /* o  : integer 16 bits synthesis signal    */
    );
#endif

void ivas_initialize_handles_enc(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
@@ -799,7 +808,11 @@ void dtx_read_padding_bits(

ivas_error ivas_jbm_dec_tc(
    Decoder_Struct *st_ivas,    /* i/o: IVAS decoder structure               */
#ifdef FLOAT_TSM
    float *data                 /* o  : output synthesis signal              */
#else
    int16_t *data               /* o  : output synthesis signal              */
#endif
);

ivas_error ivas_jbm_dec_render(
@@ -815,7 +828,11 @@ ivas_error ivas_jbm_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*/
#ifdef FLOAT_TSM
    float *data                       /* i/o: transport channels/output synthesis signal     */
#else
    int16_t *data                       /* i/o: transport channels/output synthesis signal     */
#endif
);

void ivas_jbm_dec_get_adapted_linear_interpolator(
@@ -841,18 +858,16 @@ void ivas_jbm_dec_get_md_map(

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

void ivas_jbm_dec_copy_tc(
    Decoder_Struct *st_ivas,            /* i/o: IVAS decoder structure       */
    const int16_t nSamplesForRendering, /* i  : number of samples to digest  */
    int16_t *nSamplesResidual,
    int16_t *data,                      /* i  : transport channel samples    */
    float *data_f[]                     /* i/o: transport channel samples    */
TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( 
    Decoder_Struct *st_ivas 
);

ivas_error ivas_jbm_dec_tc_buffer_open(
    Decoder_Struct *st_ivas,
    const TC_BUFFER_MODE tc_buffer_mode,
    const int16_t nchan_transport_jbm,
    const int16_t nchan_transport_internal,
    const int16_t nchan_full,
    const int16_t n_samples_granularity 
);

+35 −1
Original line number Diff line number Diff line
@@ -163,6 +163,40 @@ uint32_t ivas_syn_output(
    return noClipping;
}

#ifdef FLOAT_TSM
/*-------------------------------------------------------------------*
 * ivas_syn_output()
 *
 * Output ivas synthesis signal with compensation for saturation
 * returns number of clipped samples
 *-------------------------------------------------------------------*/

/*! r: number of clipped samples */
void ivas_syn_output_f(
    float *synth[], /* i/o: float synthesis signal              */
    const int16_t output_frame, /* i  : output frame length (one channel)   */
    const int16_t n_channels,   /* i  : number of output channels           */
    float *synth_out          /* o  : integer 16 bits synthesis signal    */
)
{
    int16_t i, n;

    /*-----------------------------------------------------------------*
     * float to integer conversion with saturation control
     *-----------------------------------------------------------------*/

    for ( n = 0; n < n_channels; n++ )
    {
        for ( i = 0; i < output_frame; i++ )
        {
            synth_out[i * n_channels + n] = synth[n][i];
        }
    }

    return;
}
#endif

/*-------------------------------------------------------------------*
 * mvr2r_inc()
 *
+2 −0
Original line number Diff line number Diff line
@@ -171,8 +171,10 @@
#define JBM_MCMASA
#define JBM_ISM
#define JBM_PARAM_ISM
#define TEST_BIN_RENDERER_BE
/*#define JBM_DIRAC_DEBUG_BE*/
#define JBM_DEV  /*remove after all formats work...*/
#define FLOAT_TSM                                       /* FhG: WSOLA TSM on float values instead of 16 bit PCM */
#endif
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+5 −1
Original line number Diff line number Diff line
@@ -391,7 +391,11 @@ uint32_t mvr2s(
        return 0;
    }

#ifdef FLOAT_TSM
    if ( (void *) y <= (const void *) x )
#else
    if ( (void *) y < (const void *) x )
#endif
    {
        for ( i = 0; i < n; i++ )
        {
Loading