FFmpeg
Data Structures | Functions | Variables
rka.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.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 vrq_qfactors [8] = { 3, 3, 2, 2, 1, 1, 1, 1 }
 
const FFCodec ff_rka_decoder
 

Function Documentation

◆ adaptive_model_init()

static int adaptive_model_init ( AdaptiveModel am,
int  buf_size 
)
static

Definition at line 106 of file rka.c.

Referenced by chctx_init().

◆ adaptive_model_free()

static void adaptive_model_free ( AdaptiveModel am)
static

Definition at line 126 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 132 of file rka.c.

◆ model64_init()

static void model64_init ( Model64 m,
unsigned  bits 
)
static

Definition at line 180 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 201 of file rka.c.

Referenced by rka_decode_frame().

◆ init_acoder()

static void init_acoder ( ACoder ac)
static

Definition at line 247 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 254 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 301 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 321 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 339 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 364 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 377 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 410 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 495 of file rka.c.

Referenced by decode_filter().

◆ ac_dec_bit()

static int ac_dec_bit ( ACoder ac)
static

Definition at line 547 of file rka.c.

Referenced by mdl64_decode().

◆ mdl64_decode()

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

Definition at line 590 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 675 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 770 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 829 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 849 of file rka.c.

◆ rka_decode_close()

static av_cold int rka_decode_close ( AVCodecContext avctx)
static

Definition at line 966 of file rka.c.

Variable Documentation

◆ vrq_qfactors

const uint8_t vrq_qfactors[8] = { 3, 3, 2, 2, 1, 1, 1, 1 }
static

Definition at line 673 of file rka.c.

Referenced by decode_filter().

◆ 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 987 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:43
AV_CODEC_ID_RKA
@ AV_CODEC_ID_RKA
Definition: codec_id.h:548
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
RKAContext
Definition: rka.c:85
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
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:106
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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:849
rka_decode_init
static av_cold int rka_decode_init(AVCodecContext *avctx)
Definition: rka.c:132
rka_decode_close
static av_cold int rka_decode_close(AVCodecContext *avctx)
Definition: rka.c:966