FFmpeg
Loading...
Searching...
No Matches
mace.c File Reference

MACE decoder. More...

#include "avcodec.h"
#include "codec_internal.h"
#include "decode.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)
 

Functions

static int16_t mace_broken_clip_int16 (int n)
 MACE version of av_clip_int16().
 
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, AVFrame *frame, 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 [] 
 
const FFCodec ff_mace3_decoder
 
const FFCodec ff_mace6_decoder
 

Detailed Description

MACE decoder.

Definition in file mace.c.

Macro Definition Documentation

◆ QT_8S_2_16S

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

Definition at line 152 of file mace.c.

Referenced by chomp3(), and chomp6().

Function Documentation

◆ mace_broken_clip_int16()

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 166 of file mace.c.

Referenced by chomp3(), and chomp6().

◆ read_table()

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

Definition at line 176 of file mace.c.

Referenced by chomp3(), and chomp6().

◆ chomp3()

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

Definition at line 191 of file mace.c.

Referenced by mace_decode_frame().

◆ chomp6()

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().

◆ mace_decode_init()

static av_cold int mace_decode_init ( AVCodecContext * avctx)
static

Definition at line 227 of file mace.c.

◆ mace_decode_frame()

static int mace_decode_frame ( AVCodecContext * avctx,
AVFrame * frame,
int * got_frame_ptr,
AVPacket * avpkt )
static

Definition at line 236 of file mace.c.

Variable Documentation

◆ MACEtab1

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

Definition at line 38 of file mace.c.

◆ MACEtab3

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

Definition at line 40 of file mace.c.

◆ MACEtab2

const int16_t MACEtab2[][4]
static

Definition at line 42 of file mace.c.

◆ MACEtab4

const int16_t MACEtab4[][2]
static

Definition at line 109 of file mace.c.

◆ tab1

const int16_t* tab1

◆ tab2

const int16_t* tab2

Definition at line 145 of file mace.c.

Referenced by dxv_decompress_cocg(), and ff_acelp_fc_pulse_per_track().

◆ stride

int stride

Definition at line 145 of file mace.c.

◆ [struct]

const struct { ... } tabs[]
Initial value:
= {
{MACEtab1, &MACEtab2[0][0], 4},
{MACEtab3, &MACEtab4[0][0], 2},
{MACEtab1, &MACEtab2[0][0], 4}
}
static const int16_t MACEtab4[][2]
Definition mace.c:109
static const int16_t MACEtab2[][4]
Definition mace.c:42
static const int16_t MACEtab1[]
Definition mace.c:38
static const int16_t MACEtab3[]
Definition mace.c:40

Referenced by pretwiddle(), read_table(), twiddle(), and very_broken_op().

◆ ff_mace3_decoder

const FFCodec ff_mace3_decoder
Initial value:
= {
.p.name = "mace3",
CODEC_LONG_NAME("MACE (Macintosh Audio Compression/Expansion) 3:1"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(MACEContext),
.p.capabilities = AV_CODEC_CAP_DR1,
}
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
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
@ AV_CODEC_ID_MACE3
Definition codec_id.h:462
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
static int mace_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition mace.c:236
static av_cold int mace_decode_init(AVCodecContext *avctx)
Definition mace.c:227

Definition at line 290 of file mace.c.

◆ ff_mace6_decoder

const FFCodec ff_mace6_decoder
Initial value:
= {
.p.name = "mace6",
CODEC_LONG_NAME("MACE (Macintosh Audio Compression/Expansion) 6:1"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(MACEContext),
.p.capabilities = AV_CODEC_CAP_DR1,
}
@ AV_CODEC_ID_MACE6
Definition codec_id.h:463

Definition at line 301 of file mace.c.