mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
DequantizeLevels(): Add 'row' and 'num_rows' args
Change-Id: I0032e25c30f34362105d942f2dbb9ac75200f911
This commit is contained in:
parent
47374b8273
commit
520f005f85
@ -78,7 +78,7 @@ static int DecodeAlpha(const uint8_t* data, size_t data_size,
|
||||
unfilter_func(width, height, width, 0, height, output);
|
||||
}
|
||||
if (pre_processing == ALPHA_PREPROCESSED_LEVELS) {
|
||||
ok = DequantizeLevels(output, width, height);
|
||||
ok = DequantizeLevels(output, width, height, 0, height);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int DequantizeLevels(uint8_t* const data, int width, int height) {
|
||||
if (data == NULL || width <= 0 || height <= 0) return 0;
|
||||
(void)data;
|
||||
(void)width;
|
||||
(void)height;
|
||||
int DequantizeLevels(uint8_t* const data, int width, int height,
|
||||
int row, int num_rows) {
|
||||
if (data == NULL || width <= 0 || height <= 0 || row < 0 || num_rows < 0 ||
|
||||
row + num_rows > height) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -20,10 +20,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Apply post-processing to input 'data' of size 'width'x'height' assuming
|
||||
// that the source was quantized to a reduced number of levels.
|
||||
// Apply post-processing to input 'data' of size 'width'x'height' assuming that
|
||||
// the source was quantized to a reduced number of levels. The post-processing
|
||||
// will be applied to 'num_rows' rows of 'data' starting from 'row'.
|
||||
// Returns false in case of error (data is NULL, invalid parameters, ...).
|
||||
int DequantizeLevels(uint8_t* const data, int width, int height);
|
||||
int DequantizeLevels(uint8_t* const data, int width, int height,
|
||||
int row, int num_rows);
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} // extern "C"
|
||||
|
Loading…
Reference in New Issue
Block a user