1cc1dc7a3Sopenharmony_ci// SPDX-License-Identifier: Apache-2.0 2cc1dc7a3Sopenharmony_ci// ---------------------------------------------------------------------------- 3cc1dc7a3Sopenharmony_ci// Copyright 2011-2021 Arm Limited 4cc1dc7a3Sopenharmony_ci// 5cc1dc7a3Sopenharmony_ci// Licensed under the Apache License, Version 2.0 (the "License"); you may not 6cc1dc7a3Sopenharmony_ci// use this file except in compliance with the License. You may obtain a copy 7cc1dc7a3Sopenharmony_ci// of the License at: 8cc1dc7a3Sopenharmony_ci// 9cc1dc7a3Sopenharmony_ci// http://www.apache.org/licenses/LICENSE-2.0 10cc1dc7a3Sopenharmony_ci// 11cc1dc7a3Sopenharmony_ci// Unless required by applicable law or agreed to in writing, software 12cc1dc7a3Sopenharmony_ci// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13cc1dc7a3Sopenharmony_ci// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14cc1dc7a3Sopenharmony_ci// License for the specific language governing permissions and limitations 15cc1dc7a3Sopenharmony_ci// under the License. 16cc1dc7a3Sopenharmony_ci// ---------------------------------------------------------------------------- 17cc1dc7a3Sopenharmony_ci 18cc1dc7a3Sopenharmony_ci/** 19cc1dc7a3Sopenharmony_ci * @brief Data tables for quantization transfer. 20cc1dc7a3Sopenharmony_ci */ 21cc1dc7a3Sopenharmony_ci 22cc1dc7a3Sopenharmony_ci#include "astcenc_internal.h" 23cc1dc7a3Sopenharmony_ci 24cc1dc7a3Sopenharmony_ci#define _ 0 // Using _ to indicate an entry that will not be used. 25cc1dc7a3Sopenharmony_ci 26cc1dc7a3Sopenharmony_ciconst quant_and_transfer_table quant_and_xfer_tables[12] { 27cc1dc7a3Sopenharmony_ci // QUANT2, range 0..1 28cc1dc7a3Sopenharmony_ci { 29cc1dc7a3Sopenharmony_ci {0, 64}, 30cc1dc7a3Sopenharmony_ci {0, 1}, 31cc1dc7a3Sopenharmony_ci {0, 64}, 32cc1dc7a3Sopenharmony_ci {0x4000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_, 33cc1dc7a3Sopenharmony_ci _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_, 34cc1dc7a3Sopenharmony_ci 0x4000} 35cc1dc7a3Sopenharmony_ci }, 36cc1dc7a3Sopenharmony_ci // QUANT_3, range 0..2 37cc1dc7a3Sopenharmony_ci { 38cc1dc7a3Sopenharmony_ci {0, 32, 64}, 39cc1dc7a3Sopenharmony_ci {0, 1, 2}, 40cc1dc7a3Sopenharmony_ci {0, 32, 64}, 41cc1dc7a3Sopenharmony_ci {0x2000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_, 42cc1dc7a3Sopenharmony_ci _,_,0x4000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_, 43cc1dc7a3Sopenharmony_ci _,_,_,_,0x4020} 44cc1dc7a3Sopenharmony_ci }, 45cc1dc7a3Sopenharmony_ci // QUANT_4, range 0..3 46cc1dc7a3Sopenharmony_ci { 47cc1dc7a3Sopenharmony_ci {0, 21, 43, 64}, 48cc1dc7a3Sopenharmony_ci {0, 1, 2, 3}, 49cc1dc7a3Sopenharmony_ci {0, 21, 43, 64}, 50cc1dc7a3Sopenharmony_ci {0x1500,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x2b00,_,_,_,_, 51cc1dc7a3Sopenharmony_ci _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x4015,_,_,_,_,_,_,_,_,_,_,_,_, 52cc1dc7a3Sopenharmony_ci _,_,_,_,_,_,_,_,0x402b} 53cc1dc7a3Sopenharmony_ci }, 54cc1dc7a3Sopenharmony_ci //QUANT_5, range 0..4 55cc1dc7a3Sopenharmony_ci { 56cc1dc7a3Sopenharmony_ci {0, 16, 32, 48, 64}, 57cc1dc7a3Sopenharmony_ci {0, 1, 2, 3, 4}, 58cc1dc7a3Sopenharmony_ci {0, 16, 32, 48, 64}, 59cc1dc7a3Sopenharmony_ci {0x1000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x2000,_,_,_,_,_,_,_,_,_, 60cc1dc7a3Sopenharmony_ci _,_,_,_,_,_,0x3010,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x4020,_,_,_, 61cc1dc7a3Sopenharmony_ci _,_,_,_,_,_,_,_,_,_,_,_,0x4030} 62cc1dc7a3Sopenharmony_ci }, 63cc1dc7a3Sopenharmony_ci // QUANT_6, range 0..5 64cc1dc7a3Sopenharmony_ci { 65cc1dc7a3Sopenharmony_ci {0, 12, 25, 39, 52, 64}, 66cc1dc7a3Sopenharmony_ci {0, 2, 4, 5, 3, 1}, 67cc1dc7a3Sopenharmony_ci {0, 64, 12, 52, 25, 39}, 68cc1dc7a3Sopenharmony_ci {0x0c00,_,_,_,_,_,_,_,_,_,_,_,0x1900,_,_,_,_,_,_,_,_,_,_,_,_, 69cc1dc7a3Sopenharmony_ci 0x270c,_,_,_,_,_,_,_,_,_,_,_,_,_,0x3419,_,_,_,_,_,_,_,_,_,_, 70cc1dc7a3Sopenharmony_ci _,_,0x4027,_,_,_,_,_,_,_,_,_,_,_,0x4034} 71cc1dc7a3Sopenharmony_ci }, 72cc1dc7a3Sopenharmony_ci // QUANT_8, range 0..7 73cc1dc7a3Sopenharmony_ci { 74cc1dc7a3Sopenharmony_ci {0, 9, 18, 27, 37, 46, 55, 64}, 75cc1dc7a3Sopenharmony_ci {0, 1, 2, 3, 4, 5, 6, 7}, 76cc1dc7a3Sopenharmony_ci {0, 9, 18, 27, 37, 46, 55, 64}, 77cc1dc7a3Sopenharmony_ci {0x0900,_,_,_,_,_,_,_,_,0x1200,_,_,_,_,_,_,_,_,0x1b09,_,_, 78cc1dc7a3Sopenharmony_ci _,_,_,_,_,_,0x2512,_,_,_,_,_,_,_,_,_,0x2e1b,_,_,_,_,_,_,_,_, 79cc1dc7a3Sopenharmony_ci 0x3725,_,_,_,_,_,_,_,_,0x402e,_,_,_,_,_,_,_,_,0x4037} 80cc1dc7a3Sopenharmony_ci }, 81cc1dc7a3Sopenharmony_ci // QUANT_10, range 0..9 82cc1dc7a3Sopenharmony_ci { 83cc1dc7a3Sopenharmony_ci {0, 7, 14, 21, 28, 36, 43, 50, 57, 64}, 84cc1dc7a3Sopenharmony_ci {0, 2, 4, 6, 8, 9, 7, 5, 3, 1}, 85cc1dc7a3Sopenharmony_ci {0, 64, 7, 57, 14, 50, 21, 43, 28, 36}, 86cc1dc7a3Sopenharmony_ci {0x0700,_,_,_,_,_,_,0x0e00,_,_,_,_,_,_,0x1507,_,_,_,_,_,_, 87cc1dc7a3Sopenharmony_ci 0x1c0e,_,_,_,_,_,_,0x2415,_,_,_,_,_,_,_,0x2b1c,_,_,_,_,_, 88cc1dc7a3Sopenharmony_ci _,0x3224,_,_,_,_,_,_,0x392b,_,_,_,_,_,_,0x4032,_,_,_,_,_, 89cc1dc7a3Sopenharmony_ci _,0x4039} 90cc1dc7a3Sopenharmony_ci }, 91cc1dc7a3Sopenharmony_ci // QUANT_12, range 0..11 92cc1dc7a3Sopenharmony_ci { 93cc1dc7a3Sopenharmony_ci {0, 5, 11, 17, 23, 28, 36, 41, 47, 53, 59, 64}, 94cc1dc7a3Sopenharmony_ci {0, 4, 8, 2, 6, 10, 11, 7, 3, 9, 5, 1}, 95cc1dc7a3Sopenharmony_ci {0, 64, 17, 47, 5, 59, 23, 41, 11, 53, 28, 36}, 96cc1dc7a3Sopenharmony_ci {0x0500,_,_,_,_,0x0b00,_,_,_,_,_,0x1105,_,_,_,_,_, 97cc1dc7a3Sopenharmony_ci 0x170b,_,_,_,_,_,0x1c11,_,_,_,_,0x2417,_,_,_,_,_,_,_, 98cc1dc7a3Sopenharmony_ci 0x291c,_,_,_,_,0x2f24,_,_,_,_,_,0x3529,_,_,_,_,_, 99cc1dc7a3Sopenharmony_ci 0x3b2f,_,_,_,_,_,0x4035,_,_,_,_,0x403b} 100cc1dc7a3Sopenharmony_ci }, 101cc1dc7a3Sopenharmony_ci // QUANT_16, range 0..15 102cc1dc7a3Sopenharmony_ci { 103cc1dc7a3Sopenharmony_ci {0, 4, 8, 12, 17, 21, 25, 29, 35, 39, 43, 47, 52, 56, 60, 64}, 104cc1dc7a3Sopenharmony_ci {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, 105cc1dc7a3Sopenharmony_ci {0, 4, 8, 12, 17, 21, 25, 29, 35, 39, 43, 47, 52, 56, 60, 64}, 106cc1dc7a3Sopenharmony_ci {0x0400,_,_,_,0x0800,_,_,_,0x0c04,_,_,_,0x1108,_,_,_,_, 107cc1dc7a3Sopenharmony_ci 0x150c,_,_,_,0x1911,_,_,_,0x1d15,_,_,_,0x2319,_,_,_,_, 108cc1dc7a3Sopenharmony_ci _,0x271d,_,_,_,0x2b23,_,_,_,0x2f27,_,_,_,0x342b,_,_,_, 109cc1dc7a3Sopenharmony_ci _,0x382f,_,_,_,0x3c34,_,_,_,0x4038,_,_,_,0x403c} 110cc1dc7a3Sopenharmony_ci }, 111cc1dc7a3Sopenharmony_ci // QUANT_20, range 0..19 112cc1dc7a3Sopenharmony_ci { 113cc1dc7a3Sopenharmony_ci {0, 3, 6, 9, 13, 16, 19, 23, 26, 29, 35, 38, 41, 45, 48, 51, 55, 58, 61, 64}, 114cc1dc7a3Sopenharmony_ci {0, 4, 8, 12, 16, 2, 6, 10, 14, 18, 19, 15, 11, 7, 3, 17, 13, 9, 5, 1}, 115cc1dc7a3Sopenharmony_ci {0, 64, 16, 48, 3, 61, 19, 45, 6, 58, 23, 41, 9, 55, 26, 38, 13, 51, 29, 35}, 116cc1dc7a3Sopenharmony_ci {0x0300,_,_,0x0600,_,_,0x0903,_,_,0x0d06,_,_,_, 117cc1dc7a3Sopenharmony_ci 0x1009,_,_,0x130d,_,_,0x1710,_,_,_,0x1a13,_,_, 118cc1dc7a3Sopenharmony_ci 0x1d17,_,_,0x231a,_,_,_,_,_,0x261d,_,_,0x2923,_,_, 119cc1dc7a3Sopenharmony_ci 0x2d26,_,_,_,0x3029,_,_,0x332d,_,_,0x3730,_,_,_, 120cc1dc7a3Sopenharmony_ci 0x3a33,_,_,0x3d37,_,_,0x403a,_,_,0x403d} 121cc1dc7a3Sopenharmony_ci }, 122cc1dc7a3Sopenharmony_ci // QUANT_24, range 0..23 123cc1dc7a3Sopenharmony_ci { 124cc1dc7a3Sopenharmony_ci {0, 2, 5, 8, 11, 13, 16, 19, 22, 24, 27, 30, 34, 37, 40, 42, 45, 48, 51, 53, 56, 59, 62, 64}, 125cc1dc7a3Sopenharmony_ci {0, 8, 16, 2, 10, 18, 4, 12, 20, 6, 14, 22, 23, 15, 7, 21, 13, 5, 19, 11, 3, 17, 9, 1}, 126cc1dc7a3Sopenharmony_ci {0, 64, 8, 56, 16, 48, 24, 40, 2, 62, 11, 53, 19, 45, 27, 37, 5, 59, 13, 51, 22, 42, 30, 34}, 127cc1dc7a3Sopenharmony_ci {0x0200,_,0x0500,_,_,0x0802,_,_,0x0b05,_,_,0x0d08, 128cc1dc7a3Sopenharmony_ci _,0x100b,_,_,0x130d,_,_,0x1610,_,_,0x1813,_, 129cc1dc7a3Sopenharmony_ci 0x1b16,_,_,0x1e18,_,_,0x221b,_,_,_,0x251e,_,_, 130cc1dc7a3Sopenharmony_ci 0x2822,_,_,0x2a25,_,0x2d28,_,_,0x302a,_,_,0x332d, 131cc1dc7a3Sopenharmony_ci _,_,0x3530,_,0x3833,_,_,0x3b35,_,_,0x3e38,_,_, 132cc1dc7a3Sopenharmony_ci 0x403b,_,0x403e} 133cc1dc7a3Sopenharmony_ci }, 134cc1dc7a3Sopenharmony_ci // QUANT_32, range 0..31 135cc1dc7a3Sopenharmony_ci { 136cc1dc7a3Sopenharmony_ci {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64}, 137cc1dc7a3Sopenharmony_ci {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, 138cc1dc7a3Sopenharmony_ci {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64}, 139cc1dc7a3Sopenharmony_ci {0x0200,_,0x0400,_,0x0602,_,0x0804,_,0x0a06,_, 140cc1dc7a3Sopenharmony_ci 0x0c08,_,0x0e0a,_,0x100c,_,0x120e,_,0x1410,_, 141cc1dc7a3Sopenharmony_ci 0x1612,_,0x1814,_,0x1a16,_,0x1c18,_,0x1e1a,_, 142cc1dc7a3Sopenharmony_ci 0x221c,_,_,_,0x241e,_,0x2622,_,0x2824,_,0x2a26,_, 143cc1dc7a3Sopenharmony_ci 0x2c28,_,0x2e2a,_,0x302c,_,0x322e,_,0x3430,_, 144cc1dc7a3Sopenharmony_ci 0x3632,_,0x3834,_,0x3a36,_,0x3c38,_,0x3e3a,_, 145cc1dc7a3Sopenharmony_ci 0x403c,_,0x403e} 146cc1dc7a3Sopenharmony_ci } 147cc1dc7a3Sopenharmony_ci}; 148