quantize_pvt.c File Reference

#include <config.h>
#include "lame.h"
#include "machine.h"
#include "encoder.h"
#include "util.h"
#include "quantize_pvt.h"
#include "lame_global_flags.h"
#include "reservoir.h"
#include "lame-analysis.h"
#include <float.h>

Include dependency graph for quantize_pvt.c:

Go to the source code of this file.

Defines

#define NSATHSCALE   100

Functions

static FLOAT ATHmdct (lame_global_flags const *gfp, FLOAT f)
static void compute_ath (lame_global_flags *gfp)
void iteration_init (lame_global_flags *gfp)
int on_pe (lame_global_flags const *gfp, FLOAT const pe[][2], III_side_info_t const *l3_side, int targ_bits[2], int mean_bits, int gr, int cbr)
void reduce_side (int targ_bits[2], FLOAT ms_ener_ratio, int mean_bits, int max_bits)
FLOAT athAdjust (FLOAT a, FLOAT x, FLOAT athFloor)
 Robert Hegemann 2001-04-27: this adjusts the ATH, keeping the original noise floor affects the higher frequencies more than the lower ones.
int calc_xmin (lame_global_flags const *gfp, III_psy_ratio const *const ratio, gr_info *const cod_info, FLOAT *pxmin)
FLOAT calc_noise_core_c (const gr_info *const cod_info, int *startline, int l, FLOAT step)
int calc_noise (gr_info const *const cod_info, FLOAT const *l3_xmin, FLOAT *distort, calc_noise_result *const res, calc_noise_data *prev_noise)
static void set_pinfo (lame_global_flags const *gfp, gr_info *const cod_info, const III_psy_ratio *const ratio, const int gr, const int ch)
void set_frame_pinfo (lame_global_flags const *gfp, III_psy_ratio const ratio[2][2])

Variables

const int nr_of_sfb_block [6][3][4]
const int pretab [SBMAX_l]
const scalefac_struct sfBandIndex [9]
FLOAT pow20 [Q_MAX+Q_MAX2+1]
FLOAT ipow20 [Q_MAX]
FLOAT pow43 [PRECALC_SIZE]
FLOAT adj43 [PRECALC_SIZE]


Define Documentation

#define NSATHSCALE   100

Definition at line 42 of file quantize_pvt.c.

Referenced by ATHmdct().


Function Documentation

FLOAT athAdjust ( FLOAT  a,
FLOAT  x,
FLOAT  athFloor 
)

Robert Hegemann 2001-04-27: this adjusts the ATH, keeping the original noise floor affects the higher frequencies more than the lower ones.

Definition at line 576 of file quantize_pvt.c.

References FAST_LOG10_X.

static FLOAT ATHmdct ( lame_global_flags const *  gfp,
FLOAT  f 
) [static]

Definition at line 212 of file quantize_pvt.c.

References ATHformula(), lame_global_struct::ATHlower, gfp, NSATHSCALE, PSY_NSPSYTUNE, and lame_global_struct::psymodel.

Referenced by compute_ath().

Here is the call graph for this function:

int calc_noise ( gr_info const *const   cod_info,
FLOAT const *  l3_xmin,
FLOAT distort,
calc_noise_result *const  res,
calc_noise_data prev_noise 
)

Definition at line 832 of file quantize_pvt.c.

References calc_noise_core_c(), FAST_LOG10, gr_info::global_gain, calc_noise_data_t::global_gain, Max, gr_info::max_nonzero_coeff, calc_noise_data_t::noise, calc_noise_data_t::noise_log, calc_noise_result_t::over_SSD, POW20, gr_info::preflag, pretab, gr_info::psymax, gr_info::scalefac, gr_info::scalefac_scale, calc_noise_data_t::step, gr_info::subblock_gain, gr_info::width, and gr_info::window.

Referenced by outer_loop(), set_pinfo(), and trancate_smallspectrums().

Here is the call graph for this function:

FLOAT calc_noise_core_c ( const gr_info *const   cod_info,
int *  startline,
int  l,
FLOAT  step 
)

Definition at line 767 of file quantize_pvt.c.

References gr_info::big_values, gr_info::count1, gr_info::l3_enc, pow43, and gr_info::xr.

Referenced by calc_noise().

int calc_xmin ( lame_global_flags const *  gfp,
III_psy_ratio const *const  ratio,
gr_info *const  cod_info,
FLOAT pxmin 
)

Definition at line 610 of file quantize_pvt.c.

References ATH_t::adjust, lame_internal_flags::ATH, athAdjust(), lame_global_struct::ATHonly, III_psy_ratio::en, f, ATH_t::floor, gfc, gfp, lame_global_struct::internal_flags, ATH_t::l, III_psy_xmin::l, nsPsy_t::longfact, lame_internal_flags::masking_lower, lame_internal_flags::nsPsy, gr_info::psy_lmax, SBPSY_l, III_psy_ratio::thm, lame_global_struct::VBR, vbr_mtrh, vbr_rh, gr_info::width, and gr_info::xr.

Referenced by ABR_iteration_loop(), CBR_iteration_loop(), set_pinfo(), VBR_new_prepare(), and VBR_old_prepare().

Here is the call graph for this function:

static void compute_ath ( lame_global_flags gfp  )  [static]

Definition at line 231 of file quantize_pvt.c.

References lame_internal_flags::ATH, ATHmdct(), FLOAT_MAX, ATH_t::floor, gfc, gfp, i, lame_global_struct::internal_flags, scalefac_struct::l, ATH_t::l, Min, lame_global_struct::noATH, lame_global_struct::out_samplerate, scalefac_struct::psfb12, PSFB12, ATH_t::psfb12, scalefac_struct::psfb21, PSFB21, ATH_t::psfb21, PSY_GPSYCHO, lame_global_struct::psymodel, scalefac_struct::s, ATH_t::s, SBMAX_l, SBMAX_s, and lame_internal_flags::scalefac_band.

