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

#define BITSTREAM_READER_LE

Definition at line 27 of file agm.c.

Function Documentation

static int read_code ( GetBitContext gb,
int oskip,
int level,
int map,
int  mode 
)
static
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().

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

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

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

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

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

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

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

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 591 of file agm.c.

Referenced by decode_runlen().

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

Definition at line 656 of file agm.c.

Referenced by decode_frame().

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

Definition at line 709 of file agm.c.

Referenced by decode_frame().

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

Definition at line 759 of file agm.c.

Referenced by decode_frame().

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

Definition at line 792 of file agm.c.

Referenced by decode_frame().

static int decode_motion_vectors ( AVCodecContext avctx,
GetBitContext gb 
)
static

Definition at line 827 of file agm.c.

Referenced by decode_inter().

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

Definition at line 868 of file agm.c.

Referenced by decode_frame().

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

Definition at line 915 of file agm.c.

Referenced by make_new_tree().

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

Definition at line 925 of file agm.c.

Referenced by build_huff().

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

Definition at line 1010 of file agm.c.

Referenced by decode_huffman2().

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

Definition at line 1039 of file agm.c.

Referenced by decode_frame().

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

Definition at line 1091 of file agm.c.

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 1226 of file agm.c.

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 1250 of file agm.c.

Referenced by decode_frame_common(), and png_dec_end().

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 1257 of file agm.c.

Referenced by decode_init_static().

Variable Documentation

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

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

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 |
}
#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
Definition: agm.c:58
static void flush(AVCodecContext *avctx)
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 decode_init(AVCodecContext *avctx)
Definition: agm.c:1226
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int decode_close(AVCodecContext *avctx)
Definition: agm.c:1257
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
Definition: internal.h:66
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: agm.c:1091
static void decode_flush(AVCodecContext *avctx)
Definition: agm.c:1250
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981

Definition at line 1275 of file agm.c.