+static void ComputeBlockWMSE(u8 const *original, u8 const *compressed, unsigned int w, unsigned int h, double &cmse, double &amse)
Kodi 15.0 contains an updated version of libsquish:
https://github.com/xbmc/xbmc/tree/master/tools/depends/native/libsquish-native
The OpenElec project provides a separate tarball including the Kodi-
http://sources.openelec.tv/devel/libsquish-1.10-openelec.tar.gz
This patch contains the relevant diff between upstream libsquish 1.13
and the OpenElec tarball.
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
diff -uwNr 1.13/squish.cpp libsquish-1.10-openelec/squish.cpp
--- 1.13/squish.cpp 2015-04-30 12:48:49.000000000 +0200
+++ libsquish-1.10-openelec/squish.cpp 2015-01-09 10:58:43.000000000 +0100
-------------------------------------------------------------------------- */
int method = flags & ( kDxt1 | kDxt3 | kDxt5 );
int fit = flags & ( kColourIterativeClusterFit | kColourClusterFit | kColourRangeFit );
- int extra = flags & kWeightColourByAlpha;
+ int extra = flags & ( kWeightColourByAlpha | kSourceBGRA );
if( method != kDxt3 && method != kDxt5 )
return blockcount*blocksize;
+void CopyRGBA( u8 const* source, u8* dest, int flags )
+ if (flags & kSourceBGRA)
+ // convert from bgra to rgba
+ for( int i = 0; i < 4; ++i )
void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric )
+ CompressImage(rgba, width, height, width*4, blocks, flags, metric);
+void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric )