FFmpeg
Data Structures | Macros | Functions | Variables
motionpixels.c File Reference
#include "libavutil/mem.h"
#include "libavutil/thread.h"
#include "config.h"
#include "avcodec.h"
#include "get_bits.h"
#include "bswapdsp.h"
#include "codec_internal.h"
#include "decode.h"
#include "motionpixels_tablegen.h"

Go to the source code of this file.

Data Structures

struct  HuffCode
 
struct  MotionPixelsContext
 

Macros

#define MAX_HUFF_CODES   16
 

Functions

static av_cold int mp_decode_end (AVCodecContext *avctx)
 
static av_cold int mp_decode_init (AVCodecContext *avctx)
 
static void mp_read_changes_map (MotionPixelsContext *mp, GetBitContext *gb, int count, int bits_len, int read_color)
 
static int mp_get_code (MotionPixelsContext *mp, GetBitContext *gb, int size)
 
static int mp_read_codes_table (MotionPixelsContext *mp, GetBitContext *gb)
 
static av_always_inline int mp_gradient (MotionPixelsContext *mp, int component, int v)
 
static YuvPixel mp_get_yuv_from_rgb (MotionPixelsContext *mp, int x, int y)
 
static void mp_set_rgb_from_yuv (MotionPixelsContext *mp, int x, int y, const YuvPixel *p)
 
static av_always_inline int mp_get_vlc (MotionPixelsContext *mp, GetBitContext *gb)
 
static void mp_decode_line (MotionPixelsContext *mp, GetBitContext *gb, int y)
 
static void mp_decode_frame_helper (MotionPixelsContext *mp, GetBitContext *gb)
 
static int mp_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_motionpixels_decoder
 

Macro Definition Documentation

◆ MAX_HUFF_CODES

#define MAX_HUFF_CODES   16

Definition at line 33 of file motionpixels.c.

Function Documentation

◆ mp_decode_end()

static av_cold int mp_decode_end ( AVCodecContext avctx)
static

Definition at line 58 of file motionpixels.c.

◆ mp_decode_init()

static av_cold int mp_decode_init ( AVCodecContext avctx)
static

Definition at line 71 of file motionpixels.c.

◆ mp_read_changes_map()

static void mp_read_changes_map ( MotionPixelsContext mp,
GetBitContext gb,
int  count,
int  bits_len,
int  read_color 
)
static

Definition at line 104 of file motionpixels.c.

Referenced by mp_decode_frame().

◆ mp_get_code()

static int mp_get_code ( MotionPixelsContext mp,
GetBitContext gb,
int  size 
)
static

Definition at line 133 of file motionpixels.c.

Referenced by mp_read_codes_table().

◆ mp_read_codes_table()

static int mp_read_codes_table ( MotionPixelsContext mp,
GetBitContext gb 
)
static

Definition at line 153 of file motionpixels.c.

Referenced by mp_decode_frame().

◆ mp_gradient()

static av_always_inline int mp_gradient ( MotionPixelsContext mp,
int  component,
int  v 
)
static

Definition at line 175 of file motionpixels.c.

Referenced by mp_decode_frame_helper(), and mp_decode_line().

◆ mp_get_yuv_from_rgb()

static YuvPixel mp_get_yuv_from_rgb ( MotionPixelsContext mp,
int  x,
int  y 
)
static

Definition at line 184 of file motionpixels.c.

Referenced by mp_decode_frame_helper(), and mp_decode_line().

◆ mp_set_rgb_from_yuv()

static void mp_set_rgb_from_yuv ( MotionPixelsContext mp,
int  x,
int  y,
const YuvPixel p 
)
static

Definition at line 192 of file motionpixels.c.

Referenced by mp_decode_frame_helper(), and mp_decode_line().

◆ mp_get_vlc()

static av_always_inline int mp_get_vlc ( MotionPixelsContext mp,
GetBitContext gb 
)
static

Definition at line 200 of file motionpixels.c.

Referenced by mp_decode_frame_helper(), and mp_decode_line().

◆ mp_decode_line()

static void mp_decode_line ( MotionPixelsContext mp,
GetBitContext gb,
int  y 
)
static

Definition at line 206 of file motionpixels.c.

Referenced by mp_decode_frame_helper().

◆ mp_decode_frame_helper()

static void mp_decode_frame_helper ( MotionPixelsContext mp,
GetBitContext gb 
)
static

Definition at line 253 of file motionpixels.c.

Referenced by mp_decode_frame().

◆ mp_decode_frame()

static int mp_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 282 of file motionpixels.c.

Variable Documentation

◆ ff_motionpixels_decoder

const FFCodec ff_motionpixels_decoder
Initial value:
= {
.p.name = "motionpixels",
CODEC_LONG_NAME("Motion Pixels video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(MotionPixelsContext),
.close = mp_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 349 of file motionpixels.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:43
mp_decode_init
static av_cold int mp_decode_init(AVCodecContext *avctx)
Definition: motionpixels.c:71
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
AV_CODEC_ID_MOTIONPIXELS
@ AV_CODEC_ID_MOTIONPIXELS
Definition: codec_id.h:171
mp_decode_frame
static int mp_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: motionpixels.c:282
MotionPixelsContext
Definition: motionpixels.c:42
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
mp_decode_end
static av_cold int mp_decode_end(AVCodecContext *avctx)
Definition: motionpixels.c:58