* @brief Fetch the packed percentile table for the given 2D block size. * * @param dim_x The block x size. * @param dim_y The block y size. * * @return The packed table. */
| 1107 | * @return The packed table. |
| 1108 | */ |
| 1109 | static const packed_percentile_table *get_packed_table( |
| 1110 | int dim_x, |
| 1111 | int dim_y |
| 1112 | ) { |
| 1113 | int idx = (dim_y << 8) | dim_x; |
| 1114 | switch (idx) |
| 1115 | { |
| 1116 | #if ASTCENC_BLOCK_MAX_TEXELS >= (4 * 4) |
| 1117 | case 0x0404: return &block_pcd_4x4; |
| 1118 | #endif |
| 1119 | #if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 4) |
| 1120 | case 0x0405: return &block_pcd_5x4; |
| 1121 | #endif |
| 1122 | #if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 5) |
| 1123 | case 0x0505: return &block_pcd_5x5; |
| 1124 | #endif |
| 1125 | #if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 5) |
| 1126 | case 0x0506: return &block_pcd_6x5; |
| 1127 | #endif |
| 1128 | #if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 6) |
| 1129 | case 0x0606: return &block_pcd_6x6; |
| 1130 | #endif |
| 1131 | #if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 5) |
| 1132 | case 0x0508: return &block_pcd_8x5; |
| 1133 | #endif |
| 1134 | #if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 6) |
| 1135 | case 0x0608: return &block_pcd_8x6; |
| 1136 | #endif |
| 1137 | #if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 8) |
| 1138 | case 0x0808: return &block_pcd_8x8; |
| 1139 | #endif |
| 1140 | #if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 5) |
| 1141 | case 0x050A: return &block_pcd_10x5; |
| 1142 | #endif |
| 1143 | #if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 6) |
| 1144 | case 0x060A: return &block_pcd_10x6; |
| 1145 | #endif |
| 1146 | #if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 8) |
| 1147 | case 0x080A: return &block_pcd_10x8; |
| 1148 | #endif |
| 1149 | #if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 10) |
| 1150 | case 0x0A0A: return &block_pcd_10x10; |
| 1151 | #endif |
| 1152 | #if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 10) |
| 1153 | case 0x0A0C: return &block_pcd_12x10; |
| 1154 | #endif |
| 1155 | #if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 12) |
| 1156 | case 0x0C0C: return &block_pcd_12x12; |
| 1157 | #endif |
| 1158 | } |
| 1159 | |
| 1160 | // Should never hit this with a valid 2D block size |
| 1161 | return nullptr; |
| 1162 | } |
| 1163 | |
| 1164 | /* See header for documentation. */ |
| 1165 | const float *get_2d_percentile_table( |
no outgoing calls
no test coverage detected