X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ffmpeg%2Flibavcodec%2Fxface.h;h=0236d713ad75ecb5e87fc6563d8e80323622e16e;hb=092a91210f1b986dc846dc52988518f8f913eb72;hp=cd59ba084a2e49ea18729bcff5ba8be59fc13bdd;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00;p=deb_ffmpeg.git diff --git a/ffmpeg/libavcodec/xface.h b/ffmpeg/libavcodec/xface.h index cd59ba0..0236d71 100644 --- a/ffmpeg/libavcodec/xface.h +++ b/ffmpeg/libavcodec/xface.h @@ -40,17 +40,18 @@ /* * Image is encoded as a big integer, using characters from '~' to - * '!', for a total of 92 symbols. In order to express 48x48=2304 - * bits, we need a total of 354 digits, as given by: - * ceil(lg_92(2^2304)) = 354 + * '!', for a total of 94 symbols. In order to express + * 48x48 pixels with the worst case encoding 666 symbols should + * be sufficient. */ -#define XFACE_MAX_DIGITS 354 +#define XFACE_MAX_DIGITS 666 #define XFACE_BITSPERWORD 8 #define XFACE_WORDCARRY (1 << XFACE_BITSPERWORD) #define XFACE_WORDMASK (XFACE_WORDCARRY - 1) -#define XFACE_MAX_WORDS ((XFACE_PIXELS * 2 + XFACE_BITSPERWORD - 1) / XFACE_BITSPERWORD) +// This must be larger or equal to log256(94^XFACE_MAX_DIGITS) +#define XFACE_MAX_WORDS 546 /* Portable, very large unsigned integer arithmetic is needed. * Implementation uses arrays of WORDs. */ @@ -84,8 +85,8 @@ enum XFaceColor { XFACE_COLOR_BLACK = 0, XFACE_COLOR_GREY, XFACE_COLOR_WHITE }; * The probability of the data determines the range of possible encodings. * Offset gives the first possible encoding of the range. */ typedef struct { - int range; - int offset; + uint8_t range; + uint8_t offset; } ProbRange; extern const ProbRange ff_xface_probranges_per_level[4][3];