FFmpeg
Loading...
Searching...
No Matches
zmbvenc.c File Reference

Zip Motion Blocks Video encoder. More...

#include <stddef.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "zlib_wrapper.h"
#include <zlib.h>

Go to the source code of this file.

Data Structures

struct  ZmbvEncContext
 Encoder context. More...
 

Macros

#define ZMBV_KEYFRAME   1
 
#define ZMBV_DELTAPAL   2
 
#define ZMBV_BLOCK   16
 

Enumerations

enum  ZmbvFormat {
  ZMBV_FMT_NONE = 0 , ZMBV_FMT_1BPP = 1 , ZMBV_FMT_2BPP = 2 , ZMBV_FMT_4BPP = 3 ,
  ZMBV_FMT_8BPP = 4 , ZMBV_FMT_15BPP = 5 , ZMBV_FMT_16BPP = 6 , ZMBV_FMT_24BPP = 7 ,
  ZMBV_FMT_32BPP = 8
}
 

Functions

static int block_cmp (ZmbvEncContext *c, const uint8_t *src, int stride, const uint8_t *src2, int stride2, int bw, int bh, int *xored)
 Block comparing function XXX should be optimized and moved to DSPContext.
 
static int zmbv_me (ZmbvEncContext *c, const uint8_t *src, int sstride, const uint8_t *prev, int pstride, int x, int y, int *mx, int *my, int *xored)
 Motion estimation function TODO make better ME decisions.
 
static int encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 
static av_cold int encode_end (AVCodecContext *avctx)
 
static av_cold int encode_init (AVCodecContext *avctx)
 Init zmbv encoder.
 

Variables

static enum AVPixelFormat zmbv_pixfmts_list []
 
const FFCodec ff_zmbv_encoder
 

Detailed Description

Zip Motion Blocks Video encoder.

Definition in file zmbvenc.c.

Macro Definition Documentation

◆ ZMBV_KEYFRAME

#define ZMBV_KEYFRAME   1

Definition at line 39 of file zmbvenc.c.

◆ ZMBV_DELTAPAL

#define ZMBV_DELTAPAL   2

Definition at line 40 of file zmbvenc.c.

◆ ZMBV_BLOCK

#define ZMBV_BLOCK   16

Definition at line 46 of file zmbvenc.c.

Referenced by encode_frame(), encode_init(), and zmbv_me().

Enumeration Type Documentation

◆ ZmbvFormat

enum ZmbvFormat
Enumerator
ZMBV_FMT_NONE 
ZMBV_FMT_1BPP 
ZMBV_FMT_2BPP 
ZMBV_FMT_4BPP 
ZMBV_FMT_8BPP 
ZMBV_FMT_15BPP 
ZMBV_FMT_16BPP 
ZMBV_FMT_24BPP 
ZMBV_FMT_32BPP 

Definition at line 49 of file zmbvenc.c.

Function Documentation

◆ block_cmp()

static int block_cmp ( ZmbvEncContext * c,
const uint8_t * src,
int stride,
const uint8_t * src2,
int stride2,
int bw,
int bh,
int * xored )
inlinestatic

Block comparing function XXX should be optimized and moved to DSPContext.

Definition at line 86 of file zmbvenc.c.

Referenced by zmbv_me().

◆ zmbv_me()

static int zmbv_me ( ZmbvEncContext * c,
const uint8_t * src,
int sstride,
const uint8_t * prev,
int pstride,
int x,
int y,
int * mx,
int * my,
int * xored )
static

Motion estimation function TODO make better ME decisions.

Definition at line 121 of file zmbvenc.c.

Referenced by encode_frame().

◆ encode_frame()

static int encode_frame ( AVCodecContext * avctx,
AVPacket * pkt,
const AVFrame * pict,
int * got_packet )
static

Definition at line 167 of file zmbvenc.c.

◆ encode_end()

static av_cold int encode_end ( AVCodecContext * avctx)
static

Definition at line 303 of file zmbvenc.c.

◆ encode_init()

static av_cold int encode_init ( AVCodecContext * avctx)
static

Init zmbv encoder.

Definition at line 319 of file zmbvenc.c.

Variable Documentation

◆ zmbv_pixfmts_list

enum AVPixelFormat zmbv_pixfmts_list[]
static
Initial value:
= {
}
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition pixfmt.h:265
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition pixfmt.h:113
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
Definition pixfmt.h:115
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition pixfmt.h:84

Definition at line 413 of file zmbvenc.c.

◆ ff_zmbv_encoder

const FFCodec ff_zmbv_encoder
Initial value:
= {
.p.name = "zmbv",
CODEC_LONG_NAME("Zip Motion Blocks Video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(ZmbvEncContext),
.close = encode_end,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold int encode_init(AVCodecContext *avctx)
Definition asvenc.c:373
#define CODEC_PIXFMTS_ARRAY(array)
#define FF_CODEC_ENCODE_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
static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame, AVPacket *pkt)
Definition ffmpeg_enc.c:694
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition codec.h:147
#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_ZMBV
Definition codec_id.h:131
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int encode_end(AVCodecContext *avctx)
Definition huffyuvenc.c:978
Encoder context.
Definition zmbvenc.c:64
static enum AVPixelFormat zmbv_pixfmts_list[]
Definition zmbvenc.c:413

Definition at line 424 of file zmbvenc.c.