| 1 |
// Copyright 2023 Google Inc. All Rights Reserved. |
| 2 |
// |
| 3 |
// Use of this source code is governed by a BSD-style license |
| 4 |
// that can be found in the COPYING file in the root of the source |
| 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. |
| 8 |
// ----------------------------------------------------------------------------- |
| 9 |
// |
| 10 |
// Precomputed data for 420 risk estimation. |
| 11 |
|
| 12 |
#ifndef WEBP_EXTRAS_SHARPYUV_RISK_TABLE_H_ |
| 13 |
#define WEBP_EXTRAS_SHARPYUV_RISK_TABLE_H_ |
| 14 |
|
| 15 |
#include "src/webp/types.h" |
| 16 |
|
| 17 |
extern const int kSharpYuvPrecomputedRiskYuvSampling; |
| 18 |
// Table of precomputed risk scores when chroma subsampling images with two |
| 19 |
// given colors. |
| 20 |
// Since precomputing values for all possible YUV colors would create a huge |
| 21 |
// table, the YUV space (i.e. [0, 255]^3) is reduced to |
| 22 |
// [0, kSharpYuvPrecomputedRiskYuvSampling-1]^3 |
| 23 |
// where 255 maps to kSharpYuvPrecomputedRiskYuvSampling-1. |
| 24 |
// Table size: kSharpYuvPrecomputedRiskYuvSampling^6 bytes or 114 KiB |
| 25 |
extern const uint8_t kSharpYuvPrecomputedRisk[]; |
| 26 |
|
| 27 |
#endif // WEBP_EXTRAS_SHARPYUV_RISK_TABLE_H_ |