| 165 | } |
| 166 | |
| 167 | int CMP_CDECL CompressBlockBC2(const unsigned char* srcBlock, |
| 168 | unsigned int srcStrideInBytes, |
| 169 | CMP_GLOBAL unsigned char cmpBlock[16], |
| 170 | CMP_GLOBAL const void* options = NULL) |
| 171 | { |
| 172 | CMP_Vec4uc inBlock[16]; |
| 173 | |
| 174 | //---------------------------------- |
| 175 | // Fill the inBlock with source data |
| 176 | //---------------------------------- |
| 177 | CGU_INT srcpos = 0; |
| 178 | CGU_INT dstptr = 0; |
| 179 | for (CGU_UINT8 row = 0; row < 4; row++) |
| 180 | { |
| 181 | srcpos = row * srcStrideInBytes; |
| 182 | for (CGU_UINT8 col = 0; col < 4; col++) |
| 183 | { |
| 184 | inBlock[dstptr].x = CGU_UINT8(srcBlock[srcpos++]); |
| 185 | inBlock[dstptr].y = CGU_UINT8(srcBlock[srcpos++]); |
| 186 | inBlock[dstptr].z = CGU_UINT8(srcBlock[srcpos++]); |
| 187 | inBlock[dstptr].w = CGU_UINT8(srcBlock[srcpos++]); |
| 188 | dstptr++; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | CMP_BC15Options* BC15options = (CMP_BC15Options*)options; |
| 193 | CMP_BC15Options BC15optionsDefault; |
| 194 | if (BC15options == NULL) |
| 195 | { |
| 196 | BC15options = &BC15optionsDefault; |
| 197 | SetDefaultBC15Options(BC15options); |
| 198 | } |
| 199 | CompressBlockBC2_Internal(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options); |
| 200 | return CGU_CORE_OK; |
| 201 | } |
| 202 | |
| 203 | int CMP_CDECL DecompressBlockBC2(const unsigned char cmpBlock[16], CMP_GLOBAL unsigned char srcBlock[64], const void* options = NULL) |
| 204 | { |