mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
Define MAX_TRANSFORM_BITS according to the specification.
Change-Id: I0d575aa84e143bea56b55deb8f42b44e13dd5f1e
This commit is contained in:
parent
64d1ec23ac
commit
1e462ca80e
@ -1084,7 +1084,7 @@ static int ApplyPredictFilter(VP8LEncoder* const enc, int width, int height,
|
|||||||
}
|
}
|
||||||
VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
|
VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
|
||||||
VP8LPutBits(bw, PREDICTOR_TRANSFORM, 2);
|
VP8LPutBits(bw, PREDICTOR_TRANSFORM, 2);
|
||||||
assert(pred_bits >= MIN_TRANSFORM_BITS);
|
assert(pred_bits >= MIN_TRANSFORM_BITS && pred_bits <= MAX_TRANSFORM_BITS);
|
||||||
VP8LPutBits(bw, pred_bits - MIN_TRANSFORM_BITS, NUM_TRANSFORM_BITS);
|
VP8LPutBits(bw, pred_bits - MIN_TRANSFORM_BITS, NUM_TRANSFORM_BITS);
|
||||||
return EncodeImageNoHuffman(
|
return EncodeImageNoHuffman(
|
||||||
bw, enc->transform_data_, (VP8LHashChain*)&enc->hash_chain_,
|
bw, enc->transform_data_, (VP8LHashChain*)&enc->hash_chain_,
|
||||||
@ -1108,7 +1108,8 @@ static int ApplyCrossColorFilter(const VP8LEncoder* const enc, int width,
|
|||||||
}
|
}
|
||||||
VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
|
VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
|
||||||
VP8LPutBits(bw, CROSS_COLOR_TRANSFORM, 2);
|
VP8LPutBits(bw, CROSS_COLOR_TRANSFORM, 2);
|
||||||
assert(ccolor_transform_bits >= MIN_TRANSFORM_BITS);
|
assert(ccolor_transform_bits >= MIN_TRANSFORM_BITS &&
|
||||||
|
ccolor_transform_bits <= MAX_TRANSFORM_BITS);
|
||||||
VP8LPutBits(bw, ccolor_transform_bits - MIN_TRANSFORM_BITS,
|
VP8LPutBits(bw, ccolor_transform_bits - MIN_TRANSFORM_BITS,
|
||||||
NUM_TRANSFORM_BITS);
|
NUM_TRANSFORM_BITS);
|
||||||
return EncodeImageNoHuffman(
|
return EncodeImageNoHuffman(
|
||||||
|
@ -34,7 +34,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// maximum value of transform_bits_ in VP8LEncoder.
|
// maximum value of transform_bits_ in VP8LEncoder.
|
||||||
#define MAX_TRANSFORM_BITS 6
|
#define MAX_TRANSFORM_BITS (MIN_TRANSFORM_BITS + (1 << NUM_TRANSFORM_BITS) - 1)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
kEncoderNone = 0,
|
kEncoderNone = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user