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:
Pascal Massimino 2012-05-22 02:28:19 -07:00
parent ec122e0986
commit d73e63a726
2 changed files with 15 additions and 1 deletions

View File

@ -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

View File

@ -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