#include "huffman.h"#include "mpeg3private.h"#include "mpeg3protos.h"#include "tables.h"#include <stdio.h>#include <string.h>

Go to the source code of this file.
Data Structures | |
| struct | gr_info_s |
| struct | sideinfo_s |
Defines | |
| #define | BITSHIFT ((sizeof(int32_t) - 1) * 8) |
| #define | REFRESH_MASK |
Functions | |
| static int | get_scale_factors_1 (mpeg3_layer_t *audio, int *scf, struct gr_info_s *gr_info, int ch, int gr) |
| static int | get_scale_factors_2 (mpeg3_layer_t *audio, int *scf, struct gr_info_s *gr_info, int i_stereo) |
| static int | dequantize_sample (mpeg3_layer_t *audio, float xr[SBLIMIT][SSLIMIT], int *scf, struct gr_info_s *gr_info, int sfreq, int part2bits) |
| static int | get_side_info (mpeg3_layer_t *audio, struct sideinfo_s *si, int channels, int ms_stereo, long sfreq, int single, int lsf) |
| static int | hybrid (mpeg3_layer_t *audio, float fsIn[SBLIMIT][SSLIMIT], float tsOut[SSLIMIT][SBLIMIT], int ch, struct gr_info_s *gr_info) |
| static int | antialias (mpeg3_layer_t *audio, float xr[SBLIMIT][SSLIMIT], struct gr_info_s *gr_info) |
| static int | calc_i_stereo (mpeg3_layer_t *audio, float xr_buf[2][SBLIMIT][SSLIMIT], int *scalefac, struct gr_info_s *gr_info, int sfreq, int ms_stereo, int lsf) |
| int | mpeg3audio_dolayer3 (mpeg3_layer_t *audio, char *frame, int frame_size, float **output, int render) |
| void | mpeg3_layer_reset (mpeg3_layer_t *audio) |
| int | mpeg3_layer_check (unsigned char *data) |
| int | mpeg3_layer_header (mpeg3_layer_t *audio, unsigned char *data) |
| mpeg3_layer_t * | mpeg3_new_layer () |
| void | mpeg3_delete_layer (mpeg3_layer_t *audio) |
Variables | |
| static int | pretab1 [22] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0} |
| static int | pretab2 [22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} |
| #define BITSHIFT ((sizeof(int32_t) - 1) * 8) |
| #define REFRESH_MASK |
Value:
while(num < BITSHIFT) \ { \ mask |= mpeg3bits_getbits(audio->stream, 8) << (BITSHIFT - num); \ num += 8; \ part2remain -= 8; \ }
Definition at line 224 of file layer3.c.
Referenced by dequantize_sample().
| static int antialias | ( | mpeg3_layer_t * | audio, | |
| float | xr[SBLIMIT][SSLIMIT], | |||
| struct gr_info_s * | gr_info | |||
| ) | [static] |
Definition at line 865 of file layer3.c.
References gr_info_s::block_type, gr_info_s::maxb, gr_info_s::mixed_block_flag, mpeg3_aa_ca, and mpeg3_aa_cs.
Referenced by mpeg3audio_dolayer3(), and ShapeWipeMain::ShapeWipeMain().
| static int calc_i_stereo | ( | mpeg3_layer_t * | audio, | |
| float | xr_buf[2][SBLIMIT][SSLIMIT], | |||
| int * | scalefac, | |||
| struct gr_info_s * | gr_info, | |||
| int | sfreq, | |||
| int | ms_stereo, | |||
| int | lsf | |||
| ) | [static] |
Definition at line 915 of file layer3.c.
References gr_info_s::block_type, mpeg3_bandInfoStruct::longDiff, mpeg3_bandInfoStruct::longIdx, gr_info_s::maxband, gr_info_s::maxbandl, gr_info_s::mixed_block_flag, mpeg3_bandInfo, mpeg3_pow1_1, mpeg3_pow1_2, mpeg3_pow2_1, mpeg3_pow2_2, mpeg3_tan1_1, mpeg3_tan1_2, mpeg3_tan2_1, mpeg3_tan2_2, SBLIMIT, gr_info_s::scalefac_compress, mpeg3_bandInfoStruct::shortDiff, mpeg3_bandInfoStruct::shortIdx, t1, and t2.
Referenced by mpeg3audio_dolayer3().
| static int dequantize_sample | ( | mpeg3_layer_t * | audio, | |
| float | xr[SBLIMIT][SSLIMIT], | |||
| int * | scf, | |||
| struct gr_info_s * | gr_info, | |||
| int | sfreq, | |||
| int | part2bits | |||
| ) | [static] |
Definition at line 233 of file layer3.c.
References a, gr_info_s::big_values, BITSHIFT, gr_info_s::block_type, cb, gr_info_s::count1table_select, gr_info_s::full_gain, mpeg3_bits_t::input_ptr, newhuff::linbits, gr_info_s::maxb, gr_info_s::maxband, gr_info_s::maxbandl, gr_info_s::mixed_block_flag, mpeg3_ht, mpeg3_htc, mpeg3_ispow, mpeg3_longLimit, mpeg3_map, mpeg3_mapend, mpeg3_shortLimit, mpeg3bits_getbitoffset(), mpeg3bits_getbits(), mpeg3bits_getbits_reverse(), mpeg3bits_start_forward(), mpeg3bits_start_reverse(), gr_info_s::part2_3_length, gr_info_s::pow2gain, gr_info_s::preflag, pretab, pretab1, pretab2, REFRESH_MASK, gr_info_s::region1start, gr_info_s::region2start, SBLIMIT, gr_info_s::scalefac_scale, shift(), step, mpeg3_layer_t::stream, newhuff::table, and gr_info_s::table_select.
Referenced by mpeg3audio_dolayer3().

