#include <stdint.h>
+#include "config.h"
+
/*
* Define compressed VQ tables.
*/
/**
* Pack two delta values (a,b) into one 16bit word
- * according with endianess of the host machine.
+ * according with endianness of the host machine.
*/
#if HAVE_BIGENDIAN
#define PD(a,b) (((a) << 8) + (b))
* Expand a pair of delta values (a,b)
* into two/four delta entries.
*/
-#define E2(a, b) PD(a, b), PD(-a, -b)
-#define E4(a, b) PD(a, b), PD(-a, -b), PD(b, a), PD(-b, -a)
+#define E2(a, b) PD(a, b), PD(-(a), -(b))
+#define E4(a, b) PD(a, b), PD(-(a), -(b)), PD(b, a), PD(-(b), -(a))
/*
* VQ tables for 4x4 block modes.
/**
* Pack four delta values (a,a,b,b) into one 32bit word
- * according with endianess of the host machine.
+ * according with endianness of the host machine.
*/
#if HAVE_BIGENDIAN
#define PD(a,b) (((a) << 24) + ((a) << 16) + ((b) << 8) + (b))
static const int32_t delta_tab_3_5_m10[79] = { TAB_3_5 };
-typedef struct {
+typedef struct vqEntry {
const int16_t *deltas; ///< delta tables for 4x4 block modes
const int32_t *deltas_m10; ///< delta tables for 8x8 block modes
uint8_t num_dyads; ///< number of two-pixel deltas