Libav
Data Structures | Macros | Functions | Variables
takdec.c File Reference

TAK (Tom's lossless Audio Kompressor) decoder. More...

#include "libavutil/internal.h"
#include "libavutil/samplefmt.h"
#include "tak.h"
#include "audiodsp.h"
#include "avcodec.h"
#include "internal.h"
#include "unary.h"

Go to the source code of this file.

Data Structures

struct  MCDParam
 
struct  TAKDecContext
 
struct  CParam
 

Macros

#define MAX_SUBFRAMES   8
 
#define MAX_PREDICTORS   256
 

Functions

static av_cold void tak_init_static_data (AVCodec *codec)
 
static int set_bps_params (AVCodecContext *avctx)
 
static void set_sample_rate_params (AVCodecContext *avctx)
 
static av_cold int tak_decode_init (AVCodecContext *avctx)
 
static void decode_lpc (int32_t *coeffs, int mode, int length)
 
static int decode_segment (GetBitContext *gb, int mode, int32_t *decoded, int len)
 
static int decode_residues (TAKDecContext *s, int32_t *decoded, int length)
 
static int get_bits_esc4 (GetBitContext *gb)
 
static void decode_filter_coeffs (TAKDecContext *s, int filter_order, int size, int filter_quant, int16_t *filter)
 
static int decode_subframe (TAKDecContext *s, int32_t *decoded, int subframe_size, int prev_subframe_size)
 
static int decode_channel (TAKDecContext *s, int chan)
 
static int decorrelate (TAKDecContext *s, int c1, int c2, int length)
 
static int tak_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
 
static av_cold int tak_decode_close (AVCodecContext *avctx)
 

Variables

static const int8_t mc_dmodes [] = { 1, 3, 4, 6, }
 
static const uint16_t predictor_sizes []
 
static const struct CParam xcodes [50]
 
AVCodec ff_tak_decoder
 

Detailed Description

TAK (Tom's lossless Audio Kompressor) decoder.

Author
Paul B Mahol

Definition in file takdec.c.

Macro Definition Documentation

§ MAX_SUBFRAMES

#define MAX_SUBFRAMES   8

Definition at line 36 of file takdec.c.

Referenced by decode_channel().

§ MAX_PREDICTORS

#define MAX_PREDICTORS   256

Definition at line 37 of file takdec.c.

Referenced by decode_filter_coeffs(), decode_subframe(), and decorrelate().

Function Documentation

§ tak_init_static_data()

static av_cold void tak_init_static_data ( AVCodec codec)
static

Definition at line 135 of file takdec.c.

§ set_bps_params()

static int set_bps_params ( AVCodecContext avctx)
static

Definition at line 140 of file takdec.c.

Referenced by tak_decode_frame(), and tak_decode_init().

§ set_sample_rate_params()

static void set_sample_rate_params ( AVCodecContext avctx)
static

Definition at line 162 of file takdec.c.

Referenced by tak_decode_frame(), and tak_decode_init().

§ tak_decode_init()

static av_cold int tak_decode_init ( AVCodecContext avctx)
static

Definition at line 171 of file takdec.c.

§ decode_lpc()

static void decode_lpc ( int32_t coeffs,
int  mode,
int  length 
)
static

Definition at line 184 of file takdec.c.

Referenced by decode_subframe(), and tak_decode_frame().

§ decode_segment()

static int decode_segment ( GetBitContext gb,
int  mode,
int32_t decoded,
int  len 
)
static

Definition at line 239 of file takdec.c.

Referenced by decode_residues().

§ decode_residues()

static int decode_residues ( TAKDecContext s,
int32_t decoded,
int  length 
)
static

Definition at line 283 of file takdec.c.

Referenced by decode_subframe().

§ get_bits_esc4()

static int get_bits_esc4 ( GetBitContext gb)
static

Definition at line 363 of file takdec.c.

Referenced by decode_channel(), decode_subframe(), and decorrelate().

§ decode_filter_coeffs()

static void decode_filter_coeffs ( TAKDecContext s,
int  filter_order,
int  size,
int  filter_quant,
int16_t *  filter 
)
static

Definition at line 371 of file takdec.c.

Referenced by decode_subframe().

§ decode_subframe()

static int decode_subframe ( TAKDecContext s,
int32_t decoded,
int  subframe_size,
int  prev_subframe_size 
)
static

Definition at line 418 of file takdec.c.

Referenced by decode_channel().

§ decode_channel()

static int decode_channel ( TAKDecContext s,
int  chan 
)
static

Definition at line 500 of file takdec.c.

Referenced by tak_decode_frame().

§ decorrelate()

static int decorrelate ( TAKDecContext s,
int  c1,
int  c2,
int  length 
)
static

Definition at line 555 of file takdec.c.

Referenced by tak_decode_frame().

§ tak_decode_frame()

static int tak_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame_ptr,
AVPacket pkt 
)
static

Definition at line 671 of file takdec.c.

§ tak_decode_close()

static av_cold int tak_decode_close ( AVCodecContext avctx)
static

Definition at line 908 of file takdec.c.

Variable Documentation

§ mc_dmodes

const int8_t mc_dmodes[] = { 1, 3, 4, 6, }
static

Definition at line 70 of file takdec.c.

Referenced by tak_decode_frame().

§ predictor_sizes

const uint16_t predictor_sizes[]
static
Initial value:
= {
4, 8, 12, 16, 24, 32, 48, 64, 80, 96, 128, 160, 192, 224, 256, 0,
}

Definition at line 72 of file takdec.c.

Referenced by decode_subframe().

§ xcodes

const struct CParam xcodes[50]
static

Referenced by decode_segment().

§ ff_tak_decoder

AVCodec ff_tak_decoder
Initial value:
= {
.name = "tak",
.long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"),
.priv_data_size = sizeof(TAKDecContext),
.init_static_data = tak_init_static_data,
.capabilities = CODEC_CAP_DR1,
}
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:275
static av_cold int tak_decode_close(AVCodecContext *avctx)
Definition: takdec.c:908
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:684
sample_fmts
Definition: avconv_filter.c:68
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
static av_cold int tak_decode_init(AVCodecContext *avctx)
Definition: takdec.c:171
signed 32 bits, planar
Definition: samplefmt.h:71
unsigned 8 bits, planar
Definition: samplefmt.h:69
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:61
AV_SAMPLE_FMT_NONE
Definition: avconv_filter.c:68
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:490
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499
static int tak_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
Definition: takdec.c:671
signed 16 bits, planar
Definition: samplefmt.h:70
static av_cold void tak_init_static_data(AVCodec *codec)
Definition: takdec.c:135

Definition at line 918 of file takdec.c.