FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
mace.c File Reference

MACE decoder. More...

#include "avcodec.h"
#include "internal.h"
#include "libavutil/common.h"

Go to the source code of this file.

Data Structures

struct  ChannelData
 
struct  MACEContext
 

Macros

#define QT_8S_2_16S(x)   (((x) & 0xFF00) | (((x) >> 8) & 0xFF))
 

Functions

static int16_t mace_broken_clip_int16 (int n)
 MACE version of av_clip_int16(). More...
 
static int16_t read_table (ChannelData *chd, uint8_t val, int tab_idx)
 
static void chomp3 (ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
 
static void chomp6 (ChannelData *chd, int16_t *output, uint8_t val, int tab_idx)
 
static av_cold int mace_decode_init (AVCodecContext *avctx)
 
static int mace_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

static const int16_t MACEtab1 [] = {-13, 8, 76, 222, 222, 76, 8, -13}
 
static const int16_t MACEtab3 [] = {-18, 140, 140, -18}
 
static const int16_t MACEtab2 [][4]
 
static const int16_t MACEtab4 [][2]
 
struct {
   const int16_t *   tab1
 
   const int16_t *   tab2
 
   int   stride
 
tabs []
 
AVCodec ff_mace3_decoder
 
AVCodec ff_mace6_decoder
 

Detailed Description

MACE decoder.

Definition in file mace.c.

Macro Definition Documentation

#define QT_8S_2_16S (   x)    (((x) & 0xFF00) | (((x) >> 8) & 0xFF))

Definition at line 151 of file mace.c.

Referenced by chomp3(), and chomp6().

Function Documentation

static int16_t mace_broken_clip_int16 ( int  n)
inlinestatic

MACE version of av_clip_int16().

We have to do this to keep binary identical output to the binary decoder.

Definition at line 165 of file mace.c.

Referenced by chomp3(), and chomp6().

static int16_t read_table ( ChannelData chd,
uint8_t  val,
int  tab_idx 
)
static

Definition at line 175 of file mace.c.

Referenced by chomp3(), and chomp6().

static void chomp3 ( ChannelData chd,
int16_t *  output,
uint8_t  val,
int  tab_idx 
)
static

Definition at line 190 of file mace.c.

Referenced by mace_decode_frame().

static void chomp6 ( ChannelData chd,
int16_t *  output,
uint8_t  val,
int  tab_idx 
)
static

Definition at line 201 of file mace.c.

Referenced by mace_decode_frame().

static av_cold int mace_decode_init ( AVCodecContext avctx)
static

Definition at line 227 of file mace.c.

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

Definition at line 236 of file mace.c.

Variable Documentation

const int16_t MACEtab1[] = {-13, 8, 76, 222, 222, 76, 8, -13}
static

Definition at line 37 of file mace.c.

const int16_t MACEtab3[] = {-18, 140, 140, -18}
static

Definition at line 39 of file mace.c.

const int16_t MACEtab2[][4]
static

Definition at line 41 of file mace.c.

const int16_t MACEtab4[][2]
static

Definition at line 108 of file mace.c.

const int16_t* tab1

Definition at line 144 of file mace.c.

Referenced by compute_stereo(), dequant(), and main().

const int16_t* tab2

Definition at line 144 of file mace.c.

Referenced by main().

Definition at line 144 of file mace.c.

const { ... } tabs[]
Initial value:
= {
{MACEtab1, &MACEtab2[0][0], 4},
{MACEtab3, &MACEtab4[0][0], 2},
{MACEtab1, &MACEtab2[0][0], 4}
}
static const int16_t MACEtab1[]
Definition: mace.c:37
static const int16_t MACEtab3[]
Definition: mace.c:39
static const int16_t MACEtab2[][4]
Definition: mace.c:41
static const int16_t MACEtab4[][2]
Definition: mace.c:108

Referenced by read_table(), and very_broken_op().

AVCodec ff_mace3_decoder
Initial value:
= {
.name = "mace3",
.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"),
.priv_data_size = sizeof(MACEContext),
.capabilities = AV_CODEC_CAP_DR1,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
static int mace_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: mace.c:236
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static av_cold int mace_decode_init(AVCodecContext *avctx)
Definition: mace.c:227
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
signed 16 bits, planar
Definition: samplefmt.h:67
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:1002

Definition at line 287 of file mace.c.

AVCodec ff_mace6_decoder
Initial value:
= {
.name = "mace6",
.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"),
.priv_data_size = sizeof(MACEContext),
.capabilities = AV_CODEC_CAP_DR1,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
static int mace_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: mace.c:236
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static av_cold int mace_decode_init(AVCodecContext *avctx)
Definition: mace.c:227
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:701
signed 16 bits, planar
Definition: samplefmt.h:67
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:1002

Definition at line 300 of file mace.c.