FFmpeg
Data Structures | Macros | Functions | Variables
agm.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/mem_internal.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 av_always_inline 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]
 
const 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 196 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 237 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 273 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 313 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 362 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 392 of file agm.c.

Referenced by decode_inter().

◆ compute_quant_matrix()

static void compute_quant_matrix ( AGMContext s,
double  qscale 
)
static

Definition at line 534 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 573 of file agm.c.

Referenced by decode_frame().

◆ fill_pixels()

static av_always_inline 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 596 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 661 of file agm.c.

Referenced by decode_frame().

◆ decode_runlen()

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

Definition at line 714 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 764 of file agm.c.

Referenced by decode_frame().

◆ decode_intra()

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

Definition at line 797 of file agm.c.

Referenced by decode_frame().

◆ decode_motion_vectors()

static int decode_motion_vectors ( AVCodecContext avctx,
GetBitContext gb 
)
static

Definition at line 832 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 873 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 920 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 930 of file agm.c.

Referenced by build_huff().

◆ build_huff()

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

Definition at line 1015 of file agm.c.

Referenced by decode_huffman2().

◆ decode_huffman2()

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

Definition at line 1044 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 1096 of file agm.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 1234 of file agm.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 1263 of file agm.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 1270 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 38 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 47 of file agm.c.

Referenced by compute_quant_matrix().

◆ ff_agm_decoder

const 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 1288 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:42
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: agm.c:1234
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: agm.c:1096
decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: agm.c:1263
init
static int init
Definition: av_tx.c:47
AGMContext
Definition: agm.c:60
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: agm.c:1270
flush
static void flush(AVCodecContext *avctx)
Definition: aacdec_template.c:593
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:68
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
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:117
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:50
AV_CODEC_ID_AGM
@ AV_CODEC_ID_AGM
Definition: codec_id.h:293
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201