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 "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 33 of file aic.c.

Referenced by aic_decode_frame(), and aic_decode_header().

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

Definition at line 34 of file aic.c.

Referenced by aic_decode_init(), and aic_decode_slice().

#define GET_CODE (   val,
  type,
  add_bits 
)
Value:
do { \
if (type) \
val = get_ue_golomb(gb); \
else \
val = get_unary(gb, 1, 31); \
if (add_bits) \
val = (val << add_bits) + get_bits(gb, add_bits); \
} while (0)

Definition at line 191 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 36 of file aic.c.

Function Documentation

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

Definition at line 158 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 201 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 249 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 269 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 291 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 304 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 368 of file aic.c.

static av_cold int aic_decode_init ( AVCodecContext avctx)
static

Definition at line 420 of file aic.c.

static av_cold int aic_decode_close ( AVCodecContext avctx)
static

Definition at line 466 of file aic.c.

Variable Documentation

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

Definition at line 44 of file aic.c.

Referenced by aic_decode_coeffs().

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

Definition at line 46 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 48 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 59 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 70 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 97 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 108 of file aic.c.

const uint8_t* const aic_scan[NUM_BANDS]
static
Initial value:

Definition at line 135 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),
.capabilities = CODEC_CAP_DR1,
}

Definition at line 475 of file aic.c.