FFmpeg
Data Structures | Macros | Functions | Variables
ralf.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
#include "golomb.h"
#include "internal.h"
#include "unary.h"
#include "ralfdata.h"

Go to the source code of this file.

Data Structures

struct  VLCSet
 
struct  RALFContext
 

Macros

#define FILTER_NONE   0
 
#define FILTER_RAW   642
 
#define RALF_MAX_PKT_SIZE   8192
 
#define MAX_ELEMS   644
 

Functions

static av_cold int init_ralf_vlc (VLC *vlc, const uint8_t *data, int elems)
 
static av_cold int decode_close (AVCodecContext *avctx)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static int extend_code (GetBitContext *gb, int val, int range, int bits)
 
static int decode_channel (RALFContext *ctx, GetBitContext *gb, int ch, int length, int mode, int bits)
 
static void apply_lpc (RALFContext *ctx, int ch, int length, int bits)
 
static int decode_block (AVCodecContext *avctx, GetBitContext *gb, int16_t *dst0, int16_t *dst1)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
static void decode_flush (AVCodecContext *avctx)
 

Variables

const AVCodec ff_ralf_decoder
 

Detailed Description

This is a decoder for Real Audio Lossless format. Dedicated to the mastermind behind it, Ralph Wiggum.

Definition in file ralf.c.

Macro Definition Documentation

◆ FILTER_NONE

#define FILTER_NONE   0

Definition at line 38 of file ralf.c.

◆ FILTER_RAW

#define FILTER_RAW   642

Definition at line 39 of file ralf.c.

◆ RALF_MAX_PKT_SIZE

#define RALF_MAX_PKT_SIZE   8192

Definition at line 50 of file ralf.c.

◆ MAX_ELEMS

#define MAX_ELEMS   644

Definition at line 74 of file ralf.c.

Function Documentation

◆ init_ralf_vlc()

static av_cold int init_ralf_vlc ( VLC vlc,
const uint8_t *  data,
int  elems 
)
static

Definition at line 76 of file ralf.c.

Referenced by decode_init().

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 106 of file ralf.c.

Referenced by decode_init().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 127 of file ralf.c.

◆ extend_code()

static int extend_code ( GetBitContext gb,
int  val,
int  range,
int  bits 
)
inlinestatic

Definition at line 213 of file ralf.c.

Referenced by decode_channel().

◆ decode_channel()

static int decode_channel ( RALFContext ctx,
GetBitContext gb,
int  ch,
int  length,
int  mode,
int  bits 
)
static

Definition at line 227 of file ralf.c.

Referenced by decode_block().

◆ apply_lpc()

static void apply_lpc ( RALFContext ctx,
int  ch,
int  length,
int  bits 
)
static

Definition at line 316 of file ralf.c.

Referenced by decode_block().

◆ decode_block()

static int decode_block ( AVCodecContext avctx,
GetBitContext gb,
int16_t *  dst0,
int16_t *  dst1 
)
static

Definition at line 340 of file ralf.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 424 of file ralf.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 520 of file ralf.c.

Variable Documentation

◆ ff_ralf_decoder

const AVCodec ff_ralf_decoder
Initial value:
= {
.name = "ralf",
.long_name = NULL_IF_CONFIG_SMALL("RealAudio Lossless"),
.priv_data_size = sizeof(RALFContext),
.close = decode_close,
.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 528 of file ralf.c.

decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: ralf.c:520
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:41
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:953
RALFContext
Definition: ralf.c:52
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: ralf.c:106
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: ralf.c:424
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: ralf.c:127
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_ID_RALF
@ AV_CODEC_ID_RALF
Definition: codec_id.h:479
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:592
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:104
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58