diff --git a/examples/dwebp.c b/examples/dwebp.c index a5ed60b0..7a3e4909 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -557,7 +557,7 @@ static void Help(void) { " -nofilter .... disable in-loop filtering\n" " -nodither .... disable dithering\n" " -dither .. dithering strength (in 0..100)\n" -#if WEBP_DECODER_ABI_VERSION > 0x0203 +#if WEBP_DECODER_ABI_VERSION > 0x0204 " -alpha_dither use alpha-plane dithering if needed\n" #endif " -mt .......... use multi-threading\n" @@ -628,7 +628,7 @@ int main(int argc, const char *argv[]) { format = YUV; } else if (!strcmp(argv[c], "-mt")) { config.options.use_threads = 1; -#if WEBP_DECODER_ABI_VERSION > 0x0203 +#if WEBP_DECODER_ABI_VERSION > 0x0204 } else if (!strcmp(argv[c], "-alpha_dither")) { config.options.alpha_dithering_strength = 100; #endif diff --git a/examples/vwebp.c b/examples/vwebp.c index 400fb1e5..ee462c83 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -377,7 +377,7 @@ static void Help(void) { " -nofancy ..... don't use the fancy YUV420 upscaler\n" " -nofilter .... disable in-loop filtering\n" " -dither dithering strength (0..100), default=50\n" -#if WEBP_DECODER_ABI_VERSION > 0x0203 +#if WEBP_DECODER_ABI_VERSION > 0x0204 " -noalphadither disable alpha plane dithering\n" #endif " -mt .......... use multi-threading\n" @@ -402,7 +402,7 @@ int main(int argc, char *argv[]) { return -1; } config->options.dithering_strength = 50; -#if WEBP_DECODER_ABI_VERSION > 0x0203 +#if WEBP_DECODER_ABI_VERSION > 0x0204 config->options.alpha_dithering_strength = 100; #endif kParams.use_color_profile = 1; @@ -417,7 +417,7 @@ int main(int argc, char *argv[]) { config->options.no_fancy_upsampling = 1; } else if (!strcmp(argv[c], "-nofilter")) { config->options.bypass_filtering = 1; -#if WEBP_DECODER_ABI_VERSION > 0x0203 +#if WEBP_DECODER_ABI_VERSION > 0x0204 } else if (!strcmp(argv[c], "-noalphadither")) { config->options.alpha_dithering_strength = 0; #endif diff --git a/src/dec/frame.c b/src/dec/frame.c index f7a0d1d8..2359acc5 100644 --- a/src/dec/frame.c +++ b/src/dec/frame.c @@ -177,7 +177,7 @@ void VP8InitDithering(const WebPDecoderOptions* const options, dec->dither_ = 1; } } -#if WEBP_DECODER_ABI_VERSION > 0x0203 +#if WEBP_DECODER_ABI_VERSION > 0x0204 // potentially allow alpha dithering dec->alpha_dithering_ = options->alpha_dithering_strength; if (dec->alpha_dithering_ > 100) { diff --git a/src/webp/decode.h b/src/webp/decode.h index 36c27c37..8d3f7be9 100644 --- a/src/webp/decode.h +++ b/src/webp/decode.h @@ -444,16 +444,20 @@ struct WebPDecoderOptions { int dithering_strength; // dithering strength (0=Off, 100=full) #if WEBP_DECODER_ABI_VERSION > 0x0203 int flip; // flip output vertically +#endif +#if WEBP_DECODER_ABI_VERSION > 0x0204 int alpha_dithering_strength; // alpha dithering strength in [0..100] #endif // Unused for now: int force_rotation; // forced rotation (to be applied _last_) int no_enhancement; // if true, discard enhancement layer -#if WEBP_DECODER_ABI_VERSION > 0x0203 - uint32_t pad[3]; // padding for later use -#else +#if WEBP_DECODER_ABI_VERSION < 0x0203 uint32_t pad[5]; // padding for later use +#elif WEBP_DECODER_ABI_VERSION < 0x0204 + uint32_t pad[4]; // padding for later use +#else + uint32_t pad[3]; // padding for later use #endif };