FFmpeg
Loading...
Searching...
No Matches
ralf.c File Reference

This is a decoder for Real Audio Lossless format. More...

#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "golomb.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, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void decode_flush (AVCodecContext *avctx)
 

Variables

const FFCodec 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 39 of file ralf.c.

Referenced by decode_channel(), filter_frame(), and init().

◆ FILTER_RAW

#define FILTER_RAW   642

Definition at line 40 of file ralf.c.

Referenced by decode_block(), and decode_channel().

◆ RALF_MAX_PKT_SIZE

#define RALF_MAX_PKT_SIZE   8192

Definition at line 51 of file ralf.c.

Referenced by decode_frame().

◆ MAX_ELEMS

#define MAX_ELEMS   644

Definition at line 74 of file ralf.c.

Referenced by init_ralf_vlc().

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.

◆ 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 202 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 216 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 305 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 329 of file ralf.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext * avctx,
AVFrame * frame,
int * got_frame_ptr,
AVPacket * avpkt )
static

Definition at line 413 of file ralf.c.

◆ decode_flush()

static av_cold void decode_flush ( AVCodecContext * avctx)
static

Definition at line 507 of file ralf.c.

Variable Documentation

◆ ff_ralf_decoder

const FFCodec ff_ralf_decoder
Initial value:
= {
.p.name = "ralf",
CODEC_LONG_NAME("RealAudio Lossless"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(RALFContext),
.flush = decode_flush,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void decode_flush(AVCodecContext *avctx)
Definition agm.c:1253
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AV_CODEC_ID_RALF
Definition codec_id.h:510
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
static av_cold int decode_init(AVCodecContext *avctx)
Definition 4xm.c:998
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837
static av_cold int decode_close(AVCodecContext *avctx)
Definition aacdec.c:1220

Definition at line 515 of file ralf.c.