| 1 | /* |
| 2 | * quantize_pvt include file |
| 3 | * |
| 4 | * Copyright (c) 1999 Takehiro TOMINAGA |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public |
| 17 | * License along with this library; if not, write to the |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef LAME_QUANTIZE_PVT_H |
| 23 | #define LAME_QUANTIZE_PVT_Hcxx . . $ `external/lame/quantize_pvt.h:23:9`! |
| 24 | |
| 25 | #define IXMAX_VALcxx . . $ `external/lame/quantize_pvt.h:25:9`! 8206 /* ix always <= 8191+15. see count_bits() */ |
| 26 | |
| 27 | /* buggy Winamp decoder cannot handle values > 8191 */ |
| 28 | /* #define IXMAX_VAL 8191 */ |
| 29 | |
| 30 | #define PRECALC_SIZEcxx . . $ `external/lame/quantize_pvt.h:30:9`! (IXMAX_VALcxx . . $ `external/lame/quantize_pvt.h:25:9`!+2) |
| 31 | |
| 32 | |
| 33 | extern const int nr_of_sfb_blockcxx . . $ nr_of_sfb_block.[6][3][4]; |
| 34 | extern const int pretabcxx . . $ pretab.[SBMAX_lcxx . . $ `external/lame/encoder.h:103:9`!]; |
| 35 | extern const int slen1_tabcxx . . $ slen1_tab.[16]; |
| 36 | extern const int slen2_tabcxx . . $ slen2_tab.[16]; |
| 37 | |
| 38 | extern const scalefac_structcxx . . $ scalefac_struct# sfBandIndexcxx . . $ sfBandIndex.[9]; |
| 39 | |
| 40 | extern FLOATcxx . . $ FLOAT# pow43cxx . . $ pow43.[PRECALC_SIZEcxx . . $ `external/lame/quantize_pvt.h:30:9`!]; |
| 41 | #ifdef TAKEHIRO_IEEE754_HACKcxx . . $ `external/lame/lame__config.h:286:9`! |
| 42 | extern FLOATcxx . . $ FLOAT# adj43asmcxx . . $ adj43asm.[PRECALC_SIZEcxx . . $ `external/lame/quantize_pvt.h:30:9`!]; |
| 43 | #else |
| 44 | extern FLOAT adj43[PRECALC_SIZE]; |
| 45 | #endif |
| 46 | |
| 47 | #define Q_MAXcxx . . $ `external/lame/quantize_pvt.h:47:9`! (256+1) |
| 48 | #define Q_MAX2cxx . . $ `external/lame/quantize_pvt.h:48:9`! 116 /* minimum possible number of |
| 49 | -cod_info->global_gain |
| 50 | + ((scalefac[] + (cod_info->preflag ? pretab[sfb] : 0)) |
| 51 | << (cod_info->scalefac_scale + 1)) |
| 52 | + cod_info->subblock_gain[cod_info->window[sfb]] * 8; |
| 53 | |
| 54 | for long block, 0+((15+3)<<2) = 18*4 = 72 |
| 55 | for short block, 0+(15<<2)+7*8 = 15*4+56 = 116 |
| 56 | */ |
| 57 | |
| 58 | extern FLOATcxx . . $ FLOAT# pow20cxx . . $ pow20.[Q_MAXcxx . . $ `external/lame/quantize_pvt.h:47:9`! + Q_MAX2cxx . . $ `external/lame/quantize_pvt.h:48:9`! + 1]; |
| 59 | extern FLOATcxx . . $ FLOAT# ipow20cxx . . $ ipow20.[Q_MAXcxx . . $ `external/lame/quantize_pvt.h:47:9`!]; |
| 60 | |
| 61 | typedef struct calc_noise_result_tcxx . . $ calc_noise_result_t# { |
| 62 | FLOATcxx . . $ FLOAT# over_noisecxx . . $ calc_noise_result_t#over_noise.; /* sum of quantization noise > masking */ |
| 63 | FLOATcxx . . $ FLOAT# tot_noisecxx . . $ calc_noise_result_t#tot_noise.; /* sum of all quantization noise */ |
| 64 | FLOATcxx . . $ FLOAT# max_noisecxx . . $ calc_noise_result_t#max_noise.; /* max quantization noise */ |
| 65 | int over_countcxx . . $ calc_noise_result_t#over_count.; /* number of quantization noise > masking */ |
| 66 | int over_SSDcxx . . $ calc_noise_result_t#over_SSD.; /* SSD-like cost of distorted bands */ |
| 67 | int bitscxx . . $ calc_noise_result_t#bits.; |
| 68 | } calc_noise_resultcxx . . $ calc_noise_result#; |
| 69 | |
| 70 | |
| 71 | /** |
| 72 | * allows re-use of previously |
| 73 | * computed noise values |
| 74 | */ |
| 75 | typedef struct calc_noise_data_tcxx . . $ calc_noise_data_t# { |
| 76 | int global_gaincxx . . $ calc_noise_data_t#global_gain.; |
| 77 | int sfb_count1cxx . . $ calc_noise_data_t#sfb_count1.; |
| 78 | int stepcxx . . $ calc_noise_data_t#step.[39]; |
| 79 | FLOATcxx . . $ FLOAT# noisecxx . . $ calc_noise_data_t#noise.[39]; |
| 80 | FLOATcxx . . $ FLOAT# noise_logcxx . . $ calc_noise_data_t#noise_log.[39]; |
| 81 | } calc_noise_datacxx . . $ calc_noise_data#; |
| 82 | |
| 83 | |
| 84 | int on_pecxx . . $ on_pe(2fe9c54108dac159).(lame_internal_flagscxx . . $ lame_internal_flags# * gfc, const FLOATcxx . . $ FLOAT# pe[2][2], |
| 85 | int targ_bits[2], int mean_bits, int gr, int cbr); |
| 86 | |
| 87 | void reduce_sidecxx . . $ reduce_side(442a8dec85e6493).(int targ_bits[2], FLOATcxx . . $ FLOAT# ms_ener_ratio, int mean_bits, int max_bits); |
| 88 | |
| 89 | |
| 90 | void iteration_initcxx . . $ iteration_init(4f558d83b2842a93).(lame_internal_flagscxx . . $ lame_internal_flags# * gfc); |
| 91 | |
| 92 | |
| 93 | int calc_xmincxx . . $ calc_xmin(9751037a4ab03f20).(lame_internal_flagscxx . . $ lame_internal_flags# const *gfc, |
| 94 | III_psy_ratiocxx . . $ III_psy_ratio# const *const ratio, gr_infocxx . . $ gr_info# * const cod_info, FLOATcxx . . $ FLOAT# * l3_xmin); |
| 95 | |
| 96 | int calc_noisecxx . . $ calc_noise(b07b625c5fdf63be).(const gr_infocxx . . $ gr_info# * const cod_info, |
| 97 | const FLOATcxx . . $ FLOAT# * l3_xmin, |
| 98 | FLOATcxx . . $ FLOAT# * distort, calc_noise_resultcxx . . $ calc_noise_result# * const res, calc_noise_datacxx . . $ calc_noise_data# * prev_noise); |
| 99 | |
| 100 | void set_frame_pinfocxx . . $ set_frame_pinfo(20d0cc10a3a75afa).(lame_internal_flagscxx . . $ lame_internal_flags# * gfc, const III_psy_ratiocxx . . $ III_psy_ratio# ratio[2][2]); |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | /* takehiro.c */ |
| 106 | |
| 107 | int count_bitscxx . . $ count_bits(a840df18a627c36c).(lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc, const FLOATcxx . . $ FLOAT# * const xr, |
| 108 | gr_infocxx . . $ gr_info# * const cod_info, calc_noise_datacxx . . $ calc_noise_data# * prev_noise); |
| 109 | int noquant_count_bitscxx . . $ noquant_count_bits(66826c97a8bb1d80).(lame_internal_flagscxx . . $ lame_internal_flags# const *const gfc, |
| 110 | gr_infocxx . . $ gr_info# * const cod_info, calc_noise_datacxx . . $ calc_noise_data# * prev_noise); |
| 111 | |
| 112 | |
| 113 | void best_huffman_dividecxx . . $ best_huffman_divide(1f82e55fbceb2106).(const lame_internal_flagscxx . . $ lame_internal_flags# * const gfc, gr_infocxx . . $ gr_info# * const cod_info); |
| 114 | |
| 115 | void best_scalefac_storecxx . . $ best_scalefac_store(40201c8f8269c0dd).(const lame_internal_flagscxx . . $ lame_internal_flags# * gfc, const int gr, const int ch, |
| 116 | III_side_info_tcxx . . $ III_side_info_t# * const l3_side); |
| 117 | |
| 118 | int scale_bitcountcxx . . $ scale_bitcount(693b474959d9bacf).(const lame_internal_flagscxx . . $ lame_internal_flags# * gfc, gr_infocxx . . $ gr_info# * cod_info); |
| 119 | |
| 120 | void huffman_initcxx . . $ huffman_init(4f558d83b2842a93).(lame_internal_flagscxx . . $ lame_internal_flags# * const gfc); |
| 121 | |
| 122 | void init_xrpow_core_initcxx . . $ init_xrpow_core_init(4f558d83b2842a93).(lame_internal_flagscxx . . $ lame_internal_flags# * const gfc); |
| 123 | |
| 124 | FLOATcxx . . $ FLOAT# athAdjustcxx . . $ athAdjust(95d5df56d1097f86).(FLOATcxx . . $ FLOAT# a, FLOATcxx . . $ FLOAT# x, FLOATcxx . . $ FLOAT# athFloor, float ATHfixpoint); |
| 125 | |
| 126 | #define LARGE_BITScxx . . $ `external/lame/quantize_pvt.h:126:9`! 100000 |
| 127 | |
| 128 | #endif /* LAME_QUANTIZE_PVT_H */ |