#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define ANALYSIS_C
#ifdef MLP_TRAINING
#include <stdio.h>
#endif
#include "mathops.h"
#include "kiss_fft.h"
#include "celt.h"
#include "modes.h"
#include "arch.h"
#include "quant_bands.h"
#include "analysis.h"
#include "mlp.h"
#include "stack_alloc.h"
#include "float_cast.h"
#ifndef M_PI
#define M_PI …
#endif
#ifndef DISABLE_FLOAT_API
#define TRANSITION_PENALTY …
static const float dct_table[128] = …;
static const float analysis_window[240] = …;
static const int tbands[NB_TBANDS+1] = …;
#define NB_TONAL_SKIP_BANDS …
static opus_val32 silk_resampler_down2_hp(
opus_val32 *S,
opus_val32 *out,
const opus_val32 *in,
int inLen
)
{ … }
static opus_val32 downmix_and_resample(downmix_func downmix, const void *_x, opus_val32 *y, opus_val32 S[3], int subframe, int offset, int c1, int c2, int C, int Fs)
{ … }
void tonality_analysis_init(TonalityAnalysisState *tonal, opus_int32 Fs)
{ … }
void tonality_analysis_reset(TonalityAnalysisState *tonal)
{ … }
void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, int len)
{ … }
static const float std_feature_bias[9] = …;
#define LEAKAGE_OFFSET …
#define LEAKAGE_SLOPE …
#ifdef FIXED_POINT
#define SCALE_COMPENS …
#define SCALE_ENER …
#else
#define SCALE_ENER(e) …
#endif
#ifdef FIXED_POINT
static int is_digital_silence32(const opus_val32* pcm, int frame_size, int channels, int lsb_depth)
{
int silence = 0;
opus_val32 sample_max = 0;
#ifdef MLP_TRAINING
return 0;
#endif
sample_max = celt_maxabs32(pcm, frame_size*channels);
silence = (sample_max == 0);
(void)lsb_depth;
return silence;
}
#else
#define is_digital_silence32(pcm, frame_size, channels, lsb_depth) …
#endif
static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt_mode, const void *x, int len, int offset, int c1, int c2, int C, int lsb_depth, downmix_func downmix)
{ … }
void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, const void *analysis_pcm,
int analysis_frame_size, int frame_size, int c1, int c2, int C, opus_int32 Fs,
int lsb_depth, downmix_func downmix, AnalysisInfo *analysis_info)
{ … }
#endif