2
* TwoLAME: an optimized MPEG Audio Layer Two encoder
4
* Copyright (C) 2001-2004 Michael Cheng
5
* Copyright (C) 2004-2005 The TwoLAME Project
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
void encode_init(twolame_options *glopts);
29
int get_js_bound(int m_ext);
31
int get_alloc_table_bits (int tablenum, int sb, int ba);
33
void scalefactor_calc (FLOAT sb_sample[][3][SCALE_BLOCK][SBLIMIT],
34
unsigned int scalar[][3][SBLIMIT], int nch,
37
void combine_lr (FLOAT sb_sample[2][3][SCALE_BLOCK][SBLIMIT],
38
FLOAT joint_sample[3][SCALE_BLOCK][SBLIMIT], int sblimit);
40
void find_sf_max (twolame_options *glopts,
41
unsigned int sf_index[2][3][SBLIMIT],
42
FLOAT sf_max[2][SBLIMIT]);
44
void sf_transmission_pattern (twolame_options *glopts,
45
unsigned int sf_index[2][3][SBLIMIT],
46
unsigned int sf_selectinfo[2][SBLIMIT]);
48
void write_header (twolame_options *glopts, bit_stream * bs);
50
int write_bit_alloc (twolame_options *glopts,
51
unsigned int bit_alloc[2][SBLIMIT],
54
int write_scalefactors (twolame_options *glopts,
55
unsigned int bit_alloc[2][SBLIMIT],
56
unsigned int sf_selectinfo[2][SBLIMIT],
57
unsigned int scalar[2][3][SBLIMIT],
60
void subband_quantization (twolame_options *glopts,
61
unsigned int sf_index[2][3][SBLIMIT],
62
FLOAT sb_samples[2][3][SCALE_BLOCK][SBLIMIT],
63
unsigned int j_scale[3][SBLIMIT],
64
FLOAT j_samps[3][SCALE_BLOCK][SBLIMIT],
65
unsigned int bit_alloc[2][SBLIMIT],
66
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT]);
68
void write_samples (twolame_options *glopts,
69
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT],
70
unsigned int bit_alloc[2][SBLIMIT], bit_stream * bs);
73
/*******************************************************
75
******************************************************/
77
int bits_for_nonoise (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
78
unsigned int scfsi[2][SBLIMIT], FLOAT min_mnr,
79
unsigned int bit_alloc[2][SBLIMIT]);
81
int init_bit_allocation( twolame_options * glopts );
83
void main_bit_allocation (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
84
unsigned int scfsi[2][SBLIMIT],
85
unsigned int bit_alloc[2][SBLIMIT], int *adb );
87
int vbr_bit_allocation (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
88
unsigned int scfsi[2][SBLIMIT],
89
unsigned int bit_alloc[2][SBLIMIT], int *adb);
91
int a_bit_allocation (twolame_options * glopts, FLOAT SMR[2][SBLIMIT],
92
unsigned int scfsi[2][SBLIMIT],
93
unsigned int bit_alloc[2][SBLIMIT], int *adb );