FFmpeg
Macros | Functions | Variables
opus.c File Reference
#include <stdint.h>
#include "libavutil/error.h"
#include "libavutil/ffmath.h"
#include "opus_celt.h"
#include "opustab.h"
#include "internal.h"
#include "vorbis.h"

Go to the source code of this file.

Macros

#define NORMC(bits)   ((bits) << (f->channels - 1) << f->size >> 2)
 

Functions

static int xiph_lacing_16bit (const uint8_t **ptr, const uint8_t *end)
 Read a 1- or 2-byte frame length. More...
 
static int xiph_lacing_full (const uint8_t **ptr, const uint8_t *end)
 Read a multi-byte length (used for code 3 packet padding size) More...
 
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. More...
 
static int channel_reorder_vorbis (int nb_channels, int channel_idx)
 
static int channel_reorder_unknown (int nb_channels, int channel_idx)
 
av_cold int ff_opus_parse_extradata (AVCodecContext *avctx, OpusContext *s)
 
void ff_celt_quant_bands (CeltFrame *f, OpusRangeCoder *rc)
 
void ff_celt_bitalloc (CeltFrame *f, OpusRangeCoder *rc, int encode)
 

Variables

static const uint16_t opus_frame_duration [32]
 

Detailed Description

Opus decoder/parser shared code

Definition in file opus.c.

Macro Definition Documentation

◆ NORMC

#define NORMC (   bits)    ((bits) << (f->channels - 1) << f->size >> 2)

Definition at line 553 of file opus.c.

Function Documentation

◆ xiph_lacing_16bit()

static int xiph_lacing_16bit ( const uint8_t **  ptr,
const uint8_t end 
)
inlinestatic

Read a 1- or 2-byte frame length.

Definition at line 52 of file opus.c.

Referenced by ff_opus_parse_packet().

◆ xiph_lacing_full()

static int xiph_lacing_full ( const uint8_t **  ptr,
const uint8_t end 
)
inlinestatic

Read a multi-byte length (used for code 3 packet padding size)

Definition at line 70 of file opus.c.

Referenced by ff_opus_parse_packet().

◆ ff_opus_parse_packet()

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 at line 91 of file opus.c.

Referenced by opus_decode_packet(), and opus_find_frame_end().

◆ channel_reorder_vorbis()

static int channel_reorder_vorbis ( int  nb_channels,
int  channel_idx 
)
static

Definition at line 282 of file opus.c.

Referenced by ff_opus_parse_extradata().

◆ channel_reorder_unknown()

static int channel_reorder_unknown ( int  nb_channels,
int  channel_idx 
)
static

Definition at line 287 of file opus.c.

Referenced by ff_opus_parse_extradata().

◆ ff_opus_parse_extradata()

av_cold int ff_opus_parse_extradata ( AVCodecContext avctx,
OpusContext s 
)

Definition at line 292 of file opus.c.

Referenced by opus_decode_init(), and opus_find_frame_end().

◆ ff_celt_quant_bands()

void ff_celt_quant_bands ( CeltFrame f,
OpusRangeCoder rc 
)

Definition at line 446 of file opus.c.

Referenced by celt_encode_frame(), and ff_celt_decode_frame().

◆ ff_celt_bitalloc()

void ff_celt_bitalloc ( CeltFrame f,
OpusRangeCoder rc,
int  encode 
)

Definition at line 555 of file opus.c.

Referenced by bands_dist(), celt_encode_frame(), and ff_celt_decode_frame().

Variable Documentation

◆ opus_frame_duration

const uint16_t opus_frame_duration[32]
static
Initial value:
= {
480, 960, 1920, 2880,
480, 960, 1920, 2880,
480, 960, 1920, 2880,
480, 960,
480, 960,
120, 240, 480, 960,
120, 240, 480, 960,
120, 240, 480, 960,
120, 240, 480, 960,
}

Definition at line 37 of file opus.c.

Referenced by ff_opus_parse_packet().