Path: blob/master/thirdparty/libwebp/src/utils/quant_levels_utils.h
9912 views
// Copyright 2011 Google Inc. All Rights Reserved.1//2// Use of this source code is governed by a BSD-style license3// that can be found in the COPYING file in the root of the source4// tree. An additional intellectual property rights grant can be found5// in the file PATENTS. All contributing project authors may6// be found in the AUTHORS file in the root of the source tree.7// -----------------------------------------------------------------------------8//9// Alpha plane quantization utility10//11// Author: Vikas Arora ([email protected])1213#ifndef WEBP_UTILS_QUANT_LEVELS_UTILS_H_14#define WEBP_UTILS_QUANT_LEVELS_UTILS_H_1516#include <stdlib.h>1718#include "src/webp/types.h"1920#ifdef __cplusplus21extern "C" {22#endif2324// Replace the input 'data' of size 'width'x'height' with 'num-levels'25// quantized values. If not NULL, 'sse' will contain the sum of squared error.26// Valid range for 'num_levels' is [2, 256].27// Returns false in case of error (data is NULL, or parameters are invalid).28int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,29uint64_t* const sse);3031#ifdef __cplusplus32} // extern "C"33#endif3435#endif // WEBP_UTILS_QUANT_LEVELS_UTILS_H_363738