Home | History | Annotate | Download | only in GLcommon

Lines Matching refs:etc1_uint32

168         etc1_uint32 low, bool second, bool flipped) {
201 etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
202 etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7];
234 etc1_uint32 high;
235 etc1_uint32 low;
236 etc1_uint32 score; // Lower is more accurate
247 void etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask,
298 static etc1_uint32 chooseModifier(const etc1_byte* pBaseColors,
299 const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex,
301 etc1_uint32 bestScore = ~0;
312 etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG));
317 score += (etc1_uint32) (3 * square(decodedR - pixelR));
322 score += (etc1_uint32) square(decodedB - pixelB);
328 etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1))
335 void etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask,
433 void etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask,
472 static void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) {
484 void etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask,
503 etc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height) {
512 int etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,
513 etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) {
523 etc1_uint32 encodedWidth = (width + 3) & ~3;
524 etc1_uint32 encodedHeight = (height + 3) & ~3;
526 for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
527 etc1_uint32 yEnd = height - y;
532 for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
533 etc1_uint32 xEnd = width - x;
538 for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
544 for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
569 etc1_uint32 width, etc1_uint32 height,
570 etc1_uint32 pixelSize, etc1_uint32 stride) {
576 etc1_uint32 encodedWidth = (width + 3) & ~3;
577 etc1_uint32 encodedHeight = (height + 3) & ~3;
579 for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {
580 etc1_uint32 yEnd = height - y;
584 for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {
585 etc1_uint32 xEnd = width - x;
591 for (etc1_uint32 cy = 0; cy < yEnd; cy++) {
597 for (etc1_uint32 cx = 0; cx < xEnd; cx++) {
601 etc1_uint32 pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
614 static const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6;
615 static const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8;
616 static const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10;
617 static const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12;
618 static const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14;
620 static const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0;
622 static void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) {
627 static etc1_uint32 readBEUint16(const etc1_byte* pIn) {
633 void etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) {
635 etc1_uint32 encodedWidth = (width + 3) & ~3;
636 etc1_uint32 encodedHeight = (height + 3) & ~3;
650 etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET);
651 etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET);
652 etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET);
653 etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);
654 etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);
662 etc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) {
668 etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){