| 1 |
/* |
| 2 |
* TwoLAME: an optimized MPEG Audio Layer Two encoder |
| 3 |
* |
| 4 |
* Copyright (C) 2001-2004 Michael Cheng |
| 5 |
* Copyright (C) 2004-2018 The TwoLAME Project |
| 6 |
* |
| 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. |
| 11 |
* |
| 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. |
| 16 |
* |
| 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 |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
|
| 24 |
#ifndef TWOLAME_ENCODE_H |
| 25 |
#define TWOLAME_ENCODE_H |
| 26 |
|
| 27 |
int twolame_encode_init(twolame_options * glopts); |
| 28 |
|
| 29 |
void twolame_scalefactor_calc(FLOAT sb_sample[][3][SCALE_BLOCK][SBLIMIT], |
| 30 |
unsigned int scalar[][3][SBLIMIT], int nch, int sblimit); |
| 31 |
|
| 32 |
void twolame_combine_lr(FLOAT sb_sample[2][3][SCALE_BLOCK][SBLIMIT], |
| 33 |
FLOAT joint_sample[3][SCALE_BLOCK][SBLIMIT], int sblimit); |
| 34 |
|
| 35 |
void twolame_find_sf_max(twolame_options * glopts, |
| 36 |
unsigned int sf_index[2][3][SBLIMIT], FLOAT sf_max[2][SBLIMIT]); |
| 37 |
|
| 38 |
void twolame_sf_transmission_pattern(twolame_options * glopts, |
| 39 |
unsigned int sf_index[2][3][SBLIMIT], |
| 40 |
unsigned int sf_selectinfo[2][SBLIMIT]); |
| 41 |
|
| 42 |
void twolame_write_header(twolame_options * glopts, bit_stream * bs); |
| 43 |
|
| 44 |
void twolame_write_bit_alloc(twolame_options * glopts, unsigned int bit_alloc[2][SBLIMIT], bit_stream * bs); |
| 45 |
|
| 46 |
void twolame_write_scalefactors(twolame_options * glopts, |
| 47 |
unsigned int bit_alloc[2][SBLIMIT], |
| 48 |
unsigned int sf_selectinfo[2][SBLIMIT], |
| 49 |
unsigned int scalar[2][3][SBLIMIT], bit_stream * bs); |
| 50 |
|
| 51 |
void twolame_subband_quantization(twolame_options * glopts, |
| 52 |
unsigned int sf_index[2][3][SBLIMIT], |
| 53 |
FLOAT sb_samples[2][3][SCALE_BLOCK][SBLIMIT], |
| 54 |
unsigned int j_scale[3][SBLIMIT], |
| 55 |
FLOAT j_samps[3][SCALE_BLOCK][SBLIMIT], |
| 56 |
unsigned int bit_alloc[2][SBLIMIT], |
| 57 |
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT]); |
| 58 |
|
| 59 |
void twolame_write_samples(twolame_options * glopts, |
| 60 |
unsigned int sbband[2][3][SCALE_BLOCK][SBLIMIT], |
| 61 |
unsigned int bit_alloc[2][SBLIMIT], bit_stream * bs); |
| 62 |
|
| 63 |
|
| 64 |
/******************************************************* |
| 65 |
Bit Allocation Stuff |
| 66 |
******************************************************/ |
| 67 |
|
| 68 |
int twolame_bits_for_nonoise(twolame_options * glopts, FLOAT SMR[2][SBLIMIT], |
| 69 |
unsigned int scfsi[2][SBLIMIT], FLOAT min_mnr, |
| 70 |
unsigned int bit_alloc[2][SBLIMIT]); |
| 71 |
|
| 72 |
int twolame_init_bit_allocation(twolame_options * glopts); |
| 73 |
|
| 74 |
void twolame_main_bit_allocation(twolame_options * glopts, FLOAT SMR[2][SBLIMIT], |
| 75 |
unsigned int scfsi[2][SBLIMIT], |
| 76 |
unsigned int bit_alloc[2][SBLIMIT], int *adb); |
| 77 |
|
| 78 |
int twolame_vbr_bit_allocation(twolame_options * glopts, FLOAT SMR[2][SBLIMIT], |
| 79 |
unsigned int scfsi[2][SBLIMIT], |
| 80 |
unsigned int bit_alloc[2][SBLIMIT], int *adb); |
| 81 |
|
| 82 |
int twolame_a_bit_allocation(twolame_options * glopts, FLOAT SMR[2][SBLIMIT], |
| 83 |
unsigned int scfsi[2][SBLIMIT], unsigned int bit_alloc[2][SBLIMIT], int *adb); |
| 84 |
|
| 85 |
#endif |
| 86 |
|
| 87 |
|
| 88 |
// vim:ts=4:sw=4:nowrap: |