11e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora// Copyright 2013 Google Inc. All Rights Reserved.
21e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora//
30406ce1417f76f2034833414dcecc9f56253640cVikas Arora// Use of this source code is governed by a BSD-style license
40406ce1417f76f2034833414dcecc9f56253640cVikas Arora// that can be found in the COPYING file in the root of the source
50406ce1417f76f2034833414dcecc9f56253640cVikas Arora// tree. An additional intellectual property rights grant can be found
60406ce1417f76f2034833414dcecc9f56253640cVikas Arora// in the file PATENTS. All contributing project authors may
70406ce1417f76f2034833414dcecc9f56253640cVikas Arora// be found in the AUTHORS file in the root of the source tree.
81e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora// -----------------------------------------------------------------------------
91e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora//
101e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora// Alpha plane de-quantization utility
111e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora//
121e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora// Author:  Vikas Arora (vikasa@google.com)
131e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora
141e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora#ifndef WEBP_UTILS_QUANT_LEVELS_DEC_H_
151e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora#define WEBP_UTILS_QUANT_LEVELS_DEC_H_
161e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora
179e80ee991168a0a6c2a906dd2c17c5e17df4566eJames Zern#include "../webp/types.h"
181e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora
198b720228d581a84fd173b6dcb2fa295b59db489aVikas Arora#ifdef __cplusplus
201e7bf8805bd030c19924a5306837ecd72c295751Vikas Aroraextern "C" {
211e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora#endif
221e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora
238b720228d581a84fd173b6dcb2fa295b59db489aVikas Arora// Apply post-processing to input 'data' of size 'width'x'height' assuming that
240912efc2528d03c59d45dd9bdc9ff9ec800a3fc1James Zern// the source was quantized to a reduced number of levels. 'stride' is in bytes.
2533f74dabbc7920a65ed435d7417987589febdc16Vikas Arora// Strength is in [0..100] and controls the amount of dithering applied.
2633f74dabbc7920a65ed435d7417987589febdc16Vikas Arora// Returns false in case of error (data is NULL, invalid parameters,
2733f74dabbc7920a65ed435d7417987589febdc16Vikas Arora// malloc failure, ...).
280912efc2528d03c59d45dd9bdc9ff9ec800a3fc1James Zernint WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride,
2933f74dabbc7920a65ed435d7417987589febdc16Vikas Arora                         int strength);
301e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora
318b720228d581a84fd173b6dcb2fa295b59db489aVikas Arora#ifdef __cplusplus
321e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora}    // extern "C"
331e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora#endif
341e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora
351e7bf8805bd030c19924a5306837ecd72c295751Vikas Arora#endif  /* WEBP_UTILS_QUANT_LEVELS_DEC_H_ */
36