| static int get_scale_factors_1 | ( | mpeg3_layer_t * | audio, | |
| int * | scf, | |||
| struct gr_info_s * | gr_info, | |||
| int | ch, | |||
| int | gr | |||
| ) | [static] |
Definition at line 49 of file layer3.c.
References gr_info_s::block_type, gr_info_s::mixed_block_flag, mpeg3bits_getbits(), gr_info_s::scalefac_compress, gr_info_s::scfsi, and mpeg3_layer_t::stream.
Referenced by mpeg3audio_dolayer3().

| static int get_scale_factors_2 | ( | mpeg3_layer_t * | audio, | |
| int * | scf, | |||
| struct gr_info_s * | gr_info, | |||
| int | i_stereo | |||
| ) | [static] |
Definition at line 156 of file layer3.c.
References gr_info_s::block_type, gr_info_s::mixed_block_flag, mpeg3_i_slen2, mpeg3_n_slen2, mpeg3bits_getbits(), gr_info_s::preflag, gr_info_s::scalefac_compress, and mpeg3_layer_t::stream.
Referenced by mpeg3audio_dolayer3().

| static int get_side_info | ( | mpeg3_layer_t * | audio, | |
| struct sideinfo_s * | si, | |||
| int | channels, | |||
| int | ms_stereo, | |||
| long | sfreq, | |||
| int | single, | |||
| int | lsf | |||
| ) | [static] |
Definition at line 705 of file layer3.c.
References gr_info_s::big_values, gr_info_s::block_type, sideinfo_s::ch, gr_info_s::count1table_select, fprintf, gr_info_s::full_gain, sideinfo_s::gr, mpeg3_bandInfoStruct::longIdx, sideinfo_s::main_data_begin, gr_info_s::mixed_block_flag, mpeg3_bandInfo, mpeg3_gainpow2, mpeg3bits_getbits(), gr_info_s::part2_3_length, gr_info_s::pow2gain, gr_info_s::preflag, sideinfo_s::private_bits, gr_info_s::region1start, gr_info_s::region2start, gr_info_s::scalefac_compress, gr_info_s::scalefac_scale, gr_info_s::scfsi, mpeg3_layer_t::stream, and gr_info_s::table_select.
Referenced by mpeg3audio_dolayer3().

| static int hybrid | ( | mpeg3_layer_t * | audio, | |
| float | fsIn[SBLIMIT][SSLIMIT], | |||
| float | tsOut[SSLIMIT][SBLIMIT], | |||
| int | ch, | |||
| struct gr_info_s * | gr_info | |||
| ) | [static] |
Definition at line 806 of file layer3.c.
References b, gr_info_s::block_type, gr_info_s::maxb, gr_info_s::mixed_block_flag, mpeg3_layer_t::mp3_blc, mpeg3_layer_t::mp3_block, mpeg3_win, mpeg3_win1, mpeg3audio_dct12(), and mpeg3audio_dct36().
Referenced by mpeg3audio_dolayer3().

