mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-15 21:39:59 +02:00
cwebp: add a -sharp_yuv option for 'sharp' RGB->YUV conversion
Change-Id: I6edd5b44d693da50f702fa8218f14872874d91ba
This commit is contained in:
@ -54,6 +54,7 @@ int WebPConfigInitInternal(WebPConfig* config,
|
||||
config->low_memory = 0;
|
||||
config->near_lossless = 100;
|
||||
config->use_delta_palette = 0;
|
||||
config->use_sharp_yuv = 0;
|
||||
|
||||
// TODO(skal): tune.
|
||||
switch (preset) {
|
||||
@ -122,6 +123,8 @@ int WebPValidateConfig(const WebPConfig* config) {
|
||||
if (config->use_delta_palette < 0 || config->use_delta_palette > 1) {
|
||||
return 0;
|
||||
}
|
||||
if (config->use_sharp_yuv < 0 || config->use_sharp_yuv > 1) return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) {
|
||||
|
||||
if (pic->use_argb || pic->y == NULL || pic->u == NULL || pic->v == NULL) {
|
||||
// Make sure we have YUVA samples.
|
||||
if (config->preprocessing & 4) {
|
||||
if (config->use_sharp_yuv || (config->preprocessing & 4)) {
|
||||
if (!WebPPictureSharpARGBToYUVA(pic)) {
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user