On Thu, Mar 13, 2014 at 11:49:37PM +0100, Vittorio Giovara wrote: > --- /dev/null > +++ b/libavcodec/xface.h > @@ -0,0 +1,106 @@ > + > +/** > + * Portable, very large unsigned integer arithmetic is needed. > + * Implementation uses arrays of WORDs. > + */ > +typedef struct { > + int nb_words; > + uint8_t words[XFACE_MAX_WORDS]; > +} BigInt;
Avoid anonymous structs please, especially in headers. > +void ff_big_add(BigInt *b, uint8_t a); > + > +void ff_big_div(BigInt *b, uint8_t a, uint8_t *r); > + > +void ff_big_mul(BigInt *b, uint8_t a); I'd rename these to ff_bigint_foo, just "big" is pretty nondescriptive. > +/** > + * Each face is encoded using 9 octrees of 16x16 each. Each level of the > + * trees has varying probabilities of being white, grey or black. > + * The table below is based on sampling many faces . > +typedef struct { > + int range; > + int offset; > +} ProbRange; Name the struct. > +void ff_xface_generate_face(uint8_t *dst, uint8_t * const src); *const missing multiple inclusion guards > --- /dev/null > +++ b/libavcodec/xfacedec.c > @@ -0,0 +1,195 @@ > +static int xface_decode_frame(AVCodecContext *avctx, > + void *data, int *got_frame, > + AVPacket *avpkt) nit: This fits in two lines. > --- /dev/null > +++ b/libavcodec/xfaceenc.c > @@ -0,0 +1,244 @@ > +typedef struct { > + const ProbRange *prob_ranges[XFACE_PIXELS * 2]; > + int prob_ranges_idx; > +} ProbRangesQueue; Please name the struct. > +static void encode_block(char *bitmap, int w, int h, int level, > ProbRangesQueue *pq) nit: long line Diego _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel