summaryrefslogtreecommitdiff
path: root/src/static_libs/rg_etc/etc2_encoder.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-06-10 10:52:57 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-06-10 14:58:28 +0900
commitd6e6d001a3fd29c4ca62b9b18afa0d95248f6874 (patch)
tree2f175b1d85280470f84bb1ad95f60cc933c9cac2 /src/static_libs/rg_etc/etc2_encoder.c
parent878641f6dc73972c9171768fd584c58de4b83c4d (diff)
Evas ETC2: Clean up debug code
Disable flag and disable unused function if DEBUG is not set.
Diffstat (limited to 'src/static_libs/rg_etc/etc2_encoder.c')
-rw-r--r--src/static_libs/rg_etc/etc2_encoder.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/static_libs/rg_etc/etc2_encoder.c b/src/static_libs/rg_etc/etc2_encoder.c
index 874904f0e2..b4db45062f 100644
--- a/src/static_libs/rg_etc/etc2_encoder.c
+++ b/src/static_libs/rg_etc/etc2_encoder.c
@@ -28,8 +28,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#include <Eina.h> 28#include <Eina.h>
29#include "rg_etc1.h" 29#include "rg_etc1.h"
30 30
31// FIXME: Remove DEBUG 31// Enable this flag when working on (quality) optimizations
32#define DEBUG 32//#define DEBUG
33 33
34// Weights for the distance (perceptual mode) - sum is ~1024 34// Weights for the distance (perceptual mode) - sum is ~1024
35static const int R_WEIGHT = 299 * 1024 / 1000; 35static const int R_WEIGHT = 299 * 1024 / 1000;
@@ -126,7 +126,11 @@ static const int kBlockWalk[16] = {
126#endif 126#endif
127 127
128#ifndef DBG 128#ifndef DBG
129# define DBG(fmt, ...) fprintf(stderr, "%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## __VA_ARGS__) 129# ifdef DEBUG
130# define DBG(fmt, ...) fprintf(stderr, "%s:%d: " fmt "\n", __FUNCTION__, __LINE__, ## __VA_ARGS__)
131# else
132# define DBG(...)
133# endif
130#endif 134#endif
131 135
132/** Pack alpha block given a modifier table and a multiplier 136/** Pack alpha block given a modifier table and a multiplier
@@ -924,6 +928,7 @@ _etc2_planar_mode_block_encode(uint8_t *etc2, const uint32_t *bgra,
924 return err; 928 return err;
925} 929}
926 930
931#ifdef DEBUG
927static unsigned int 932static unsigned int
928_block_error_calc(const uint32_t *enc, const uint32_t *orig, Eina_Bool perceptual) 933_block_error_calc(const uint32_t *enc, const uint32_t *orig, Eina_Bool perceptual)
929{ 934{
@@ -939,6 +944,7 @@ _block_error_calc(const uint32_t *enc, const uint32_t *orig, Eina_Bool perceptua
939 944
940 return errAcc; 945 return errAcc;
941} 946}
947#endif
942 948
943unsigned int 949unsigned int
944etc2_rgba8_block_pack(unsigned char *etc2, const unsigned int *bgra, 950etc2_rgba8_block_pack(unsigned char *etc2, const unsigned int *bgra,
@@ -993,7 +999,8 @@ etc2_rgba8_block_pack(unsigned char *etc2, const unsigned int *bgra,
993 999
994#ifdef DEBUG 1000#ifdef DEBUG
995 cnt[bestSolution]++; 1001 cnt[bestSolution]++;
996 DBG("Block count by mode: ETC1: %d T/H: %d Planar: %d. Err %d", cnt[0], cnt[1], cnt[2], minErr); 1002 DBG("Block count by mode: ETC1: %d T/H: %d Planar: %d. Err %d",
1003 cnt[0], cnt[1], cnt[2], minErr);
997#endif 1004#endif
998 1005
999 return minErr; 1006 return minErr;