FFmpeg
Data Structures | Functions | Variables
xfaceenc.c File Reference
#include "xface.h"
#include "avcodec.h"
#include "internal.h"
#include "libavutil/avassert.h"

Go to the source code of this file.

Data Structures

struct  XFaceContext
 
struct  ProbRangesQueue
 

Functions

static int all_same (char *bitmap, int w, int h)
 
static int all_black (char *bitmap, int w, int h)
 
static int all_white (char *bitmap, int w, int h)
 
static int pq_push (ProbRangesQueue *pq, const ProbRange *p)
 
static void push_greys (ProbRangesQueue *pq, char *bitmap, int w, int h)
 
static void encode_block (char *bitmap, int w, int h, int level, ProbRangesQueue *pq)
 
static void push_integer (BigInt *b, const ProbRange *prange)
 
static int xface_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 

Variables

AVCodec ff_xface_encoder
 

Detailed Description

X-Face encoder, based on libcompface, by James Ashton.

Definition in file xfaceenc.c.

Function Documentation

◆ all_same()

static int all_same ( char *  bitmap,
int  w,
int  h 
)
static

Definition at line 39 of file xfaceenc.c.

Referenced by all_white().

◆ all_black()

static int all_black ( char *  bitmap,
int  w,
int  h 
)
static

Definition at line 56 of file xfaceenc.c.

Referenced by encode_block().

◆ all_white()

static int all_white ( char *  bitmap,
int  w,
int  h 
)
static

Definition at line 71 of file xfaceenc.c.

Referenced by encode_block().

◆ pq_push()

static int pq_push ( ProbRangesQueue pq,
const ProbRange p 
)
inlinestatic

Definition at line 81 of file xfaceenc.c.

Referenced by encode_block(), and push_greys().

◆ push_greys()

static void push_greys ( ProbRangesQueue pq,
char *  bitmap,
int  w,
int  h 
)
static

Definition at line 89 of file xfaceenc.c.

Referenced by encode_block().

◆ encode_block()

static void encode_block ( char *  bitmap,
int  w,
int  h,
int  level,
ProbRangesQueue pq 
)
static

Definition at line 108 of file xfaceenc.c.

Referenced by xface_encode_frame().

◆ push_integer()

static void push_integer ( BigInt b,
const ProbRange prange 
)
static

Definition at line 127 of file xfaceenc.c.

Referenced by xface_encode_frame().

◆ xface_encode_frame()

static int xface_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int got_packet 
)
static

Definition at line 136 of file xfaceenc.c.

Variable Documentation

◆ ff_xface_encoder

AVCodec ff_xface_encoder
Initial value:
= {
.name = "xface",
.long_name = NULL_IF_CONFIG_SMALL("X-face image"),
.priv_data_size = sizeof(XFaceContext),
.encode2 = xface_encode_frame,
.capabilities = AV_CODEC_CAP_INTRA_ONLY,
}

Definition at line 214 of file xfaceenc.c.

AV_CODEC_CAP_INTRA_ONLY
#define AV_CODEC_CAP_INTRA_ONLY
Codec is intra only.
Definition: avcodec.h:1067
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
AV_PIX_FMT_MONOWHITE
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Definition: pixfmt.h:75
xface_encode_frame
static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: xfaceenc.c:136
AV_CODEC_ID_XFACE
@ AV_CODEC_ID_XFACE
Definition: avcodec.h:425
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
XFaceContext
Definition: xfacedec.c:89
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_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201