| OLD | NEW |
| 1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // This code is licensed under the same terms as WebM: | 3 // Use of this source code is governed by a BSD-style license |
| 4 // Software License Agreement: http://www.webmproject.org/license/software/ | 4 // that can be found in the COPYING file in the root of the source |
| 5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. |
| 6 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 7 // | 9 // |
| 8 // Alpha plane quantization utility | 10 // Alpha plane quantization utility |
| 9 // | 11 // |
| 10 // Author: Vikas Arora (vikasa@google.com) | 12 // Author: Vikas Arora (vikasa@google.com) |
| 11 | 13 |
| 12 #ifndef WEBP_UTILS_QUANT_LEVELS_H_ | 14 #ifndef WEBP_UTILS_QUANT_LEVELS_H_ |
| 13 #define WEBP_UTILS_QUANT_LEVELS_H_ | 15 #define WEBP_UTILS_QUANT_LEVELS_H_ |
| 14 | 16 |
| 15 #include <stdlib.h> | 17 #include <stdlib.h> |
| 16 | 18 |
| 17 #include "../webp/types.h" | 19 #include "../webp/types.h" |
| 18 | 20 |
| 19 #if defined(__cplusplus) || defined(c_plusplus) | 21 #if defined(__cplusplus) || defined(c_plusplus) |
| 20 extern "C" { | 22 extern "C" { |
| 21 #endif | 23 #endif |
| 22 | 24 |
| 23 // Replace the input 'data' of size 'width'x'height' with 'num-levels' | 25 // Replace the input 'data' of size 'width'x'height' with 'num-levels' |
| 24 // quantized values. If not NULL, 'sse' will contain the sum of squared error. | 26 // quantized values. If not NULL, 'sse' will contain the sum of squared error. |
| 25 // Valid range for 'num_levels' is [2, 256]. | 27 // Valid range for 'num_levels' is [2, 256]. |
| 26 // Returns false in case of error (data is NULL, or parameters are invalid). | 28 // Returns false in case of error (data is NULL, or parameters are invalid). |
| 27 int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels, | 29 int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels, |
| 28 uint64_t* const sse); | 30 uint64_t* const sse); |
| 29 | 31 |
| 30 #if defined(__cplusplus) || defined(c_plusplus) | 32 #if defined(__cplusplus) || defined(c_plusplus) |
| 31 } // extern "C" | 33 } // extern "C" |
| 32 #endif | 34 #endif |
| 33 | 35 |
| 34 #endif /* WEBP_UTILS_QUANT_LEVELS_H_ */ | 36 #endif /* WEBP_UTILS_QUANT_LEVELS_H_ */ |
| OLD | NEW |