| 155 | } |
| 156 | |
| 157 | int CMP_CDECL CompressBlockBC3(const unsigned char* srcBlock, unsigned int srcStrideInBytes, CMP_GLOBAL unsigned char cmpBlock[16], const void* options = NULL) |
| 158 | { |
| 159 | CMP_Vec4uc inBlock[16]; |
| 160 | |
| 161 | //---------------------------------- |
| 162 | // Fill the inBlock with source data |
| 163 | //---------------------------------- |
| 164 | CGU_INT srcpos = 0; |
| 165 | CGU_INT dstptr = 0; |
| 166 | for (CGU_UINT8 row = 0; row < 4; row++) |
| 167 | { |
| 168 | srcpos = row * srcStrideInBytes; |
| 169 | for (CGU_UINT8 col = 0; col < 4; col++) |
| 170 | { |
| 171 | inBlock[dstptr].x = CGU_UINT8(srcBlock[srcpos++]); |
| 172 | inBlock[dstptr].y = CGU_UINT8(srcBlock[srcpos++]); |
| 173 | inBlock[dstptr].z = CGU_UINT8(srcBlock[srcpos++]); |
| 174 | inBlock[dstptr].w = CGU_UINT8(srcBlock[srcpos++]); |
| 175 | dstptr++; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | CMP_BC15Options* BC15options = (CMP_BC15Options*)options; |
| 180 | CMP_BC15Options BC15optionsDefault; |
| 181 | if (BC15options == NULL) |
| 182 | { |
| 183 | BC15options = &BC15optionsDefault; |
| 184 | SetDefaultBC15Options(BC15options); |
| 185 | } |
| 186 | |
| 187 | CompressBlockBC3_Internal(inBlock, (CMP_GLOBAL CGU_UINT32*)cmpBlock, BC15options); |
| 188 | return CGU_CORE_OK; |
| 189 | } |
| 190 | |
| 191 | int CMP_CDECL DecompressBlockBC3(const unsigned char cmpBlock[16], CMP_GLOBAL unsigned char srcBlock[64], const void* options = NULL) |
| 192 | { |