FFmpeg
Data Structures | Macros | Functions | Variables
ttaenc.c File Reference
#include "ttadata.h"
#include "ttaencdsp.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "put_bits.h"
#include "internal.h"
#include "libavutil/crc.h"

Go to the source code of this file.

Data Structures

struct  TTAEncContext
 

Macros

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

Functions

static av_cold int tta_encode_init (AVCodecContext *avctx)
 
static int32_t get_sample (const AVFrame *frame, int sample, enum AVSampleFormat format)
 
static int tta_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 
static av_cold int tta_encode_close (AVCodecContext *avctx)
 

Variables

const FFCodec ff_tta_encoder
 

Macro Definition Documentation

◆ BITSTREAM_WRITER_LE

#define BITSTREAM_WRITER_LE

Definition at line 21 of file ttaenc.c.

◆ PRED

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

Function Documentation

◆ tta_encode_init()

static av_cold int tta_encode_init ( AVCodecContext avctx)
static

Definition at line 38 of file ttaenc.c.

◆ get_sample()

static int32_t get_sample ( const AVFrame frame,
int  sample,
enum AVSampleFormat  format 
)
static

Definition at line 69 of file ttaenc.c.

Referenced by tta_encode_frame().

◆ tta_encode_frame()

static int tta_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)
static

Definition at line 87 of file ttaenc.c.

◆ tta_encode_close()

static av_cold int tta_encode_close ( AVCodecContext avctx)
static

Definition at line 198 of file ttaenc.c.

Variable Documentation

◆ ff_tta_encoder

const FFCodec ff_tta_encoder
Initial value:
= {
.p.name = "tta",
.p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_TTA,
.priv_data_size = sizeof(TTAEncContext),
.close = tta_encode_close,
.p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 205 of file ttaenc.c.

tta_encode_frame
static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: ttaenc.c:87
init
static int init
Definition: av_tx.c:47
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:263
tta_encode_close
static av_cold int tta_encode_close(AVCodecContext *avctx)
Definition: ttaenc.c:198
AV_CODEC_ID_TTA
@ AV_CODEC_ID_TTA
Definition: codec_id.h:447
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:116
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_SAMPLE_FMT_U8
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: samplefmt.h:57
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: codec_internal.h:31
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
TTAEncContext
Definition: ttaenc.c:31
AV_CODEC_CAP_SMALL_LAST_FRAME
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
Definition: codec.h:87
AV_SAMPLE_FMT_S32
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition: samplefmt.h:59
tta_encode_init
static av_cold int tta_encode_init(AVCodecContext *avctx)
Definition: ttaenc.c:38