OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RASTER_TEXTURE_COMPRESSOR_ETC1_H_ | 5 #ifndef CC_RASTER_TEXTURE_COMPRESSOR_ETC1_H_ |
6 #define CC_RASTER_TEXTURE_COMPRESSOR_ETC1_H_ | 6 #define CC_RASTER_TEXTURE_COMPRESSOR_ETC1_H_ |
7 | 7 |
8 #include "cc/raster/texture_compressor.h" | 8 #include "cc/raster/texture_compressor.h" |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 23 matching lines...) Expand all Loading... |
34 uint8_t g; | 34 uint8_t g; |
35 uint8_t r; | 35 uint8_t r; |
36 uint8_t a; | 36 uint8_t a; |
37 } channels; | 37 } channels; |
38 uint8_t components[4]; | 38 uint8_t components[4]; |
39 uint32_t bits; | 39 uint32_t bits; |
40 }; | 40 }; |
41 | 41 |
42 // Codeword tables. | 42 // Codeword tables. |
43 // See: Table 3.17.2 | 43 // See: Table 3.17.2 |
44 ALIGNAS(16) static const int16_t g_codeword_tables[8][4] = { | 44 alignas(16) static const int16_t g_codeword_tables[8][4] = { |
45 {-8, -2, 2, 8}, | 45 {-8, -2, 2, 8}, {-17, -5, 5, 17}, {-29, -9, 9, 29}, |
46 {-17, -5, 5, 17}, | 46 {-42, -13, 13, 42}, {-60, -18, 18, 60}, {-80, -24, 24, 80}, |
47 {-29, -9, 9, 29}, | 47 {-106, -33, 33, 106}, {-183, -47, 47, 183}}; |
48 {-42, -13, 13, 42}, | |
49 {-60, -18, 18, 60}, | |
50 {-80, -24, 24, 80}, | |
51 {-106, -33, 33, 106}, | |
52 {-183, -47, 47, 183}}; | |
53 | 48 |
54 // Maps modifier indices to pixel index values. | 49 // Maps modifier indices to pixel index values. |
55 // See: Table 3.17.3 | 50 // See: Table 3.17.3 |
56 static const uint8_t g_mod_to_pix[4] = {3, 2, 0, 1}; | 51 static const uint8_t g_mod_to_pix[4] = {3, 2, 0, 1}; |
57 | 52 |
58 // The ETC1 specification index texels as follows: | 53 // The ETC1 specification index texels as follows: |
59 // [a][e][i][m] [ 0][ 4][ 8][12] | 54 // [a][e][i][m] [ 0][ 4][ 8][12] |
60 // [b][f][j][n] <-> [ 1][ 5][ 9][13] | 55 // [b][f][j][n] <-> [ 1][ 5][ 9][13] |
61 // [c][g][k][o] [ 2][ 6][10][14] | 56 // [c][g][k][o] [ 2][ 6][10][14] |
62 // [d][h][l][p] [ 3][ 7][11][15] | 57 // [d][h][l][p] [ 3][ 7][11][15] |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 int height, | 195 int height, |
201 Quality quality) override; | 196 Quality quality) override; |
202 | 197 |
203 private: | 198 private: |
204 DISALLOW_COPY_AND_ASSIGN(TextureCompressorETC1); | 199 DISALLOW_COPY_AND_ASSIGN(TextureCompressorETC1); |
205 }; | 200 }; |
206 | 201 |
207 } // namespace cc | 202 } // namespace cc |
208 | 203 |
209 #endif // CC_RASTER_TEXTURE_COMPRESSOR_ETC1_H_ | 204 #endif // CC_RASTER_TEXTURE_COMPRESSOR_ETC1_H_ |
OLD | NEW |