23 #ifndef AVCODEC_OPUS_H 24 #define AVCODEC_OPUS_H 37 #define MAX_FRAME_SIZE 1275 39 #define MAX_PACKET_DUR 5760 41 #define CELT_SHORT_BLOCKSIZE 120 42 #define CELT_OVERLAP CELT_SHORT_BLOCKSIZE 43 #define CELT_MAX_LOG_BLOCKS 3 44 #define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS)) 45 #define CELT_MAX_BANDS 21 47 #define SILK_HISTORY 322 48 #define SILK_MAX_LPC 16 50 #define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) 51 #define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15) 53 #define OPUS_TS_HEADER 0x7FE0 // 0x3ff (11 bits) 54 #define OPUS_TS_MASK 0xFFE0 // top 11 bits 57 'O',
'p',
'u',
's',
'H',
'e',
'a',
'd',
58 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
59 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110 float silk_buf[2][960];
111 float *silk_output[2];
113 float *celt_output[2];
115 float redundancy_buf[2][960];
116 float *redundancy_output[2];
AVAudioFifo ** sync_buffers
int frame_count
frame count
int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, int self_delimited)
Parse Opus packet info from raw packet data.
void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc)
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
ChannelMap * channel_maps
libswresample public header
static const uint8_t opus_default_extradata[30]
int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s)
The libswresample context.
reference-counted frame API
Context for an Audio FIFO Buffer.
void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode)
int frame_size[MAX_FRAMES]
frame sizes
int frame_duration
frame duration, in samples @ 48kHz
int out_dummy_allocated_size
Libavcodec external API header.
void ff_silk_flush(SilkContext *s)
main external API structure.
int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)
static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, FILE *output)
int config
configuration: tells the audio mode, bandwidth, and frame duration
void ff_silk_free(SilkContext **ps)
Describe the class of an AVClass context structure.
int stereo
whether this packet is mono or stereo
int data_size
size of the useful data – packet size - padding
int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, float *output[2], enum OpusBandwidth bandwidth, int coded_channels, int duration_ms)
Decode the LP layer of one Opus frame (which may correspond to several SILK frames).
OpusStreamContext * streams
int packet_size
packet size
OpusRangeCoder redundancy_rc
int frame_offset[MAX_FRAMES]
frame offsets
enum OpusBandwidth bandwidth
bandwidth
int code
packet code: specifies the frame layout