FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
aic.c File Reference
#include <inttypes.h>
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "get_bits.h"
#include "golomb.h"
#include "idctdsp.h"
#include "thread.h"
#include "unary.h"

Go to the source code of this file.

Data Structures

struct  AICContext
 

Macros

#define AIC_HDR_SIZE   24
 
#define AIC_BAND_COEFFS   (64 + 32 + 192 + 96)
 
#define GET_CODE(val, type, add_bits)
 

Enumerations

enum  AICBands {
  COEFF_LUMA = 0, COEFF_CHROMA, COEFF_LUMA_EXT, COEFF_CHROMA_EXT,
  NUM_BANDS
}
 

Functions

static int aic_decode_header (AICContext *ctx, const uint8_t *src, int size)
 
static int aic_decode_coeffs (GetBitContext *gb, int16_t *dst, int band, int slice_width, int force_chroma)
 
static void recombine_block (int16_t *dst, const uint8_t *scan, int16_t **base, int16_t **ext)
 
static void recombine_block_il (int16_t *dst, const uint8_t *scan, int16_t **base, int16_t **ext, int block_no)
 
static void unquant_block (int16_t *block, int q, uint8_t *quant_matrix)
 
static int aic_decode_slice (AICContext *ctx, int mb_x, int mb_y, const uint8_t *src, int src_size)
 
static int aic_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int aic_decode_init (AVCodecContext *avctx)
 
static av_cold int aic_decode_close (AVCodecContext *avctx)
 

Variables

static const int aic_num_band_coeffs [NUM_BANDS] = { 64, 32, 192, 96 }
 
static const int aic_band_off [NUM_BANDS] = { 0, 64, 96, 288 }
 
static const uint8_t aic_quant_matrix [64]
 
static const uint8_t aic_y_scan [64]
 
static const uint8_t aic_y_ext_scan [192]
 
static const uint8_t aic_c_scan [64]
 
static const uint8_t aic_c_ext_scan [192]
 
static const uint8_t *const aic_scan [NUM_BANDS]
 
AVCodec ff_aic_decoder
 

Macro Definition Documentation

#define AIC_HDR_SIZE   24

Definition at line 34 of file aic.c.

Referenced by aic_decode_frame(), and aic_decode_header().

#define AIC_BAND_COEFFS   (64 + 32 + 192 + 96)

Definition at line 35 of file aic.c.

Referenced by aic_decode_init(), and aic_decode_slice().

