67 return *bitmap || *(bitmap + 1) ||
144 int i, j, k, ret = 0;
152 "Size value %dx%d not supported, only accepts a size of %dx%d\n",
161 buf =
frame->data[0];
164 for (k = 0; k < 8; k++)
165 xface->
bitmap[
i++] = (buf[j]>>(7-k))&1;
167 buf +=
frame->linesize[0];
static double val(void *priv, double ch)
const FFCodec ff_xface_encoder
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Describe the class of an AVClass context structure.
main external API structure.
int width
picture width / height.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
ProbRange prob_ranges[XFACE_PIXELS *2]
uint8_t bitmap[XFACE_PIXELS]
image used internally for decoding
int set_header
set X-Face header in the output
int max_line_len
max line length for compressed data
void ff_xface_generate_face(uint8_t *dst, uint8_t *const src)
const ProbRange ff_xface_probranges_per_level[4][3]
void ff_big_div(BigInt *b, uint8_t a, uint8_t *r)
Divide b by a storing the result in b and the remainder in the word pointed to by r.
void ff_big_add(BigInt *b, uint8_t a)
Add a to b storing the result in b.
void ff_big_mul(BigInt *b, uint8_t a)
Multiply a by b storing the result in b.
const ProbRange ff_xface_probranges_2x2[16]
X-Face common definitions.
#define XFACE_FIRST_PRINT
static void push_integer(BigInt *b, const ProbRange *prange)
static void encode_block(char *bitmap, int w, int h, int level, ProbRangesQueue *pq)
static int all_same(char *bitmap, int w, int h)
static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
static int all_black(char *bitmap, int w, int h)
static int all_white(char *bitmap, int w, int h)
static void push_greys(ProbRangesQueue *pq, char *bitmap, int w, int h)
static int pq_push(ProbRangesQueue *pq, const ProbRange *p)