godot/thirdparty/astcenc/astcenc_quantization.cpp

// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2011-2023 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at:
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
// ----------------------------------------------------------------------------

/**
 * @brief Functions and data tables for numeric quantization..
 */

#include "astcenc_internal.h"

#if !defined(ASTCENC_DECOMPRESS_ONLY)

// Not scrambled, starts from QUANT_6
const uint8_t color_unquant_to_uquant_tables[17][512] {};

// Starts from QUANT_6
// Scrambled
const uint8_t color_uquant_to_scrambled_pquant_tables[17][256] {};

#endif

// Starts from QUANT_6
// Scrambled
static const uint8_t color_scrambled_pquant_to_uquant_q6[6] {};

static const uint8_t color_scrambled_pquant_to_uquant_q8[8] {};

static const uint8_t color_scrambled_pquant_to_uquant_q10[10] {};

static const uint8_t color_scrambled_pquant_to_uquant_q12[12] {};

static const uint8_t color_scrambled_pquant_to_uquant_q16[16] {};

static const uint8_t color_scrambled_pquant_to_uquant_q20[20] {};

static const uint8_t color_scrambled_pquant_to_uquant_q24[24] {};

static const uint8_t color_scrambled_pquant_to_uquant_q32[32] {};

static const uint8_t color_scrambled_pquant_to_uquant_q40[40] {};

static const uint8_t color_scrambled_pquant_to_uquant_q48[48] {};

static const uint8_t color_scrambled_pquant_to_uquant_q64[64] {};

static const uint8_t color_scrambled_pquant_to_uquant_q80[80] {};

static const uint8_t color_scrambled_pquant_to_uquant_q96[96] {};

static const uint8_t color_scrambled_pquant_to_uquant_q128[128] {};

static const uint8_t color_scrambled_pquant_to_uquant_q160[160] {};

static const uint8_t color_scrambled_pquant_to_uquant_q192[192] {};

static const uint8_t color_scrambled_pquant_to_uquant_q256[256] {};

const uint8_t* color_scrambled_pquant_to_uquant_tables[17] {};

// The quant_mode_table[integer_count/2][bits] gives us the quantization level for a given integer
// count and number of bits that the integer may fit into.
const int8_t quant_mode_table[10][128] {};