23 #ifndef AVCODEC_OPUS_H 24 #define AVCODEC_OPUS_H 29 #include "libavutil/float_dsp.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 56 static const uint8_t opus_default_extradata[30] = {
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,
71 OPUS_BANDWIDTH_NARROWBAND,
72 OPUS_BANDWIDTH_MEDIUMBAND,
73 OPUS_BANDWIDTH_WIDEBAND,
74 OPUS_BANDWIDTH_SUPERWIDEBAND,
75 OPUS_BANDWIDTH_FULLBAND,
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];
123 int out_dummy_allocated_size;
164 int *decoded_samples;
167 int nb_stereo_streams;
191 enum OpusBandwidth
bandwidth,
int coded_channels,
int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, int self_delimiting)
Parse Opus packet info from raw packet data.
Definition: opus.c:90
int frame_count
frame count
Definition: opus.h:92
int vbr
vbr flag
Definition: opus.h:89
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:120
libswresample public header
Definition: swresample_internal.h:95
reference-counted frame API
Definition: audio_fifo.c:34
int frame_size[MAX_FRAMES]
frame sizes
Definition: opus.h:94
int frame_duration
frame duration, in samples @ 48kHz
Definition: opus.h:95
Definition: float_dsp.h:24
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).
Definition: opus_silk.c:781
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:1518
int config
configuration: tells the audio mode, bandwidth, and frame duration
Definition: opus.h:90
Describe the class of an AVClass context structure.
Definition: log.h:67
enum OpusMode mode
mode
Definition: opus.h:96
int stereo
whether this packet is mono or stereo
Definition: opus.h:88
int data_size
size of the useful data – packet size - padding
Definition: opus.h:86
Definition: opus_silk.c:45
Definition: opus_celt.h:92
int packet_size
packet size
Definition: opus.h:85
int frame_offset[MAX_FRAMES]
frame offsets
Definition: opus.h:93
enum OpusBandwidth bandwidth
bandwidth
Definition: opus.h:97
#define MAX_FRAMES
maximum number of frames per superframe
Definition: wmavoice.c:51
int code
packet code: specifies the frame layout
Definition: opus.h:87