mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
Fix to near lossless artefacts on palettized images.
Don't rely on palette not being there before the palette colors are counted. Change-Id: I988286675d3398f2da8f6d2fb6462db08af8028d
This commit is contained in:
parent
d4615d0889
commit
f480d1a7ef
@ -1223,7 +1223,7 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config,
|
||||
const int height = picture->height;
|
||||
VP8LEncoder* const enc = VP8LEncoderNew(config, picture);
|
||||
const size_t byte_position = VP8LBitWriterNumBytes(bw);
|
||||
const int use_near_lossless = !enc->use_palette_ && config->near_lossless;
|
||||
int use_near_lossless = 0;
|
||||
int hdr_size = 0;
|
||||
int data_size = 0;
|
||||
|
||||
@ -1241,6 +1241,7 @@ WebPEncodingError VP8LEncodeStream(const WebPConfig* const config,
|
||||
}
|
||||
|
||||
// If no prediction transform just apply near-lossless preprocessing.
|
||||
use_near_lossless = !enc->use_palette_ && config->near_lossless;
|
||||
if (!enc->use_predict_ && use_near_lossless &&
|
||||
!VP8ApplyNearLossless(width, height, picture->argb,
|
||||
config->near_lossless)) {
|
||||
|
Loading…
Reference in New Issue
Block a user