Go to the documentation of this file.
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,
enum OpusBandwidth bandwidth
bandwidth
void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc)
@ OPUS_BANDWIDTH_NARROWBAND
static const uint8_t opus_default_extradata[30]
int code
packet code: specifies the frame layout
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
@ OPUS_BANDWIDTH_FULLBAND
void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode)
Context for an Audio FIFO Buffer.
float redundancy_buf[2][960]
int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)
int frame_duration
frame duration, in samples @ 48kHz
void ff_silk_flush(SilkContext *s)
The libswresample context.
@ 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).
Describe the class of an AVClass context structure.
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.
AVAudioFifo ** sync_buffers
OpusStreamContext * streams
int out_dummy_allocated_size
OpusRangeCoder redundancy_rc
@ OPUS_BANDWIDTH_SUPERWIDEBAND
int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s)
int data_size
size of the useful data – packet size - padding
static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, FILE *output)
ChannelMap * channel_maps
#define DECLARE_ALIGNED(n, t, v)
int frame_size[MAX_FRAMES]
frame sizes
main external API structure.
int frame_offset[MAX_FRAMES]
frame offsets
int config
configuration: tells the audio mode, bandwidth, and frame duration
@ OPUS_BANDWIDTH_MEDIUMBAND
int stereo
whether this packet is mono or stereo
int packet_size
packet size
void ff_silk_free(SilkContext **ps)
float * redundancy_output[2]
int frame_count
frame count