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;
56 for(bitrate_index=2; bitrate_index<30; bitrate_index++){
58 frame_size = (frame_size * 144000) / (sample_rate << lsf) + (bitrate_index&1);
59 if(frame_size == buf_size + 4)
61 if(frame_size == buf_size + 6)
64 if(bitrate_index == 30){
69 header |= (bitrate_index&1)<<9;
70 header |= (bitrate_index>>1)<<12;
71 header |= (frame_size == buf_size + 4)<<16;
78 uint8_t *p= *poutbuf + frame_size - buf_size;
81 header |= (p[1] & 0xC0)>>2;
84 header |= p[1] & 0x30;
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.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
static const uint8_t header[24]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Libavcodec external API header.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int sample_rate
samples per second
main external API structure.
common internal and external API header
int channels
number of audio channels
const uint16_t avpriv_mpa_bitrate_tab[2][3][15]
#define FFSWAP(type, a, b)