FFmpeg
Data Structures | Functions | Variables
rka.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "bytestream.h"
#include "decode.h"

Go to the source code of this file.

Data Structures

struct  ACoder
 
struct  FiltCoeffs
 
struct  Model64
 
struct  AdaptiveModel
 
struct  ChContext
 
struct  RKAContext
 

Functions

static int adaptive_model_init (AdaptiveModel *am, int buf_size)
 
static void adaptive_model_free (AdaptiveModel *am)
 
static av_cold int rka_decode_init (AVCodecContext *avctx)
 
static void model64_init (Model64 *m, unsigned bits)
 
static int chctx_init (RKAContext *s, ChContext *c, int sample_rate, int bps)
 
static void init_acoder (ACoder *ac)
 
static int ac_decode_bool (ACoder *ac, int freq1, int freq2)
 
static int decode_bool (ACoder *ac, ChContext *c, int idx)
 
static int ac_get_freq (ACoder *ac, unsigned freq, int *result)
 
static int ac_update (ACoder *ac, int freq, int mul)
 
static void amdl_update_prob (AdaptiveModel *am, int val, int diff)
 
static void update_ch_subobj (AdaptiveModel *am)
 
static int amdl_decode_int (AdaptiveModel *am, ACoder *ac, unsigned *dst, unsigned size)
 
static int decode_filt_coeffs (RKAContext *s, ChContext *ctx, ACoder *ac, FiltCoeffs *dst)
 
static int ac_dec_bit (ACoder *ac)
 
static int mdl64_decode (ACoder *ac, Model64 *ctx, int *dst)
 
static int decode_filter (RKAContext *s, ChContext *ctx, ACoder *ac, int off, unsigned size)
 
static int decode_samples (AVCodecContext *avctx, ACoder *ac, ChContext *ctx, int offset)
 
static int decode_ch_samples (AVCodecContext *avctx, ChContext *c)
 
static int rka_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int rka_decode_close (AVCodecContext *avctx)
 

Variables

static const uint8_t tab [16]
 
const FFCodec ff_rka_decoder
 

Function Documentation

◆ adaptive_model_init()

static int adaptive_model_init ( AdaptiveModel am,
int  buf_size 
)
static

Definition at line 105 of file rka.c.

Referenced by chctx_init().

◆ adaptive_model_free()

static void adaptive_model_free ( AdaptiveModel am)
static

Definition at line 125 of file rka.c.

Referenced by rka_decode_close().

◆ rka_decode_init()

static av_cold int rka_decode_init ( AVCodecContext avctx)
static

Definition at line 131 of file rka.c.

◆ model64_init()

static void model64_init ( Model64 m,
unsigned  bits 
)
static

Definition at line 175 of file rka.c.

Referenced by chctx_init().

◆ chctx_init()

static int chctx_init ( RKAContext s,
ChContext c,
int  sample_rate,
int  bps 
)
static

Definition at line 196 of file rka.c.

Referenced by rka_decode_frame().

◆ init_acoder()

static void init_acoder ( ACoder ac)
static

Definition at line 242 of file rka.c.

Referenced by rka_decode_frame().

◆ ac_decode_bool()

static int ac_decode_bool ( ACoder ac,
int  freq1,
int  freq2 
)
static

Definition at line 249 of file rka.c.

Referenced by amdl_decode_int(), decode_bool(), and mdl64_decode().

◆ decode_bool()

static int decode_bool ( ACoder ac,
ChContext c,
int  idx 
)
static

Definition at line 296 of file rka.c.

Referenced by decode_filt_coeffs().

◆ ac_get_freq()

static int ac_get_freq ( ACoder ac,
unsigned  freq,
int result 
)
static

Definition at line 316 of file rka.c.

Referenced by amdl_decode_int(), decode_filt_coeffs(), decode_samples(), and mdl64_decode().

◆ ac_update()

static int ac_update ( ACoder ac,
int  freq,
int  mul 
)
static

Definition at line 334 of file rka.c.

Referenced by amdl_decode_int(), decode_filt_coeffs(), decode_samples(), and mdl64_decode().

◆ amdl_update_prob()

static void amdl_update_prob ( AdaptiveModel am,
int  val,
int  diff 
)
static

Definition at line 359 of file rka.c.

Referenced by amdl_decode_int(), and update_ch_subobj().

◆ update_ch_subobj()

static void update_ch_subobj ( AdaptiveModel am)
static

Definition at line 372 of file rka.c.

Referenced by amdl_decode_int().

◆ amdl_decode_int()

static int amdl_decode_int ( AdaptiveModel am,
ACoder ac,
unsigned *  dst,
unsigned  size 
)
static

Definition at line 405 of file rka.c.

Referenced by decode_filt_coeffs(), decode_filter(), and decode_samples().

◆ decode_filt_coeffs()

static int decode_filt_coeffs ( RKAContext s,
ChContext ctx,
ACoder ac,
FiltCoeffs dst 
)
static

Definition at line 490 of file rka.c.

Referenced by decode_filter().

◆ ac_dec_bit()

static int ac_dec_bit ( ACoder ac)
static

Definition at line 542 of file rka.c.

Referenced by mdl64_decode().

◆ mdl64_decode()

static int mdl64_decode ( ACoder ac,
Model64 ctx,
int dst 
)
static

Definition at line 585 of file rka.c.

Referenced by decode_filter().

◆ decode_filter()

static int decode_filter ( RKAContext s,
ChContext ctx,
ACoder ac,
int  off,
unsigned  size 
)
static

Definition at line 672 of file rka.c.

Referenced by decode_samples().

◆ decode_samples()

static int decode_samples ( AVCodecContext avctx,
ACoder ac,
ChContext ctx,
int  offset 
)
static

Definition at line 765 of file rka.c.

Referenced by decode_ch_samples().

◆ decode_ch_samples()

static int decode_ch_samples ( AVCodecContext avctx,
ChContext c 
)
static

Definition at line 824 of file rka.c.

Referenced by rka_decode_frame().

◆ rka_decode_frame()

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

Definition at line 844 of file rka.c.

◆ rka_decode_close()

static av_cold int rka_decode_close ( AVCodecContext avctx)
static

Definition at line 957 of file rka.c.

Variable Documentation

◆ tab

const uint8_t tab[16]
static

◆ ff_rka_decoder

const FFCodec ff_rka_decoder
Initial value:
= {
.p.name = "rka",
CODEC_LONG_NAME("RKA (RK Audio)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_RKA,
.priv_data_size = sizeof(RKAContext),
.close = rka_decode_close,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 978 of file rka.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:42
AV_CODEC_ID_RKA
@ AV_CODEC_ID_RKA
Definition: codec_id.h:540
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
RKAContext
Definition: rka.c:84
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
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:103
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
rka_decode_frame
static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: rka.c:844
rka_decode_init
static av_cold int rka_decode_init(AVCodecContext *avctx)
Definition: rka.c:131
rka_decode_close
static av_cold int rka_decode_close(AVCodecContext *avctx)
Definition: rka.c:957