summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2017-08-03 16:24:28 +0200
committerFrediano Ziglio <fziglio@redhat.com>2018-05-24 11:01:22 +0100
commit763735d636a2e051be4ae6e477ef17a2e1daf39c (patch)
tree32a9f534590e007c0609ed05e16e274aa7072eec /common
parent0629153699ee12cbf08dcba8e0a781ad4d78c45d (diff)
quic: Remove configurable PRED
It's hardcoded at compile-time, and I don't think it was changed in years... Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'common')
-rw-r--r--common/quic.c1
-rw-r--r--common/quic_rgb_tmpl.c33
-rw-r--r--common/quic_tmpl.c40
3 files changed, 0 insertions, 74 deletions
diff --git a/common/quic.c b/common/quic.c
index b463116..f66a80d 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -31,7 +31,6 @@
#define RLE
#define RLE_STAT
-#define PRED_1
#define QUIC_RGB
/* ASCII "QUIC" */
diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c
index cc3c045..04f3cbf 100644
--- a/common/quic_rgb_tmpl.c
+++ b/common/quic_rgb_tmpl.c
@@ -110,7 +110,6 @@
#define _PIXEL_A(channel, curr) ((unsigned int)GET_##channel((curr) - 1))
#define _PIXEL_B(channel, prev) ((unsigned int)GET_##channel(prev))
-#define _PIXEL_C(channel, prev) ((unsigned int)GET_##channel((prev) - 1))
/* a */
@@ -120,7 +119,6 @@
#define CORRELATE_0(channel, curr, correlate, bpc_mask)\
((family.xlatL2U[correlate] + _PIXEL_A(channel, curr)) & bpc_mask)
-#ifdef PRED_1
/* (a+b)/2 */
#define DECORRELATE(channel, prev, curr, bpc_mask, r) \
@@ -130,36 +128,6 @@
#define CORRELATE(channel, prev, curr, correlate, bpc_mask, r) \
SET_##channel(r, ((family.xlatL2U[correlate] + \
(int)((_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev)) >> 1)) & bpc_mask))
-#endif
-
-#ifdef PRED_2
-
-/* .75a+.75b-.5c */
-#define DECORRELATE(channel, prev, curr, bpc_mask, r) { \
- int p = ((int)(3 * (_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev))) - \
- (int)(_PIXEL_C(channel, prev) << 1)) >> 2; \
- if (p < 0) { \
- p = 0; \
- } else if ((unsigned)p > bpc_mask) { \
- p = bpc_mask; \
- } \
- r = family.xlatU2L[(unsigned)((int)GET_##channel(curr) - p) & bpc_mask]; \
-}
-
-#define CORRELATE(channel, prev, curr, correlate, bpc_mask, r) { \
- const int p = ((int)(3 * (_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev))) - \
- (int)(_PIXEL_C(channel, prev) << 1) ) >> 2; \
- const unsigned int s = family.xlatL2U[correlate]; \
- if (!(p & ~bpc_mask)) { \
- SET_##channel(r, (s + (unsigned)p) & bpc_mask); \
- } else if (p < 0) { \
- SET_##channel(r, s); \
- } else { \
- SET_##channel(r, (s + bpc_mask) & bpc_mask); \
- } \
-}
-
-#endif
#define COMPRESS_ONE_ROW0_0(channel) \
@@ -693,7 +661,6 @@ static void FNAME(uncompress_row)(Encoder *encoder,
#undef FNAME
#undef _PIXEL_A
#undef _PIXEL_B
-#undef _PIXEL_C
#undef SAME_PIXEL
#undef RLE_PRED_IMP
#undef UPDATE_MODEL
diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c
index d49a408..62f1899 100644
--- a/common/quic_tmpl.c
+++ b/common/quic_tmpl.c
@@ -48,7 +48,6 @@
#define _PIXEL_A ((unsigned int)curr[-1].a)
#define _PIXEL_B ((unsigned int)prev[0].a)
-#define _PIXEL_C ((unsigned int)prev[-1].a)
#ifdef RLE
#define RLE_PRED_IMP \
@@ -73,7 +72,6 @@ static inline void FNAME(correlate_0)(PIXEL *curr, const BYTE correlate,
curr->a = (family.xlatL2U[correlate] + _PIXEL_A) & bpc_mask;
}
-#ifdef PRED_1
/* (a+b)/2 */
static inline BYTE FNAME(decorrelate)(const PIXEL *const prev, const PIXEL * const curr,
@@ -89,43 +87,6 @@ static inline void FNAME(correlate)(const PIXEL *prev, PIXEL *curr, const BYTE c
curr->a = (family.xlatL2U[correlate] + (int)((_PIXEL_A + _PIXEL_B) >> 1)) & bpc_mask;
}
-#endif
-
-#ifdef PRED_2
-
-/* .75a+.75b-.5c */
-static inline BYTE FNAME(decorrelate)(const PIXEL *const prev, const PIXEL * const curr,
- const unsigned int bpc_mask)
-{
- int p = ((int)(3 * (_PIXEL_A + _PIXEL_B)) - (int)(_PIXEL_C << 1)) >> 2;
-
- if (p < 0) {
- p = 0;
- } else if ((unsigned)p > bpc_mask) {
- p = bpc_mask;
- }
-
- {
- return family.xlatU2L[(unsigned)((int)curr->a - p) & bpc_mask];
- }
-}
-
-static inline void FNAME(correlate)(const PIXEL *prev, PIXEL *curr, const BYTE correlate,
- const unsigned int bpc_mask)
-{
- const int p = ((int)(3 * (_PIXEL_A + _PIXEL_B)) - (int)(_PIXEL_C << 1)) >> 2;
- const unsigned int s = family.xlatL2U[correlate];
-
- if (!(p & ~bpc_mask)) {
- curr->a = (s + (unsigned)p) & bpc_mask;
- } else if (p < 0) {
- curr->a = s;
- } else {
- curr->a = (s + bpc_mask) & bpc_mask;
- }
-}
-
-#endif
static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
const PIXEL * const cur_row,
@@ -585,7 +546,6 @@ static void FNAME(uncompress_row)(Encoder *encoder, Channel *channel,
#undef FNAME
#undef _PIXEL_A
#undef _PIXEL_B
-#undef _PIXEL_C
#undef RLE_PRED_IMP
#undef golomb_coding
#undef golomb_decoding