Commit 449148c7 authored by Jan Kiene's avatar Jan Kiene
Browse files

add limiter on dmx for param MC

parent 557eb691
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -170,6 +170,16 @@ void ivas_limiter_close(
}


#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX
/*-------------------------------------------------------------------*
 * ivas_limiter_apply()
 *
 * In-place saturation control for multichannel buffers with adaptive
 * release time and special handling of bit errors
 *-------------------------------------------------------------------*/

void ivas_limiter_apply(
#else
/*-------------------------------------------------------------------*
 * ivas_limiter_dec()
 *
@@ -178,6 +188,7 @@ void ivas_limiter_close(
 *-------------------------------------------------------------------*/

void ivas_limiter_dec(
#endif
    IVAS_LIMITER_HANDLE hLimiter,       /* i/o: limiter struct handle                                           */
    float *output[MAX_OUTPUT_CHANNELS], /* i/o: input/output buffer                                             */
    const int16_t num_channels,         /* i  : number of channels to be processed                              */
+4 −0
Original line number Diff line number Diff line
@@ -6001,7 +6001,11 @@ void ivas_limiter_close(
    IVAS_LIMITER_HANDLE* phLimiter                              /* i/o: pointer to limiter handle, can be NULL  */
);

#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX
void ivas_limiter_apply
#else
void ivas_limiter_dec
#endif
(
    IVAS_LIMITER_HANDLE hLimiter,                               /* i/o: limiter struct handle                                           */
    float *output[MAX_OUTPUT_CHANNELS],                         /* i/o: input/output buffer                                             */
+25 −0
Original line number Diff line number Diff line
@@ -798,4 +798,29 @@ typedef struct ivas_param_ism_data_structure
    float last_cardioid_left[MAX_NUM_OBJECTS];

} PARAM_ISM_CONFIG_DATA, *PARAM_ISM_CONFIG_HANDLE;
#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX


/*----------------------------------------------------------------------------------*
 * Limiter structure
 *----------------------------------------------------------------------------------*/

typedef struct
{
    int16_t max_num_channels;
    int16_t num_channels;
    float **channel_ptrs;
    int32_t sampling_rate;
    float gain;
    float release_heuristic;
    float attack_constant;
    int16_t strong_saturation_count;
#ifdef DEBUGGING
    int32_t cnt_frames_limited; /* counter of frames in which the limiter is applied */
#endif

} IVAS_LIMITER, *IVAS_LIMITER_HANDLE;

#endif

#endif /* IVAS_STAT_COM */
+1 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@


#define NONBE_FIX_1165_STATIC_SCAL_PARAMMC              /* FhG: add static scaling to ParamMC DMX */
#define NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX     /* FhG: apply the limiter before the core encoder for formats with downmixing where the signal could exceed the 16-bit value range */

/* ##################### End NON-BE switches ########################### */

+8 −0
Original line number Diff line number Diff line
@@ -1546,7 +1546,11 @@ ivas_error ivas_jbm_dec_render(
        if ( st_ivas->ivas_format != MONO_FORMAT )
        {
#ifndef DISABLE_LIMITER
#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX
            ivas_limiter_apply( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect );
#else
            ivas_limiter_dec( st_ivas->hLimiter, p_output, nchan_out, *nSamplesRendered, st_ivas->BER_detect );
#endif
#endif
        }
    }
@@ -1812,7 +1816,11 @@ ivas_error ivas_jbm_dec_flush_renderer(
        if ( st_ivas->ivas_format != MONO_FORMAT )
        {
#ifndef DISABLE_LIMITER
#ifdef NONBE_FIX_1165_APPLY_LIMITER_ON_ENCODER_DMX
            ivas_limiter_apply( st_ivas->hLimiter, p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect );
#else
            ivas_limiter_dec( st_ivas->hLimiter, p_output, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect );
#endif
#endif
        }
    }
Loading