DequantizeLevels(): Add 'row' and 'num_rows' args

Change-Id: I0032e25c30f34362105d942f2dbb9ac75200f911
This commit is contained in:
Urvang Joshi 2013-06-11 15:59:21 -07:00
parent 47374b8273
commit 520f005f85
3 changed files with 12 additions and 9 deletions

View File

@ -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);
}
}

View File

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

View File

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