correct alpha_dithering_strength ABI check

the ABI wasn't bumped with this addition, but it's more correct to say
it was added with 0x0205 rather than 0x0204

Change-Id: I2ba12a33b612fac16bdfeb8272e76b0ea84f3938
This commit is contained in:
James Zern 2014-10-13 13:58:25 +02:00
parent 6c83157524
commit 57a7e73d27
4 changed files with 13 additions and 9 deletions

View File

@ -557,7 +557,7 @@ static void Help(void) {
" -nofilter .... disable in-loop filtering\n" " -nofilter .... disable in-loop filtering\n"
" -nodither .... disable dithering\n" " -nodither .... disable dithering\n"
" -dither <d> .. dithering strength (in 0..100)\n" " -dither <d> .. 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" " -alpha_dither use alpha-plane dithering if needed\n"
#endif #endif
" -mt .......... use multi-threading\n" " -mt .......... use multi-threading\n"
@ -628,7 +628,7 @@ int main(int argc, const char *argv[]) {
format = YUV; format = YUV;
} else if (!strcmp(argv[c], "-mt")) { } else if (!strcmp(argv[c], "-mt")) {
config.options.use_threads = 1; config.options.use_threads = 1;
#if WEBP_DECODER_ABI_VERSION > 0x0203 #if WEBP_DECODER_ABI_VERSION > 0x0204
} else if (!strcmp(argv[c], "-alpha_dither")) { } else if (!strcmp(argv[c], "-alpha_dither")) {
config.options.alpha_dithering_strength = 100; config.options.alpha_dithering_strength = 100;
#endif #endif

View File

@ -377,7 +377,7 @@ static void Help(void) {
" -nofancy ..... don't use the fancy YUV420 upscaler\n" " -nofancy ..... don't use the fancy YUV420 upscaler\n"
" -nofilter .... disable in-loop filtering\n" " -nofilter .... disable in-loop filtering\n"
" -dither <int> dithering strength (0..100), default=50\n" " -dither <int> 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" " -noalphadither disable alpha plane dithering\n"
#endif #endif
" -mt .......... use multi-threading\n" " -mt .......... use multi-threading\n"
@ -402,7 +402,7 @@ int main(int argc, char *argv[]) {
return -1; return -1;
} }
config->options.dithering_strength = 50; config->options.dithering_strength = 50;
#if WEBP_DECODER_ABI_VERSION > 0x0203 #if WEBP_DECODER_ABI_VERSION > 0x0204
config->options.alpha_dithering_strength = 100; config->options.alpha_dithering_strength = 100;
#endif #endif
kParams.use_color_profile = 1; kParams.use_color_profile = 1;
@ -417,7 +417,7 @@ int main(int argc, char *argv[]) {
config->options.no_fancy_upsampling = 1; config->options.no_fancy_upsampling = 1;
} else if (!strcmp(argv[c], "-nofilter")) { } else if (!strcmp(argv[c], "-nofilter")) {
config->options.bypass_filtering = 1; config->options.bypass_filtering = 1;
#if WEBP_DECODER_ABI_VERSION > 0x0203 #if WEBP_DECODER_ABI_VERSION > 0x0204
} else if (!strcmp(argv[c], "-noalphadither")) { } else if (!strcmp(argv[c], "-noalphadither")) {
config->options.alpha_dithering_strength = 0; config->options.alpha_dithering_strength = 0;
#endif #endif

View File

@ -177,7 +177,7 @@ void VP8InitDithering(const WebPDecoderOptions* const options,
dec->dither_ = 1; dec->dither_ = 1;
} }
} }
#if WEBP_DECODER_ABI_VERSION > 0x0203 #if WEBP_DECODER_ABI_VERSION > 0x0204
// potentially allow alpha dithering // potentially allow alpha dithering
dec->alpha_dithering_ = options->alpha_dithering_strength; dec->alpha_dithering_ = options->alpha_dithering_strength;
if (dec->alpha_dithering_ > 100) { if (dec->alpha_dithering_ > 100) {

View File

@ -444,16 +444,20 @@ struct WebPDecoderOptions {
int dithering_strength; // dithering strength (0=Off, 100=full) int dithering_strength; // dithering strength (0=Off, 100=full)
#if WEBP_DECODER_ABI_VERSION > 0x0203 #if WEBP_DECODER_ABI_VERSION > 0x0203
int flip; // flip output vertically int flip; // flip output vertically
#endif
#if WEBP_DECODER_ABI_VERSION > 0x0204
int alpha_dithering_strength; // alpha dithering strength in [0..100] int alpha_dithering_strength; // alpha dithering strength in [0..100]
#endif #endif
// Unused for now: // Unused for now:
int force_rotation; // forced rotation (to be applied _last_) int force_rotation; // forced rotation (to be applied _last_)
int no_enhancement; // if true, discard enhancement layer int no_enhancement; // if true, discard enhancement layer
#if WEBP_DECODER_ABI_VERSION > 0x0203 #if WEBP_DECODER_ABI_VERSION < 0x0203
uint32_t pad[3]; // padding for later use
#else
uint32_t pad[5]; // padding for later use 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 #endif
}; };