FFmpeg
Loading...
Searching...
No Matches
agm.c File Reference
#include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/mem.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 av_cold 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 180 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 221 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 257 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 297 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 346 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 376 of file agm.c.

Referenced by decode_inter().

◆ compute_quant_matrix()

static void compute_quant_matrix ( AGMContext * s,
double qscale )
static

Definition at line 522 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 561 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 584 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 649 of file agm.c.

Referenced by decode_frame().

◆ decode_runlen()

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

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

Referenced by decode_frame().

◆ decode_intra()

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

Definition at line 785 of file agm.c.

Referenced by decode_frame().

◆ decode_motion_vectors()

static int decode_motion_vectors ( AVCodecContext * avctx,
GetBitContext * gb )
static

Definition at line 820 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 861 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 908 of file agm.c.

Referenced by get_tree_codes(), and make_new_tree().

◆ make_new_tree()

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

Definition at line 918 of file agm.c.

Referenced by build_huff().

◆ build_huff()

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

Definition at line 1003 of file agm.c.

Referenced by decode_huffman2().

◆ decode_huffman2()

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

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

◆ decode_init()

static av_cold int decode_init ( AVCodecContext * avctx)
static

Definition at line 1223 of file agm.c.

◆ decode_flush()

static av_cold void decode_flush ( AVCodecContext * avctx)
static

Definition at line 1253 of file agm.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext * avctx)
static

Definition at line 1260 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),
.flush = decode_flush,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
}
static av_cold void decode_flush(AVCodecContext *avctx)
Definition agm.c:1253
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_AGM
Definition codec_id.h:289
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int decode_init(AVCodecContext *avctx)
Definition 4xm.c:998
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837
static av_cold int decode_close(AVCodecContext *avctx)
Definition aacdec.c:1220

Definition at line 1278 of file agm.c.