FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
zmbvenc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.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, 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, uint8_t *src, int stride, uint8_t *src2, int stride2, int bw, int bh, int *xored)
 Block comparing function XXX should be optimized and moved to DSPContext. More...
 
static int zmbv_me (ZmbvEncContext *c, uint8_t *src, int sstride, uint8_t *prev, int pstride, int x, int y, int *mx, int *my, int *xored)
 Motion estimation function TODO make better ME decisions. More...
 
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. More...
 

Variables

AVCodec 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 38 of file zmbvenc.c.

◆ ZMBV_DELTAPAL

#define ZMBV_DELTAPAL   2

Definition at line 39 of file zmbvenc.c.

◆ ZMBV_BLOCK

#define ZMBV_BLOCK   16

Definition at line 45 of file zmbvenc.c.

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 
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 48 of file zmbvenc.c.

Function Documentation

◆ block_cmp()

static int block_cmp ( ZmbvEncContext c,
uint8_t src,
int  stride,
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 85 of file zmbvenc.c.

Referenced by zmbv_me().

◆ zmbv_me()

static int zmbv_me ( ZmbvEncContext c,
uint8_t src,
int  sstride,
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 120 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 166 of file zmbvenc.c.

◆ encode_end()

static av_cold int encode_end ( AVCodecContext avctx)
static

Definition at line 306 of file zmbvenc.c.

◆ encode_init()

static av_cold int encode_init ( AVCodecContext avctx)
static

Init zmbv encoder.

Definition at line 322 of file zmbvenc.c.

Variable Documentation

◆ ff_zmbv_encoder

AVCodec ff_zmbv_encoder
Initial value:
= {
.name = "zmbv",
.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
.priv_data_size = sizeof(ZmbvEncContext),
.encode2 = encode_frame,
.close = encode_end,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8,
}

Definition at line 431 of file zmbvenc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
AV_CODEC_ID_ZMBV
@ AV_CODEC_ID_ZMBV
Definition: avcodec.h:299
encode_end
static av_cold int encode_end(AVCodecContext *avctx)
Definition: zmbvenc.c:306
encode_init
static av_cold int encode_init(AVCodecContext *avctx)
Init zmbv encoder.
Definition: zmbvenc.c:322
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
AV_PIX_FMT_RGB565LE
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
Definition: pixfmt.h:106
ZmbvEncContext
Encoder context.
Definition: zmbvenc.c:63
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:240
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:188
AV_PIX_FMT_RGB555LE
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
Definition: pixfmt.h:108
encode_frame
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: zmbvenc.c:166
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201