FFmpeg  4.0
Data Structures | Macros | Functions | Variables
tta.c File Reference

TTA (The Lossless True Audio) decoder. More...

#include <limits.h>
#include "libavutil/crc.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "ttadata.h"
#include "ttadsp.h"
#include "avcodec.h"
#include "get_bits.h"
#include "thread.h"
#include "unary.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  TTAContext
 

Macros

#define BITSTREAM_READER_LE
 
#define FORMAT_SIMPLE   1
 
#define FORMAT_ENCRYPTED   2
 
#define PRED(x, k)   (int32_t)((((uint64_t)(x) << (k)) - (x)) >> (k))
 
#define OFFSET(x)   offsetof(TTAContext, x)
 
#define DEC   (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
 

Functions

static int tta_check_crc (TTAContext *s, const uint8_t *buf, int buf_size)
 
static uint64_t tta_check_crc64 (uint8_t *pass)
 
static int allocate_buffers (AVCodecContext *avctx)
 
static av_cold int tta_decode_init (AVCodecContext *avctx)
 
static int tta_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 
static int init_thread_copy (AVCodecContext *avctx)
 
static av_cold int tta_decode_close (AVCodecContext *avctx)
 

Variables

static const int64_t tta_channel_layouts [7]
 
static const AVOption options []
 
static const AVClass tta_decoder_class
 
AVCodec ff_tta_decoder
 

Detailed Description

TTA (The Lossless True Audio) decoder.

See also
http://www.true-audio.com/
http://tta.corecodec.org/
Author
Alex Beregszaszi

Definition in file tta.c.

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 36 of file tta.c.

◆ FORMAT_SIMPLE

#define FORMAT_SIMPLE   1

Definition at line 45 of file tta.c.

◆ FORMAT_ENCRYPTED

#define FORMAT_ENCRYPTED   2

Definition at line 46 of file tta.c.

Referenced by tta_decode_frame(), and tta_decode_init().

◆ PRED

#define PRED (   x,
 
)    (int32_t)((((uint64_t)(x) << (k)) - (x)) >> (k))

Referenced by tta_decode_frame().

◆ OFFSET

#define OFFSET (   x)    offsetof(TTAContext, x)

Definition at line 410 of file tta.c.

◆ DEC

Definition at line 411 of file tta.c.

Function Documentation

◆ tta_check_crc()

static int tta_check_crc ( TTAContext s,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 75 of file tta.c.

Referenced by tta_decode_frame().

◆ tta_check_crc64()

static uint64_t tta_check_crc64 ( uint8_t pass)
static

Definition at line 89 of file tta.c.

Referenced by tta_decode_init().

◆ allocate_buffers()

static int allocate_buffers ( AVCodecContext avctx)
static

Definition at line 104 of file tta.c.

Referenced by init_thread_copy(), and tta_decode_init().

◆ tta_decode_init()

static av_cold int tta_decode_init ( AVCodecContext avctx)
static

Definition at line 123 of file tta.c.

◆ tta_decode_frame()

static int tta_decode_frame ( AVCodecContext avctx,
void data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 219 of file tta.c.

◆ init_thread_copy()

static int init_thread_copy ( AVCodecContext avctx)
static

◆ tta_decode_close()

static av_cold int tta_decode_close ( AVCodecContext avctx)
static

Definition at line 399 of file tta.c.

Variable Documentation

◆ tta_channel_layouts

const int64_t tta_channel_layouts[7]
static
Initial value:
= {
0,
AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER,
}
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LOW_FREQUENCY
#define AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_BACK_CENTER
#define AV_CH_LAYOUT_7POINT1_WIDE

Definition at line 65 of file tta.c.

Referenced by tta_decode_init().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "password", "Set decoding password", OFFSET(pass), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, DEC },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: tta.c:410
#define pass
Definition: fft_template.c:593
#define DEC
Definition: tta.c:411

Definition at line 412 of file tta.c.

◆ tta_decoder_class

const AVClass tta_decoder_class
static
Initial value:
= {
.class_name = "TTA Decoder",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: tta.c:412

Definition at line 417 of file tta.c.

◆ ff_tta_decoder

AVCodec ff_tta_decoder
Initial value:
= {
.name = "tta",
.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
.priv_data_size = sizeof(TTAContext),
.close = tta_decode_close,
.priv_class = &tta_decoder_class,
}
static int init_thread_copy(AVCodecContext *avctx)
Definition: tta.c:392
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int tta_decode_init(AVCodecContext *avctx)
Definition: tta.c:123
static int tta_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: tta.c:219
Definition: tta.c:48
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
static av_cold int tta_decode_close(AVCodecContext *avctx)
Definition: tta.c:399
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1015
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:225
static const AVClass tta_decoder_class
Definition: tta.c:417
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959

Definition at line 424 of file tta.c.