mace.c File Reference

MACE decoder. More...

#include "avcodec.h"
#include "internal.h"
#include "libavutil/common.h"
Include dependency graph for mace.c:

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

Typedefs

typedef struct ChannelData ChannelData
 
typedef struct MACEContext MACEContext
 

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

Typedef Documentation

typedef struct ChannelData ChannelData
typedef struct MACEContext MACEContext

Function Documentation

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 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 int mace_decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 236 of file mace.c.

static av_cold int mace_decode_init ( AVCodecContext avctx)
static

Definition at line 227 of file mace.c.

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

Variable Documentation

AVCodec ff_mace3_decoder
Initial value:
= {
.name = "mace3",
.priv_data_size = sizeof(MACEContext),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int mace_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: mace.c:236
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
struct MACEContext MACEContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int mace_decode_init(AVCodecContext *avctx)
Definition: mace.c:227
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:49
signed 16 bits, planar
Definition: samplefmt.h:58
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868

Definition at line 280 of file mace.c.

AVCodec ff_mace6_decoder
Initial value:
= {
.name = "mace6",
.priv_data_size = sizeof(MACEContext),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"),
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int mace_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: mace.c:236
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
struct MACEContext MACEContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int mace_decode_init(AVCodecContext *avctx)
Definition: mace.c:227
AVSampleFormat
Audio Sample Formats.
Definition: samplefmt.h:49
signed 16 bits, planar
Definition: samplefmt.h:58
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868

Definition at line 293 of file mace.c.

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

Definition at line 37 of file mace.c.

const int16_t MACEtab2[][4]
static

Definition at line 41 of file mace.c.

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

Definition at line 39 of file mace.c.

const int16_t MACEtab4[][2]
static

Definition at line 108 of file mace.c.

int stride

Definition at line 144 of file mace.c.

Referenced by aasc_decode_frame(), add_rect_clamped_c(), adpcm_compress_trellis(), advance_line(), allocStuff(), apply_loop_filter(), av_frame_set_qp_table(), avg_no_rnd_vc1_chroma_mc8_c(), avg_tpel_pixels_mc01_c(), avg_tpel_pixels_mc02_c(), avg_tpel_pixels_mc10_c(), avg_tpel_pixels_mc11_c(), avg_tpel_pixels_mc12_c(), avg_tpel_pixels_mc20_c(), avg_tpel_pixels_mc21_c(), avg_tpel_pixels_mc22_c(), avs_decode_frame(), bink_decode_plane(), binkb_decode_plane(), bitplane_decoding(), biweight_h264_W_altivec(), block_cmp(), cavs_idct8_add_c(), cdg_copy_rect_buf(), cdg_scroll(), cdg_tile_block(), check_bidir_mv(), checkline(), cmp_direct_inline(), cmp_inline(), codec37_mv(), copy_block(), correlate(), DECLARE_ALIGNED(), decode(), decode_13(), decode_555(), decode_dct_block(), decode_fill_block(), decode_frame(), decode_haar_block(), decode_hybrid(), decode_i2_frame(), decode_image_block(), decode_init(), decode_p_block(), decode_p_frame(), decode_pixel_in_context(), decode_plane(), decode_region(), decode_region_intra(), decode_region_masked(), decode_rowskip(), decorrelate(), deInterlaceBlendLinear(), deInterlaceFF(), deInterlaceInterpolateCubic(), deInterlaceInterpolateLinear(), deInterlaceL5(), deInterlaceMedian(), dequant(), dequantize(), dering(), diff_pixels_altivec(), diff_pixels_c(), diff_pixels_mvi(), dirac_hpel_filter(), do_a_deblock_C(), doHorizDefFilter_C(), doHorizLowPass_C(), doVertDefFilter(), doVertLowPass(), doVertLowPass_altivec(), draw_line(), draw_n_color(), duplicate(), encode_block(), encode_frame(), encode_q_branch(), encode_subband_c0run(), fdct_get(), ff_apply_vector_2x2(), ff_apply_vector_4x4(), ff_ccitt_unpack(), ff_gmc1_altivec(), ff_gmc_c(), ff_h263_decode_mb(), ff_h264_add_pixels4(), ff_h264_add_pixels8(), ff_h264_idct_add_altivec(), ff_idct_add_altivec(), ff_idct_put_altivec(), ff_init_me(), ff_jpegls_decode_picture(), ff_mss34_dct_put(), ff_snow_pred_block(), ff_spatial_idwt_init2(), ff_vp6_filter_diag4_c(), fillPlane(), fillPlane16(), filter181(), filter_common(), filter_mbedge(), for(), fraps2_decode_plane(), get(), get_dc(), get_frame_mb(), get_intra_count(), get_visual_weight(), gmc1_c(), guess_dc(), h261_loop_filter(), h263_mv4_search(), h263_v_loop_filter_c(), h264_idct_dc_add_internal(), h264_v_loop_filter_chroma(), h264_v_loop_filter_chroma_intra(), h264_v_loop_filter_luma(), h264_v_loop_filter_luma_intra(), h_block_filter(), hadamard8_diff16_altivec(), hl_decode_mb(), hl_decode_mb_idct_luma(), hl_decode_mb_predict_luma(), horizX1Filter(), hpel_motion_lowres(), idct(), idct_put(), init_mv4_ref(), init_ref(), interlaced_search(), INTERPOLATE_METHOD(), ir2_decode_plane(), ir2_decode_plane_inter(), isHorizDC_C(), isHorizMinMaxOk_C(), isVertDC_C(), iterative_me(), lag_decode_arith_plane(), lag_pred_line(), lag_pred_line_yuy2(), left_predict(), loco_decode_plane(), loco_predict(), ls_decode_line(), ls_encode_line(), main(), mangle_rgb_planes(), MC_avg_no_round_o_16_vis(), MC_avg_no_round_x_16_vis(), MC_avg_no_round_xy_16_vis(), MC_avg_no_round_y_16_vis(), MC_avg_o_16_vis(), MC_avg_o_8_vis(), MC_avg_x_16_vis(), MC_avg_x_8_vis(), MC_avg_xy_16_vis(), MC_avg_xy_8_vis(), MC_avg_y_16_vis(), MC_avg_y_8_vis(), mc_block(), MC_put_no_round_o_16_vis(), MC_put_no_round_o_8_vis(), MC_put_no_round_x_16_vis(), MC_put_no_round_x_8_vis(), MC_put_no_round_xy_16_vis(), MC_put_no_round_xy_8_vis(), MC_put_no_round_y_16_vis(), MC_put_no_round_y_8_vis(), MC_put_o_16_vis(), MC_put_o_8_vis(), MC_put_x_16_vis(), MC_put_x_8_vis(), MC_put_xy_16_vis(), MC_put_xy_8_vis(), MC_put_y_16_vis(), MC_put_y_8_vis(), mcdc(), median_predict(), mpeg4_decode_partition_a(), msvideo1_decode_16bit(), msvideo1_decode_8bit(), nsse16_c(), nsse8_c(), old_codec37(), old_codec47(), paint_raw(), paint_rect(), pcx_decode_frame(), postProcess(), pp_get_context(), pred16x16_dc(), pred16x16_horizontal(), pred16x16_left_dc(), pred16x16_plane(), pred16x16_tm_vp8_c(), pred16x16_top_dc(), pred16x16_vertical(), pred4x4_127_dc(), pred4x4_128_dc(), pred4x4_129_dc(), pred4x4_dc(), pred4x4_down_left(), pred4x4_down_left_rv40_c(), pred4x4_down_left_rv40_nodown_c(), pred4x4_down_left_svq3_c(), pred4x4_down_right(), pred4x4_horizontal(), pred4x4_horizontal_add(), pred4x4_horizontal_down(), pred4x4_horizontal_up(), pred4x4_horizontal_up_rv40_c(), pred4x4_horizontal_up_rv40_nodown_c(), pred4x4_horizontal_vp8_c(), pred4x4_left_dc(), pred4x4_tm_vp8_c(), pred4x4_top_dc(), pred4x4_vertical(), pred4x4_vertical_add(), pred4x4_vertical_left(), pred4x4_vertical_left_rv40(), pred4x4_vertical_left_vp8_c(), pred4x4_vertical_right(), pred4x4_vertical_vp8_c(), pred8x16_dc(), pred8x16_left_dc(), pred8x16_mad_cow_dc_0l0(), pred8x16_mad_cow_dc_0lt(), pred8x16_mad_cow_dc_l00(), pred8x16_mad_cow_dc_l0t(), pred8x16_plane(), pred8x16_top_dc(), pred8x8_dc(), pred8x8_dc_rv40_c(), pred8x8_left_dc_rv40_c(), pred8x8_mad_cow_dc_0l0(), pred8x8_mad_cow_dc_0lt(), pred8x8_mad_cow_dc_l00(), pred8x8_mad_cow_dc_l0t(), pred8x8_plane(), pred8x8_tm_vp8_c(), pred8x8_top_dc(), pred8x8_top_dc_rv40_c(), pred8x8l_horizontal_add(), pred8x8l_vertical_add(), prefetch_ppc(), preview_obmc(), process_block(), ps_hybrid_analysis_c(), ptx_decode_frame(), put_cursor(), put_no_rnd_vc1_chroma_mc4_c(), put_no_rnd_vc1_chroma_mc8_c(), put_obmc(), put_tpel_pixels_mc01_c(), put_tpel_pixels_mc02_c(), put_tpel_pixels_mc10_c(), put_tpel_pixels_mc11_c(), put_tpel_pixels_mc12_c(), put_tpel_pixels_mc20_c(), put_tpel_pixels_mc21_c(), put_tpel_pixels_mc22_c(), qpeg_decode_inter(), qpeg_decode_intra(), quantize(), ratecontrol_1pass(), read_table(), reallocBuffers(), render_slice(), restore_median(), restore_median_il(), restore_rgb_planes(), rl2_rle_decode(), rpza_decode_stream(), rv30_weak_loop_filter(), rv34_idct_add_c(), rv34_idct_dc_add_c(), rv34_pred_4x4_block(), rv40_adaptive_loop_filter(), rv40_loop_filter_strength(), rv40_strong_loop_filter(), rv40_weak_loop_filter(), sad_hpel_motion_search(), skip_check(), smc_decode_stream(), snow_horizontal_compose_liftS_lead_out(), spatial_compose53i_dy(), spatial_compose53i_init(), spatial_compose53i_init2(), spatial_compose97i_dy(), spatial_compose97i_init(), spatial_compose97i_init2(), spatial_compose_daub97i_dy(), spatial_compose_dd137i_dy(), spatial_compose_dd137i_init(), spatial_compose_dd97i_dy(), spatial_compose_dd97i_init(), spatial_compose_dirac53i_dy(), spatial_compose_fidelity(), spatial_compose_haari_dy(), spatial_decompose53i(), spatial_decompose97i(), sse(), sunrast_decode_frame(), svq1_encode_plane(), tempNoiseReducer(), tiff_unpack_strip(), tm2_apply_deltas(), tm2_high_chroma(), tscc2_decode_mb(), tscc2_idct4_put(), txd_decode_frame(), v_block_filter(), vble_restore_plane(), vc1_filter_line(), vc1_h_overlap_c(), vc1_inv_trans_8x4_altivec(), vc1_v_overlap_c(), vertClassify_altivec(), vertX1Filter(), vp3_h_loop_filter_c(), vp3_v_loop_filter_c(), vp56_mc(), vp56_size_changed(), vp6_block_variance(), vp6_filter(), vp6_filter_diag2(), vp6_filter_hv4(), vp8_idct_add_c(), vp8_idct_dc_add_c(), vsad16_c(), vsse16_c(), w_c(), weight_h264_W_altivec(), wmv2_mspel8_h_lowpass(), write_plane(), xan_wc3_copy_pixel_run(), xan_wc3_output_pixel_run(), and zero12v_decode_frame().

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

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