29 uint8_t **poutbuf,
int *poutbuf_size,
30 const uint8_t *
buf,
int buf_size,
int keyframe){
33 int sample_rate_index=0;
39 *poutbuf_size= buf_size;
51 lsf = sample_rate < (24000+32000)/2;
52 mpeg25 = sample_rate < (12000+16000)/2;
53 sample_rate_index= (header>>10)&3;
54 if (sample_rate_index == 3) {
60 for(bitrate_index=2; bitrate_index<30; bitrate_index++){
62 frame_size = (frame_size * 144000) / (sample_rate << lsf) + (bitrate_index&1);
63 if(frame_size == buf_size + 4)
65 if(frame_size == buf_size + 6)
68 if(bitrate_index == 30){
73 header |= (bitrate_index&1)<<9;
74 header |= (bitrate_index>>1)<<12;
75 header |= (frame_size == buf_size + 4)<<16;
82 uint8_t *p= *poutbuf + frame_size - buf_size;
85 header |= (p[1] & 0xC0)>>2;
88 header |= p[1] & 0x30;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
mpeg audio layer common tables.
const uint16_t avpriv_mpa_freq_tab[3]
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static const uint8_t header[24]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Libavcodec external API header.
int sample_rate
samples per second
main external API structure.
common internal and external API header
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int channels
number of audio channels
const uint16_t avpriv_mpa_bitrate_tab[2][3][15]
#define FFSWAP(type, a, b)