#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lame.h"
#include "machine.h"
#include "gain_analysis.h"
Include dependency graph for gain_analysis.c:
Go to the source code of this file.
Functions | |
static void | filterYule (const Float_t *input, Float_t *output, size_t nSamples, const Float_t *const kernel) |
static void | filterButter (const Float_t *input, Float_t *output, size_t nSamples, const Float_t *const kernel) |
int | ResetSampleFrequency (replaygain_t *rgData, long samplefreq) |
int | InitGainAnalysis (replaygain_t *rgData, long samplefreq) |
static double | fsqr (const double d) |
int | AnalyzeSamples (replaygain_t *rgData, const Float_t *left_samples, const Float_t *right_samples, size_t num_samples, int num_channels) |
static Float_t | analyzeResult (uint32_t const *Array, size_t len) |
Float_t | GetTitleGain (replaygain_t *rgData) |
Float_t | GetAlbumGain (replaygain_t *rgData) |
Variables | |
static const Float_t | ABYule [9][2 *YULE_ORDER+1] |
static const Float_t | ABButter [9][2 *BUTTER_ORDER+1] |
static Float_t analyzeResult | ( | uint32_t const * | Array, | |
size_t | len | |||
) | [static] |
Definition at line 455 of file gain_analysis.c.
References GAIN_NOT_ENOUGH_SAMPLES, i, PINK_REF, RMS_PERCENTILE, and STEPS_per_dB.
Referenced by GetAlbumGain(), and GetTitleGain().
int AnalyzeSamples | ( | replaygain_t * | rgData, | |
const Float_t * | left_samples, | |||
const Float_t * | right_samples, | |||
size_t | num_samples, | |||
int | num_channels | |||
) |
Definition at line 318 of file gain_analysis.c.
References replaygain_data::A, ABButter, ABYule, BUTTER_FILTER, replaygain_data::freqindex, fsqr(), GAIN_ANALYSIS_ERROR, GAIN_ANALYSIS_OK, i, replaygain_data::linpre, replaygain_data::linprebuf, replaygain_data::lout, replaygain_data::loutbuf, replaygain_data::lstep, replaygain_data::lstepbuf, replaygain_data::lsum, MAX_ORDER, memcpy, memmove, replaygain_data::rinpre, replaygain_data::rinprebuf, replaygain_data::rout, replaygain_data::routbuf, replaygain_data::rstep, replaygain_data::rstepbuf, replaygain_data::rsum, replaygain_data::sampleWindow, STEPS_per_dB, replaygain_data::totsamp, and YULE_FILTER.
Referenced by copy_buffer().
Here is the call graph for this function:
static void filterButter | ( | const Float_t * | input, | |
Float_t * | output, | |||
size_t | nSamples, | |||
const Float_t *const | kernel | |||
) | [static] |
Definition at line 214 of file gain_analysis.c.
static void filterYule | ( | const Float_t * | input, | |
Float_t * | output, | |||
size_t | nSamples, | |||
const Float_t *const | kernel | |||
) | [static] |
Definition at line 180 of file gain_analysis.c.
static double fsqr | ( | const double | d | ) | [inline, static] |
Float_t GetAlbumGain | ( | replaygain_t * | rgData | ) |
Definition at line 504 of file gain_analysis.c.
References analyzeResult(), and replaygain_data::B.
Here is the call graph for this function:
Float_t GetTitleGain | ( | replaygain_t * | rgData | ) |
Definition at line 478 of file gain_analysis.c.
References replaygain_data::A, analyzeResult(), replaygain_data::B, i, replaygain_data::linprebuf, replaygain_data::loutbuf, replaygain_data::lstepbuf, replaygain_data::lsum, MAX_ORDER, replaygain_data::rinprebuf, replaygain_data::routbuf, replaygain_data::rstepbuf, replaygain_data::rsum, and replaygain_data::totsamp.
Referenced by flush_bitstream().
Here is the call graph for this function:
int InitGainAnalysis | ( | replaygain_t * | rgData, | |
long | samplefreq | |||
) |
Definition at line 291 of file gain_analysis.c.
References replaygain_data::B, INIT_GAIN_ANALYSIS_ERROR, INIT_GAIN_ANALYSIS_OK, replaygain_data::linpre, replaygain_data::linprebuf, replaygain_data::lout, replaygain_data::loutbuf, replaygain_data::lstep, replaygain_data::lstepbuf, MAX_ORDER, ResetSampleFrequency(), replaygain_data::rinpre, replaygain_data::rinprebuf, replaygain_data::rout, replaygain_data::routbuf, replaygain_data::rstep, and replaygain_data::rstepbuf.
Referenced by lame_init_params().
Here is the call graph for this function:
int ResetSampleFrequency | ( | replaygain_t * | rgData, | |
long | samplefreq | |||
) |
Definition at line 233 of file gain_analysis.c.
References replaygain_data::A, replaygain_data::freqindex, i, INIT_GAIN_ANALYSIS_ERROR, INIT_GAIN_ANALYSIS_OK, replaygain_data::linprebuf, replaygain_data::loutbuf, replaygain_data::lstepbuf, replaygain_data::lsum, MAX_ORDER, replaygain_data::rinprebuf, RMS_WINDOW_TIME_DENOMINATOR, RMS_WINDOW_TIME_NUMERATOR, replaygain_data::routbuf, replaygain_data::rstepbuf, replaygain_data::rsum, replaygain_data::sampleWindow, and replaygain_data::totsamp.
Referenced by InitGainAnalysis().
Initial value:
{ {0.98621192462708, -1.97223372919527, -1.97242384925416, 0.97261396931306, 0.98621192462708}, {0.98500175787242, -1.96977855582618, -1.97000351574484, 0.97022847566350, 0.98500175787242}, {0.97938932735214, -1.95835380975398, -1.95877865470428, 0.95920349965459, 0.97938932735214}, {0.97531843204928, -1.95002759149878, -1.95063686409857, 0.95124613669835, 0.97531843204928}, {0.97316523498161, -1.94561023566527, -1.94633046996323, 0.94705070426118, 0.97316523498161}, {0.96454515552826, -1.92783286977036, -1.92909031105652, 0.93034775234268, 0.96454515552826}, {0.96009142950541, -1.91858953033784, -1.92018285901082, 0.92177618768381, 0.96009142950541}, {0.95856916599601, -1.91542108074780, -1.91713833199203, 0.91885558323625, 0.95856916599601}, {0.94597685600279, -1.88903307939452, -1.89195371200558, 0.89487434461664, 0.94597685600279} }
Definition at line 159 of file gain_analysis.c.
Referenced by AnalyzeSamples().