Referenced by iteration_init().

Here is the call graph for this function:

void iteration_init ( lame_global_flags gfp  ) 

Definition at line 332 of file quantize_pvt.c.

References adj43, compute_ath(), lame_global_struct::exp_nspsytune, f, gfc, gfp, huffman_init(), i, init_xrpow_core_init(), lame_global_struct::internal_flags, ipow20, lame_internal_flags::iteration_init_init, lame_internal_flags::l3_side, III_side_info_t::main_data_begin, pow20, pow43, PRECALC_SIZE, PSY_NSPSYTUNE, lame_global_struct::psymodel, Q_MAX, Q_MAX2, quantize_init(), SBMAX_l, and SBMAX_s.

Referenced by lame_init_params().

Here is the call graph for this function:

int on_pe ( lame_global_flags const *  gfp,
FLOAT const   pe[][2],
III_side_info_t const *  l3_side,
int  targ_bits[2],
int  mean_bits,
int  gr,
int  cbr 
)

Definition at line 436 of file quantize_pvt.c.

References gr_info::block_type, lame_internal_flags::channels_out, gfc, gfp, lame_global_struct::internal_flags, MAX_BITS_PER_CHANNEL, MAX_BITS_PER_GRANULE, Min, PSY_NSPSYTUNE, lame_global_struct::psymodel, ResvMaxBits(), SHORT_TYPE, and III_side_info_t::tt.

Referenced by CBR_iteration_loop(), VBR_new_prepare(), and VBR_old_prepare().

Here is the call graph for this function:

void reduce_side ( int  targ_bits[2],
FLOAT  ms_ener_ratio,
int  mean_bits,
int  max_bits 
)

Definition at line 514 of file quantize_pvt.c.

References MAX_BITS_PER_CHANNEL, and MAX_BITS_PER_GRANULE.

Referenced by CBR_iteration_loop(), and VBR_old_prepare().

void set_frame_pinfo ( lame_global_flags const *  gfp,
III_psy_ratio const   ratio[2][2] 
)

Definition at line 1060 of file quantize_pvt.c.

References lame_internal_flags::channels_out, gfc, gfp, lame_global_struct::internal_flags, lame_internal_flags::l3_side, lame_internal_flags::masking_lower, memcpy, lame_internal_flags::mode_gr, gr_info::scalefac, set_pinfo(), SFBMAX, and III_side_info_t::tt.

Here is the call graph for this function:

static void set_pinfo ( lame_global_flags const *  gfp,
gr_info *const  cod_info,
const III_psy_ratio *const  ratio,
const int  gr,
const int  ch 
) [static]

Definition at line 950 of file quantize_pvt.c.

References lame_internal_flags::ATH, lame_global_struct::ATHonly, lame_global_struct::ATHshort, gr_info::block_type, calc_noise(), calc_xmin(), III_psy_ratio::en, plotting_data::en, plotting_data::en_s, gfc, gfp, i, lame_global_struct::internal_flags, ATH_t::l, III_psy_xmin::l, scalefac_struct::l, plotting_data::LAMEsfb, plotting_data::LAMEsfb_s, Max, gr_info::mixed_block_flag, lame_internal_flags::pinfo, gr_info::preflag, pretab, ATH_t::s, III_psy_xmin::s, scalefac_struct::s, SBMAX_s, SBPSY_l, SBPSY_s, gr_info::scalefac, lame_internal_flags::scalefac_band, gr_info::scalefac_scale, gr_info::sfb_lmax, gr_info::sfb_smin, SFBMAX, SHORT_TYPE, gr_info::subblock_gain, III_psy_ratio::thm, plotting_data::thr, plotting_data::thr_s, plotting_data::xfsf, plotting_data::xfsf_s, and gr_info::xr.

Referenced by set_frame_pinfo().

Here is the call graph for this function:


Variable Documentation

FLOAT adj43[PRECALC_SIZE]

Definition at line 179 of file quantize_pvt.c.

Referenced by iteration_init().

FLOAT ipow20[Q_MAX]

Definition at line 173 of file quantize_pvt.c.

Referenced by calc_sfb_noise_ISO(), calc_sfb_noise_x34(), find_lowest_scalefac(), iteration_init(), quantize_ISO(), and quantize_x34().

const int nr_of_sfb_block[6][3][4]

Definition at line 52 of file quantize_pvt.c.

Referenced by scale_bitcount_lsf().

FLOAT pow20[Q_MAX+Q_MAX2+1]

Definition at line 172 of file quantize_pvt.c.

Referenced by calc_sfb_noise_ISO(), calc_sfb_noise_x34(), and iteration_init().

FLOAT pow43[PRECALC_SIZE]

Definition at line 174 of file quantize_pvt.c.

Referenced by calc_noise_core_c(), calc_sfb_noise_ISO(), calc_sfb_noise_x34(), and iteration_init().

const int pretab[SBMAX_l]

Initial value:

 {
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0
}

Definition at line 87 of file quantize_pvt.c.

Referenced by calc_noise(), checkScalefactor(), inc_scalefac_scale(), long_block_constrain(), quantize_ISO(), quantize_x34(), quantize_xrpow(), scale_bitcount(), set_pinfo(), and set_scalefacs().

const scalefac_struct sfBandIndex[9]

Definition at line 101 of file quantize_pvt.c.

Referenced by lame_init_params().


Generated on Sun Dec 2 11:36:49 2007 for LAME by  doxygen 1.5.2