FFmpeg
Loading...
Searching...
No Matches
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 494 of file rka.c.

Referenced by decode_filter().

◆ ac_dec_bit()

static int ac_dec_bit ( ACoder * ac)
static

Definition at line 546 of file rka.c.

Referenced by mdl64_decode().

◆ mdl64_decode()

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

Definition at line 589 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 674 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 769 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 828 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 848 of file rka.c.

◆ rka_decode_close()

static av_cold int rka_decode_close ( AVCodecContext * avctx)
static

Definition at line 965 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 672 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),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
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_RKA
Definition codec_id.h:555
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
static av_cold int rka_decode_init(AVCodecContext *avctx)
Definition rka.c:132
static av_cold int rka_decode_close(AVCodecContext *avctx)
Definition rka.c:965
static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition rka.c:848

Definition at line 986 of file rka.c.