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

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

#include "xface.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.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

const FFCodec 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 40 of file xfaceenc.c.

Referenced by all_white().

◆ all_black()

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

Definition at line 57 of file xfaceenc.c.

Referenced by all_black(), and encode_block().

◆ all_white()

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

Definition at line 72 of file xfaceenc.c.

Referenced by encode_block().

◆ pq_push()

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

Definition at line 82 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 90 of file xfaceenc.c.

Referenced by encode_block(), and push_greys().

◆ encode_block()

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

Definition at line 109 of file xfaceenc.c.

Referenced by encode_block(), and xface_encode_frame().

◆ push_integer()

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

Definition at line 128 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 137 of file xfaceenc.c.

Variable Documentation

◆ ff_xface_encoder

const FFCodec ff_xface_encoder
Initial value:
= {
.p.name = "xface",
CODEC_LONG_NAME("X-face image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(XFaceContext),
}
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#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_XFACE
Definition codec_id.h:257
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
@ 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:82
static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition xfaceenc.c:137

Definition at line 214 of file xfaceenc.c.