FFmpeg
Data Structures | Macros | Functions | Variables
agm.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avcodec.h"
#include "bytestream.h"
#include "copy_block.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  MotionVector
 
struct  AGMContext
 
struct  Node
 

Macros

#define BITSTREAM_READER_LE
 

Functions

static int read_code (GetBitContext *gb, int *oskip, int *level, int *map, int mode)
 
static int decode_intra_blocks (AGMContext *s, GetBitContext *gb, const int *quant_matrix, int *skip, int *dc_level)
 
static int decode_inter_blocks (AGMContext *s, GetBitContext *gb, const int *quant_matrix, int *skip, int *map)
 
static int decode_intra_block (AGMContext *s, GetBitContext *gb, const int *quant_matrix, int *skip, int *dc_level)
 
static int decode_intra_plane (AGMContext *s, GetBitContext *gb, int size, const int *quant_matrix, AVFrame *frame, int plane)
 
static int decode_inter_block (AGMContext *s, GetBitContext *gb, const int *quant_matrix, int *skip, int *map)
 
static int decode_inter_plane (AGMContext *s, GetBitContext *gb, int size, const int *quant_matrix, AVFrame *frame, AVFrame *prev, int plane)
 
static void compute_quant_matrix (AGMContext *s, double qscale)
 
static int decode_raw_intra_rgb (AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
 
static int fill_pixels (uint8_t **y0, uint8_t **y1, uint8_t **u, uint8_t **v, int ylinesize, int ulinesize, int vlinesize, uint8_t *fill, int *nx, int *ny, int *np, int w, int h)
 
static int decode_runlen_rgb (AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
 
static int decode_runlen (AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
 
static int decode_raw_intra (AVCodecContext *avctx, GetByteContext *gbyte, AVFrame *frame)
 
static int decode_intra (AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame)
 
static int decode_motion_vectors (AVCodecContext *avctx, GetBitContext *gb)
 
static int decode_inter (AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame, AVFrame *prev)
 
static void get_tree_codes (uint32_t *codes, Node *nodes, int idx, uint32_t pfx, int bitpos)
 
static int make_new_tree (const uint8_t *bitlens, uint32_t *codes)
 
static int build_huff (const uint8_t *bitlen, VLC *vlc)
 
static int decode_huffman2 (AVCodecContext *avctx, int header, int size)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static void decode_flush (AVCodecContext *avctx)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

static const uint8_t unscaled_luma [64]
 
static const uint8_t unscaled_chroma [64]
 
AVCodec ff_agm_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 27 of file agm.c.

Function Documentation

◆ read_code()

static int read_code ( GetBitContext gb,
int oskip,
int level,
int map,
int  mode 
)
static

◆ decode_intra_blocks()

static int decode_intra_blocks ( AGMContext s,
GetBitContext gb,
const int quant_matrix,
int skip,
int dc_level 
)
static

Definition at line 194 of file agm.c.

Referenced by decode_intra_plane().

◆ decode_inter_blocks()

static int decode_inter_blocks ( AGMContext s,
GetBitContext gb,
const int quant_matrix,
int skip,
int map 
)
static

Definition at line 235 of file agm.c.

Referenced by decode_inter_plane().

◆ decode_intra_block()

static int decode_intra_block ( AGMContext s,
GetBitContext gb,
const int quant_matrix,
int skip,
int dc_level 
)
static

Definition at line 271 of file agm.c.

Referenced by decode_intra_plane().

◆ decode_intra_plane()

static int decode_intra_plane ( AGMContext s,
GetBitContext gb,
int  size,
const int quant_matrix,
AVFrame frame,
int  plane 
)
static

Definition at line 311 of file agm.c.

Referenced by decode_intra().

◆ decode_inter_block()

static int decode_inter_block ( AGMContext s,
GetBitContext gb,
const int quant_matrix,
int skip,
int map 
)
static

Definition at line 360 of file agm.c.

Referenced by decode_inter_plane().

◆ decode_inter_plane()

static int decode_inter_plane ( AGMContext s,
GetBitContext gb,
int  size,
const int quant_matrix,
AVFrame frame,
AVFrame prev,
int  plane 
)
static

Definition at line 390 of file agm.c.

Referenced by decode_inter().

◆ compute_quant_matrix()

static void compute_quant_matrix ( AGMContext s,
double  qscale 
)
static

Definition at line 532 of file agm.c.

Referenced by decode_inter(), and decode_intra().

◆ decode_raw_intra_rgb()

static int decode_raw_intra_rgb ( AVCodecContext avctx,
GetByteContext gbyte,
AVFrame frame 
)
static

Definition at line 571 of file agm.c.

Referenced by decode_frame().

◆ fill_pixels()

static int fill_pixels ( uint8_t **  y0,
uint8_t **  y1,
uint8_t **  u,
uint8_t **  v,
int  ylinesize,
int  ulinesize,
int  vlinesize,
uint8_t fill,
int nx,
int ny,
int np,
int  w,
int  h 
)
static

Definition at line 594 of file agm.c.

Referenced by decode_runlen().

◆ decode_runlen_rgb()

static int decode_runlen_rgb ( AVCodecContext avctx,
GetByteContext gbyte,
AVFrame frame 
)
static

Definition at line 659 of file agm.c.

Referenced by decode_frame().

◆ decode_runlen()

static int decode_runlen ( AVCodecContext avctx,
GetByteContext gbyte,
AVFrame frame 
)
static

Definition at line 712 of file agm.c.

Referenced by decode_frame().

◆ decode_raw_intra()

static int decode_raw_intra ( AVCodecContext avctx,
GetByteContext gbyte,
AVFrame frame 
)
static

Definition at line 762 of file agm.c.

Referenced by decode_frame().

◆ decode_intra()

static int decode_intra ( AVCodecContext avctx,
GetBitContext gb,
AVFrame frame 
)
static

Definition at line 795 of file agm.c.

Referenced by decode_frame().

◆ decode_motion_vectors()

static int decode_motion_vectors ( AVCodecContext avctx,
GetBitContext gb 
)
static

Definition at line 830 of file agm.c.

Referenced by decode_inter().

◆ decode_inter()

static int decode_inter ( AVCodecContext avctx,
GetBitContext gb,
AVFrame frame,
AVFrame prev 
)
static

Definition at line 871 of file agm.c.

Referenced by decode_frame().

◆ get_tree_codes()

static void get_tree_codes ( uint32_t *  codes,
Node nodes,
int  idx,
uint32_t  pfx,
int  bitpos 
)
static

Definition at line 918 of file agm.c.

Referenced by make_new_tree().

◆ make_new_tree()

static int make_new_tree ( const uint8_t bitlens,
uint32_t *  codes 
)
static

Definition at line 928 of file agm.c.

Referenced by build_huff().

◆ build_huff()

static int build_huff ( const uint8_t bitlen,
VLC vlc 
)
static

Definition at line 1013 of file agm.c.

Referenced by decode_huffman2().

◆ decode_huffman2()

static int decode_huffman2 ( AVCodecContext avctx,
int  header,
int  size 
)
static

Definition at line 1042 of file agm.c.

Referenced by decode_frame().

◆ decode_frame()

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

Definition at line 1094 of file agm.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 1232 of file agm.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 1261 of file agm.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 1268 of file agm.c.

Variable Documentation

◆ unscaled_luma

const uint8_t unscaled_luma[64]
static
Initial value:
= {
16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19,
26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56,
68,109,103, 77, 24, 35, 55, 64, 81,104,113, 92,
49, 64, 78, 87,103,121,120,101, 72, 92, 95, 98,
112,100,103,99
}

Definition at line 36 of file agm.c.

Referenced by compute_quant_matrix().

◆ unscaled_chroma

const uint8_t unscaled_chroma[64]
static
Initial value:
= {
17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66,
99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99
}

Definition at line 45 of file agm.c.

Referenced by compute_quant_matrix().

◆ ff_agm_decoder

AVCodec ff_agm_decoder
Initial value:
= {
.name = "agm",
.long_name = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"),
.priv_data_size = sizeof(AGMContext),
.close = decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}

Definition at line 1286 of file agm.c.

FF_CODEC_CAP_INIT_THREADSAFE
#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
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: agm.c:1232
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: agm.c:1094
decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: agm.c:1261
AGMContext
Definition: agm.c:58
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: agm.c:1268
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:500
FF_CODEC_CAP_EXPORTS_CROPPING
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
Definition: internal.h:66
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
AV_CODEC_ID_AGM
@ AV_CODEC_ID_AGM
Definition: avcodec.h:457
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201