FFmpeg
Data Structures | Macros | Functions | Variables
agm.c File Reference
#include <string.h>
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "copy_block.h"
#include "decode.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "jpegquanttables.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, AVFrame *frame, 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

const FFCodec ff_agm_decoder
 

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 25 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 178 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 219 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 255 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 295 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 344 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 374 of file agm.c.

Referenced by decode_inter().

◆ compute_quant_matrix()

static void compute_quant_matrix ( AGMContext s,
double  qscale 
)
static

Definition at line 516 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 555 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 578 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 643 of file agm.c.

Referenced by decode_frame().

◆ decode_runlen()

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

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

Referenced by decode_frame().

◆ decode_intra()

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

Definition at line 779 of file agm.c.

Referenced by decode_frame().

◆ decode_motion_vectors()

static int decode_motion_vectors ( AVCodecContext avctx,
GetBitContext gb 
)
static

Definition at line 814 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 855 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 902 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 912 of file agm.c.

Referenced by build_huff().

◆ build_huff()

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

Definition at line 997 of file agm.c.

Referenced by decode_huffman2().

◆ decode_huffman2()

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

Definition at line 1026 of file agm.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 1078 of file agm.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 1217 of file agm.c.

◆ decode_flush()

static void decode_flush ( AVCodecContext avctx)
static

Definition at line 1247 of file agm.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 1254 of file agm.c.

Variable Documentation

◆ ff_agm_decoder

const FFCodec ff_agm_decoder
Initial value:
= {
.p.name = "agm",
CODEC_LONG_NAME("Amuse Graphics Movie"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AGM,
.p.capabilities = AV_CODEC_CAP_DR1,
.priv_data_size = sizeof(AGMContext),
.close = decode_close,
.flush = decode_flush,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
}

Definition at line 1272 of file agm.c.

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: codec_internal.h:42
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: agm.c:1217
decode_flush
static void decode_flush(AVCodecContext *avctx)
Definition: agm.c:1247
AGMContext
Definition: agm.c:42
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: agm.c:1254
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: agm.c:1078
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
FF_CODEC_CAP_EXPORTS_CROPPING
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
Definition: codec_internal.h:60
AV_CODEC_ID_AGM
@ AV_CODEC_ID_AGM
Definition: codec_id.h:294
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201