#define GET_CODE (   val,
  type,
  add_bits 
)
Value:
do { \
val = get_unary(gb, 1, 31); \
if (add_bits) \
val = (val << add_bits) + get_bits(gb, add_bits); \
} while (0)
const char const char void * val
Definition: avisynth_c.h:771
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:261
static int get_ue_golomb(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to 8190.
Definition: golomb.h:53
GLint GLenum type
Definition: opengl_enc.c:105
if(ret< 0)
Definition: vf_mcdeint.c:279
static int get_unary(GetBitContext *gb, int stop, int len)
Get unary code of limited length.
Definition: unary.h:33

Definition at line 192 of file aic.c.

Referenced by aic_decode_coeffs().

Enumeration Type Documentation

enum AICBands
Enumerator
COEFF_LUMA 
COEFF_CHROMA 
COEFF_LUMA_EXT 
COEFF_CHROMA_EXT 
NUM_BANDS 

Definition at line 37 of file aic.c.

Function Documentation

static int aic_decode_header ( AICContext ctx,
const uint8_t src,
int  size 
)
static

Definition at line 159 of file aic.c.

Referenced by aic_decode_frame().

static int aic_decode_coeffs ( GetBitContext gb,
int16_t *  dst,
int  band,
int  slice_width,
int  force_chroma 
)
static

Definition at line 202 of file aic.c.

Referenced by aic_decode_slice().

static void recombine_block ( int16_t *  dst,
const uint8_t scan,
int16_t **  base,
int16_t **  ext 
)
static

Definition at line 250 of file aic.c.

Referenced by aic_decode_slice().

static void recombine_block_il ( int16_t *  dst,
const uint8_t scan,
int16_t **  base,
int16_t **  ext,
int  block_no 
)
static

Definition at line 270 of file aic.c.

Referenced by aic_decode_slice().

static void unquant_block ( int16_t *  block,
int  q,
uint8_t quant_matrix 
)
static

Definition at line 292 of file aic.c.

Referenced by aic_decode_slice().

static int aic_decode_slice ( AICContext ctx,
int  mb_x,
int  mb_y,
const uint8_t src,
int  src_size 
)
static

Definition at line 305 of file aic.c.

Referenced by aic_decode_frame().

static int aic_decode_frame ( AVCodecContext avctx,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 369 of file aic.c.

static av_cold int aic_decode_init ( AVCodecContext avctx)
static

Definition at line 429 of file aic.c.

static av_cold int aic_decode_close ( AVCodecContext avctx)
static

Definition at line 475 of file aic.c.

Variable Documentation

const int aic_num_band_coeffs[NUM_BANDS] = { 64, 32, 192, 96 }
static

Definition at line 45 of file aic.c.

Referenced by aic_decode_coeffs().

const int aic_band_off[NUM_BANDS] = { 0, 64, 96, 288 }
static

Definition at line 47 of file aic.c.

Referenced by aic_decode_init().

const uint8_t aic_quant_matrix[64]
static
Initial value:
= {
8, 16, 19, 22, 22, 26, 26, 27,
16, 16, 22, 22, 26, 27, 27, 29,
19, 22, 26, 26, 27, 29, 29, 35,
22, 24, 27, 27, 29, 32, 34, 38,
26, 27, 29, 29, 32, 35, 38, 46,
27, 29, 34, 34, 35, 40, 46, 56,
29, 34, 34, 37, 40, 48, 56, 69,
34, 37, 38, 40, 48, 58, 69, 83,
}

Definition at line 49 of file aic.c.

Referenced by aic_decode_init().

const uint8_t aic_y_scan[64]
static
Initial value:
= {
0, 4, 1, 2, 5, 8, 12, 9,
6, 3, 7, 10, 13, 14, 11, 15,
47, 43, 46, 45, 42, 39, 35, 38,
41, 44, 40, 37, 34, 33, 36, 32,
16, 20, 17, 18, 21, 24, 28, 25,
22, 19, 23, 26, 29, 30, 27, 31,
63, 59, 62, 61, 58, 55, 51, 54,
57, 60, 56, 53, 50, 49, 52, 48,
}

Definition at line 60 of file aic.c.

const uint8_t aic_y_ext_scan[192]
static
Initial value:
= {
64, 72, 65, 66, 73, 80, 88, 81,
74, 67, 75, 82, 89, 90, 83, 91,
0, 4, 1, 2, 5, 8, 12, 9,
6, 3, 7, 10, 13, 14, 11, 15,
16, 20, 17, 18, 21, 24, 28, 25,
22, 19, 23, 26, 29, 30, 27, 31,
155, 147, 154, 153, 146, 139, 131, 138,
145, 152, 144, 137, 130, 129, 136, 128,
47, 43, 46, 45, 42, 39, 35, 38,
41, 44, 40, 37, 34, 33, 36, 32,
63, 59, 62, 61, 58, 55, 51, 54,
57, 60, 56, 53, 50, 49, 52, 48,
96, 104, 97, 98, 105, 112, 120, 113,
106, 99, 107, 114, 121, 122, 115, 123,
68, 76, 69, 70, 77, 84, 92, 85,
78, 71, 79, 86, 93, 94, 87, 95,
100, 108, 101, 102, 109, 116, 124, 117,
110, 103, 111, 118, 125, 126, 119, 127,
187, 179, 186, 185, 178, 171, 163, 170,
177, 184, 176, 169, 162, 161, 168, 160,
159, 151, 158, 157, 150, 143, 135, 142,
149, 156, 148, 141, 134, 133, 140, 132,
191, 183, 190, 189, 182, 175, 167, 174,
181, 188, 180, 173, 166, 165, 172, 164,
}

Definition at line 71 of file aic.c.

const uint8_t aic_c_scan[64]
static
Initial value:
= {
0, 4, 1, 2, 5, 8, 12, 9,
6, 3, 7, 10, 13, 14, 11, 15,
31, 27, 30, 29, 26, 23, 19, 22,
25, 28, 24, 21, 18, 17, 20, 16,
32, 36, 33, 34, 37, 40, 44, 41,
38, 35, 39, 42, 45, 46, 43, 47,
63, 59, 62, 61, 58, 55, 51, 54,
57, 60, 56, 53, 50, 49, 52, 48,
}

Definition at line 98 of file aic.c.

const uint8_t aic_c_ext_scan[192]
static
Initial value:
= {
16, 24, 17, 18, 25, 32, 40, 33,
26, 19, 27, 34, 41, 42, 35, 43,
0, 4, 1, 2, 5, 8, 12, 9,
6, 3, 7, 10, 13, 14, 11, 15,
20, 28, 21, 22, 29, 36, 44, 37,
30, 23, 31, 38, 45, 46, 39, 47,
95, 87, 94, 93, 86, 79, 71, 78,
85, 92, 84, 77, 70, 69, 76, 68,
63, 59, 62, 61, 58, 55, 51, 54,
57, 60, 56, 53, 50, 49, 52, 48,
91, 83, 90, 89, 82, 75, 67, 74,
81, 88, 80, 73, 66, 65, 72, 64,
112, 120, 113, 114, 121, 128, 136, 129,
122, 115, 123, 130, 137, 138, 131, 139,
96, 100, 97, 98, 101, 104, 108, 105,
102, 99, 103, 106, 109, 110, 107, 111,
116, 124, 117, 118, 125, 132, 140, 133,
126, 119, 127, 134, 141, 142, 135, 143,
191, 183, 190, 189, 182, 175, 167, 174,
181, 188, 180, 173, 166, 165, 172, 164,
159, 155, 158, 157, 154, 151, 147, 150,
153, 156, 152, 149, 146, 145, 148, 144,
187, 179, 186, 185, 178, 171, 163, 170,
177, 184, 176, 169, 162, 161, 168, 160,
}

Definition at line 109 of file aic.c.

const uint8_t* const aic_scan[NUM_BANDS]
static
Initial value:
= {
}
static const uint8_t aic_c_scan[64]
Definition: aic.c:98
static const uint8_t aic_y_scan[64]
Definition: aic.c:60
static const uint8_t aic_c_ext_scan[192]
Definition: aic.c:109
static const uint8_t aic_y_ext_scan[192]
Definition: aic.c:71

Definition at line 136 of file aic.c.

Referenced by aic_decode_coeffs().

AVCodec ff_aic_decoder
Initial value:
= {
.name = "aic",
.long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"),
.priv_data_size = sizeof(AICContext),
.close = aic_decode_close,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}
static int init_thread_copy(AVCodecContext *avctx)
Definition: tta.c:392
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
#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: internal.h:40
static av_cold int aic_decode_init(AVCodecContext *avctx)
Definition: aic.c:429
#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 aic_decode_close(AVCodecContext *avctx)
Definition: aic.c:475
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1065
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:218
static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: aic.c:369
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:1002

Definition at line 484 of file aic.c.