• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libsquish/0001-kodi.patch
Bernd KuhlsBernd Kuhls committed df88cdfe44622 Jul 2015
Raw file
Source viewDiff to previous
+static void ComputeBlockWMSE(u8 const *original, u8 const *compressed, unsigned int w, unsigned int h, double &cmse, double &amse)
 
1
Add Kodi-specific patch
2
​
3
Kodi 15.0 contains an updated version of libsquish:
4
https://github.com/xbmc/xbmc/tree/master/tools/depends/native/libsquish-native
5
​
6
The OpenElec project provides a separate tarball including the Kodi-
7
specific patches:
8
http://sources.openelec.tv/devel/libsquish-1.10-openelec.tar.gz
9
​
10
This patch contains the relevant diff between upstream libsquish 1.13
11
and the OpenElec tarball.
12
​
13
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
14
​
15
diff -uwNr 1.13/squish.cpp libsquish-1.10-openelec/squish.cpp
16
--- 1.13/squish.cpp 2015-04-30 12:48:49.000000000 +0200
17
+++ libsquish-1.10-openelec/squish.cpp  2015-01-09 10:58:43.000000000 +0100
18
@@ -23,6 +23,7 @@
19
 
20
    -------------------------------------------------------------------------- */
21
 
22
+#include <string.h>
23
 #include <squish.h>
24
 #include "colourset.h"
25
 #include "maths.h"
26
@@ -39,7 +40,7 @@
27
     // grab the flag bits
28
     int method = flags & ( kDxt1 | kDxt3 | kDxt5 );
29
     int fit = flags & ( kColourIterativeClusterFit | kColourClusterFit | kColourRangeFit );
30
-    int extra = flags & kWeightColourByAlpha;
31
+   int extra = flags & ( kWeightColourByAlpha | kSourceBGRA );
32
 
33
     // set defaults
34
     if( method != kDxt3 && method != kDxt5 )
35
@@ -124,8 +125,30 @@
36
     return blockcount*blocksize;
37
 }
38
 
39
+void CopyRGBA( u8 const* source, u8* dest, int flags )
40
+{
41
+   if (flags & kSourceBGRA)
42
+   {
43
+       // convert from bgra to rgba
44
+       dest[0] = source[2];
45
+       dest[1] = source[1];
46
+       dest[2] = source[0];
47
+       dest[3] = source[3];
48
+   }
49
+   else
50
+   {
51
+       for( int i = 0; i < 4; ++i )
52
+           *dest++ = *source++;
53
+   }
54
+}
55
+
56
 void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric )
57
 {
58
+   CompressImage(rgba, width, height, width*4, blocks, flags, metric);
59
+}
60
+  
61
+void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric )
62
+{
63
     // fix any bad flags
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.