godot/thirdparty/astcenc/astcenc_percentile_tables.cpp

// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2011-2022 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 Percentile data tables for different block encodings.
 *
 * To reduce binary size the tables are stored using a packed differential encoding.
 */

#include "astcenc_internal.h"

#if !defined(ASTCENC_DECOMPRESS_ONLY)
/**
 * @brief Structure containing packed percentile metadata.
 *
 * Note that percentile tables do not exist for 3D textures, so no zdim is stored.
 */
struct packed_percentile_table
{};

#if ASTCENC_BLOCK_MAX_TEXELS >= (4 * 4)
static const uint16_t percentile_arr_4x4_0[61] {};

static const uint16_t percentile_arr_4x4_1[84] {};

static const packed_percentile_table block_pcd_4x4 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 4)
static const uint16_t percentile_arr_5x4_0[91] {};

static const uint16_t percentile_arr_5x4_1[104] {};

static const packed_percentile_table block_pcd_5x4 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 5)
static const uint16_t percentile_arr_5x5_0[129] {};

static const uint16_t percentile_arr_5x5_1[126] {};

static const packed_percentile_table block_pcd_5x5 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 5)
static const uint16_t percentile_arr_6x5_0[165] {};

static const uint16_t percentile_arr_6x5_1[145] {};

static const packed_percentile_table block_pcd_6x5 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 6)
static const uint16_t percentile_arr_6x6_0[206] {};

static const uint16_t percentile_arr_6x6_1[164] {};

static const packed_percentile_table block_pcd_6x6 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 5)
static const uint16_t percentile_arr_8x5_0[226] {};

static const uint16_t percentile_arr_8x5_1[167] {};

static const packed_percentile_table block_pcd_8x5 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 6)
static const uint16_t percentile_arr_8x6_0[273] {};

static const uint16_t percentile_arr_8x6_1[186] {};

static const packed_percentile_table block_pcd_8x6 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 8)
static const uint16_t percentile_arr_8x8_0[347] {};

static const uint16_t percentile_arr_8x8_1[208] {};

static const packed_percentile_table block_pcd_8x8 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 5)
static const uint16_t percentile_arr_10x5_0[274] {};

static const uint16_t percentile_arr_10x5_1[180] {};

static const packed_percentile_table block_pcd_10x5 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 6)
static const uint16_t percentile_arr_10x6_0[325] {};

static const uint16_t percentile_arr_10x6_1[199] {};

static const packed_percentile_table block_pcd_10x6 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 8)
static const uint16_t percentile_arr_10x8_0[400] {};

static const uint16_t percentile_arr_10x8_1[221] {};

static const packed_percentile_table block_pcd_10x8 =;
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 10)
static const uint16_t percentile_arr_10x10_0[453] {};

static const uint16_t percentile_arr_10x10_1[234] {};

static const packed_percentile_table block_pcd_10x10 {};
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 10)
static const uint16_t percentile_arr_12x10_0[491] {};

static const uint16_t percentile_arr_12x10_1[240] {};

static const packed_percentile_table block_pcd_12x10 =;
#endif

#if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 12)
static const uint16_t percentile_arr_12x12_0[529] {};

static const uint16_t percentile_arr_12x12_1[246] {};

static const packed_percentile_table block_pcd_12x12 {};
#endif

/**
 * @brief Fetch the packed percentile table for the given 2D block size.
 *
 * @param xdim The block x size.
 * @param ydim The block y size.
 *
 * @return The packed table.
 */
static const packed_percentile_table *get_packed_table(
	int xdim,
	int ydim
) {}

/* See header for documentation. */
const float *get_2d_percentile_table(
	unsigned int xdim,
	unsigned int ydim
) {}
#endif

/* See header for documentation. */
bool is_legal_2d_block_size(
	unsigned int xdim,
	unsigned int ydim
) {}

/* See header for documentation. */
bool is_legal_3d_block_size(
	unsigned int xdim,
	unsigned int ydim,
	unsigned int zdim
) {}