mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
add DequantizeLevels() placeholder
will be called by alpha post-processing, although doing nothing for now. Gradient smoothing would be nice-to-have here. Patch welcome! Change-Id: I534cde866bdc75da22d0f0a6d1373c90e21366f3
This commit is contained in:
parent
ec122e0986
commit
d73e63a726
@ -142,13 +142,22 @@ int QuantizeLevels(uint8_t* data, int width, int height,
|
||||
}
|
||||
|
||||
// Compute final mean squared error if needed.
|
||||
if (mse) {
|
||||
if (mse != NULL) {
|
||||
*mse = (float)sqrt(err);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int DequantizeLevels(uint8_t* data, int width, int height) {
|
||||
if (data == NULL || width <= 0 || height <= 0) return 0;
|
||||
// TODO(skal): implement gradient smoothing.
|
||||
(void)data;
|
||||
(void)width;
|
||||
(void)height;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
@ -27,6 +27,11 @@ extern "C" {
|
||||
int QuantizeLevels(uint8_t* data, int width, int height, int num_levels,
|
||||
float* mse);
|
||||
|
||||
// Apply post-processing to input 'data' of size 'width'x'height' assuming
|
||||
// source what quantized to a reduced number of levels.
|
||||
// Returns false in case of error (data is NULL, invalid parameters, ...).
|
||||
int DequantizeLevels(uint8_t* data, int width, int height);
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user