23 #ifndef AVCODEC_OPUS_H
24 #define AVCODEC_OPUS_H
38 #define MAX_FRAME_SIZE 1275
40 #define MAX_PACKET_DUR 5760
42 #define CELT_SHORT_BLOCKSIZE 120
43 #define CELT_OVERLAP CELT_SHORT_BLOCKSIZE
44 #define CELT_MAX_LOG_BLOCKS 3
45 #define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS))
46 #define CELT_MAX_BANDS 21
48 #define SILK_HISTORY 322
49 #define SILK_MAX_LPC 16
51 #define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1)
52 #define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15)
54 #define OPUS_TS_HEADER 0x7FE0
55 #define OPUS_TS_MASK 0xFFE0
58 'O',
'p',
'u',
's',
'H',
'e',
'a',
'd',
59 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
60 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Libavcodec external API header.
static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, FILE *output)
reference-counted frame API
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
@ OPUS_BANDWIDTH_NARROWBAND
@ OPUS_BANDWIDTH_MEDIUMBAND
@ OPUS_BANDWIDTH_FULLBAND
@ OPUS_BANDWIDTH_SUPERWIDEBAND
@ OPUS_BANDWIDTH_WIDEBAND
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).
int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s)
static const uint8_t opus_default_extradata[30]
void ff_silk_flush(SilkContext *s)
void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc)
void ff_silk_free(SilkContext **ps)
void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode)
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.
int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)
Context for an Audio FIFO Buffer.
Describe the class of an AVClass context structure.
main external API structure.
ChannelMap * channel_maps
OpusStreamContext * streams
int frame_offset[MAX_FRAMES]
frame offsets
int stereo
whether this packet is mono or stereo
int frame_count
frame count
int frame_duration
frame duration, in samples @ 48kHz
int frame_size[MAX_FRAMES]
frame sizes
int code
packet code: specifies the frame layout
int data_size
size of the useful data – packet size - padding
enum OpusBandwidth bandwidth
bandwidth
int packet_size
packet size
int config
configuration: tells the audio mode, bandwidth, and frame duration
float * redundancy_output[2]
OpusRangeCoder redundancy_rc
int out_dummy_allocated_size
float redundancy_buf[2][960]
AVAudioFifo * sync_buffer
The libswresample context.
libswresample public header