xfaceenc.c File Reference

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

#include "xface.h"
#include "avcodec.h"
#include "internal.h"
Include dependency graph for xfaceenc.c:

Go to the source code of this file.

Data Structures

struct  XFaceContext
 
struct  ProbRangesQueue
 

Typedefs

typedef struct XFaceContext XFaceContext
 

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 av_cold int xface_encode_init (AVCodecContext *avctx)
 
static void push_integer (BigInt *b, const ProbRange *prange)
 
static int xface_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int xface_encode_close (AVCodecContext *avctx)
 

Variables

AVCodec ff_xface_encoder
 

Detailed Description

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

Definition in file xfaceenc.c.

Typedef Documentation

typedef struct XFaceContext XFaceContext

Function Documentation

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

Definition at line 55 of file xfaceenc.c.

Referenced by encode_block().

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

Definition at line 38 of file xfaceenc.c.

Referenced by all_white().

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

Definition at line 70 of file xfaceenc.c.

Referenced by encode_block().

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

Definition at line 107 of file xfaceenc.c.

Referenced by xface_encode_frame().

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

Definition at line 80 of file xfaceenc.c.

Referenced by encode_block(), and push_greys().

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

Definition at line 88 of file xfaceenc.c.

Referenced by encode_block().

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

Definition at line 136 of file xfaceenc.c.

Referenced by xface_encode_frame().

static av_cold int xface_encode_close ( AVCodecContext avctx)
static

Definition at line 221 of file xfaceenc.c.

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

Definition at line 145 of file xfaceenc.c.

static av_cold int xface_encode_init ( AVCodecContext avctx)
static

Definition at line 126 of file xfaceenc.c.

Variable Documentation

AVCodec ff_xface_encoder
Initial value:
= {
.name = "xface",
.priv_data_size = sizeof(XFaceContext),
.encode2 = xface_encode_frame,
.pix_fmts = (const enum PixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("X-face image"),
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold int xface_encode_close(AVCodecContext *avctx)
Definition: xfaceenc.c:221
static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: xfaceenc.c:145
struct XFaceContext XFaceContext
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int xface_encode_init(AVCodecContext *avctx)
Definition: xfaceenc.c:126
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
Definition: pixfmt.h:77

Definition at line 228 of file xfaceenc.c.