| void mpeg3_delete_layer | ( | mpeg3_layer_t * | audio | ) |
Definition at line 1546 of file layer3.c.
References mpeg3bits_delete_stream(), and mpeg3_layer_t::stream.
Referenced by delete_codec(), and delete_struct().

| int mpeg3_layer_check | ( | unsigned char * | data | ) |
| int mpeg3_layer_header | ( | mpeg3_layer_t * | audio, | |
| unsigned char * | data | |||
| ) |
Definition at line 1392 of file layer3.c.
References mpeg3_layer_t::bitrate, mpeg3_layer_t::bitrate_index, mpeg3_layer_t::channels, mpeg3_layer_t::copyright, mpeg3_layer_t::emphasis, mpeg3_layer_t::error_protection, mpeg3_layer_t::extension, mpeg3_layer_t::framesize, header, mpeg3_layer_t::layer, mpeg3_layer_t::lsf, MAXFRAMESIZE, mpeg3_layer_t::mode, mpeg3_layer_t::mode_ext, mpeg3_layer_t::mpeg35, mpeg3_freqs, mpeg3_layer_check(), mpeg3_tabsel_123, MPG_MD_MONO, mpeg3_layer_t::original, mpeg3_layer_t::padding, mpeg3_layer_t::prev_framesize, mpeg3_layer_t::samplerate, mpeg3_layer_t::sampling_frequency_code, mpeg3_layer_t::single, and mpeg3_layer_t::ssize.
Referenced by chunk_len(), decode(), read_header(), and write_frames().

| void mpeg3_layer_reset | ( | mpeg3_layer_t * | audio | ) |
Definition at line 1346 of file layer3.c.
References mpeg3_layer_t::first_frame, mpeg3_layer_t::mp3_blc, mpeg3_layer_t::mp3_block, and mpeg3audio_reset_synths().
Referenced by mpeg3audio_dolayer3(), and seek().

| mpeg3_layer_t* mpeg3_new_layer | ( | ) |
Definition at line 1533 of file layer3.c.
References mpeg3_layer_t::bo, mpeg3_layer_t::bsbuf, mpeg3_layer_t::bsspace, mpeg3_layer_t::channels, mpeg3_new_decode_tables(), mpeg3bits_new_stream(), and mpeg3_layer_t::stream.
Referenced by decode(), encode(), mpeg3audio_decode_audio(), and mpeg3audio_new().

| int mpeg3audio_dolayer3 | ( | mpeg3_layer_t * | audio, | |
| char * | frame, | |||
| int | frame_size, | |||
| float ** | output, | |||
| int | render | |||
| ) |
Definition at line 1067 of file layer3.c.
References antialias(), mpeg3_layer_t::bsbuf, mpeg3_layer_t::bsbufold, mpeg3_layer_t::bsnum, mpeg3_layer_t::bsspace, calc_i_stereo(), sideinfo_s::ch, mpeg3_layer_t::channels, dequantize_sample(), mpeg3_layer_t::error_protection, mpeg3_layer_t::first_frame, get_scale_factors_1(), get_scale_factors_2(), get_side_info(), sideinfo_s::gr, hybrid(), mpeg3_layer_t::lsf, sideinfo_s::main_data_begin, gr_info_s::maxb, memcpy, mpeg3_layer_t::mode, mpeg3_layer_t::mode_ext, mpeg3_layer_reset(), mpeg3audio_synth_stereo(), mpeg3bits_getbits(), mpeg3bits_use_ptr(), MPG_MD_JOINT_STEREO, mpeg3_layer_t::prev_framesize, mpeg3_layer_t::sampling_frequency_code, SBLIMIT, mpeg3_layer_t::single, mpeg3_layer_t::ssize, SSLIMIT, and mpeg3_layer_t::stream.
Referenced by decode(), read_frame(), and write_frames().

int pretab1[22] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0} [static] |
int pretab2[22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} [static] |
1.5.5