summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_alloccommon.h2
-rw-r--r--vp9/common/vp9_blockd.h2
-rw-r--r--vp9/common/vp9_common.h18
-rw-r--r--vp9/common/vp9_mvref_common.h4
-rw-r--r--vp9/common/vp9_scale.h2
-rw-r--r--vp9/encoder/vp9_encodemb.c2
-rw-r--r--vp9/encoder/vp9_firstpass.h2
-rw-r--r--vp9/encoder/vp9_rd.h6
-rw-r--r--vp9/vp9_cx_iface.c8
-rw-r--r--vp9/vp9_dx_iface.c8
10 files changed, 27 insertions, 27 deletions
diff --git a/vp9/common/vp9_alloccommon.h b/vp9/common/vp9_alloccommon.h
index 5faa4f2be..8900038ea 100644
--- a/vp9/common/vp9_alloccommon.h
+++ b/vp9/common/vp9_alloccommon.h
@@ -11,7 +11,7 @@
#ifndef VPX_VP9_COMMON_VP9_ALLOCCOMMON_H_
#define VPX_VP9_COMMON_VP9_ALLOCCOMMON_H_
-#define INVALID_IDX -1 // Invalid buffer index.
+#define INVALID_IDX (-1) // Invalid buffer index.
#ifdef __cplusplus
extern "C" {
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index e07a9f2d3..504342fdf 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -54,7 +54,7 @@ typedef struct {
// decoder implementation modules critically rely on the defined entry values
// specified herein. They should be refactored concurrently.
-#define NONE -1
+#define NONE (-1)
#define INTRA_FRAME 0
#define LAST_FRAME 1
#define GOLDEN_FRAME 2
diff --git a/vp9/common/vp9_common.h b/vp9/common/vp9_common.h
index ae8dad38e..e3c5535dd 100644
--- a/vp9/common/vp9_common.h
+++ b/vp9/common/vp9_common.h
@@ -33,14 +33,14 @@ extern "C" {
}
// Use this for variably-sized arrays.
-#define vp9_copy_array(dest, src, n) \
- { \
- assert(sizeof(*dest) == sizeof(*src)); \
- memcpy(dest, src, n * sizeof(*src)); \
+#define vp9_copy_array(dest, src, n) \
+ { \
+ assert(sizeof(*(dest)) == sizeof(*(src))); \
+ memcpy(dest, src, (n) * sizeof(*(src))); \
}
#define vp9_zero(dest) memset(&(dest), 0, sizeof(dest))
-#define vp9_zero_array(dest, n) memset(dest, 0, n * sizeof(*dest))
+#define vp9_zero_array(dest, n) memset(dest, 0, (n) * sizeof(*(dest)))
static INLINE int get_unsigned_bits(unsigned int num_values) {
return num_values > 0 ? get_msb(num_values) + 1 : 0;
@@ -49,8 +49,8 @@ static INLINE int get_unsigned_bits(unsigned int num_values) {
#if CONFIG_DEBUG
#define CHECK_MEM_ERROR(cm, lval, expr) \
do { \
- lval = (expr); \
- if (!lval) \
+ (lval) = (expr); \
+ if (!(lval)) \
vpx_internal_error(&(cm)->error, VPX_CODEC_MEM_ERROR, \
"Failed to allocate " #lval " at %s:%d", __FILE__, \
__LINE__); \
@@ -58,8 +58,8 @@ static INLINE int get_unsigned_bits(unsigned int num_values) {
#else
#define CHECK_MEM_ERROR(cm, lval, expr) \
do { \
- lval = (expr); \
- if (!lval) \
+ (lval) = (expr); \
+ if (!(lval)) \
vpx_internal_error(&(cm)->error, VPX_CODEC_MEM_ERROR, \
"Failed to allocate " #lval); \
} while (0)
diff --git a/vp9/common/vp9_mvref_common.h b/vp9/common/vp9_mvref_common.h
index ebe5fdad1..5db6772dc 100644
--- a/vp9/common/vp9_mvref_common.h
+++ b/vp9/common/vp9_mvref_common.h
@@ -263,10 +263,10 @@ static INLINE int_mv scale_mv(const MODE_INFO *mi, int ref,
mv_ref_list, Done) \
do { \
if (is_inter_block(mbmi)) { \
- if ((mbmi)->ref_frame[0] != ref_frame) \
+ if ((mbmi)->ref_frame[0] != (ref_frame)) \
ADD_MV_REF_LIST(scale_mv((mbmi), 0, ref_frame, ref_sign_bias), \
refmv_count, mv_ref_list, Done); \
- if (has_second_ref(mbmi) && (mbmi)->ref_frame[1] != ref_frame && \
+ if (has_second_ref(mbmi) && (mbmi)->ref_frame[1] != (ref_frame) && \
(mbmi)->mv[1].as_int != (mbmi)->mv[0].as_int) \
ADD_MV_REF_LIST(scale_mv((mbmi), 1, ref_frame, ref_sign_bias), \
refmv_count, mv_ref_list, Done); \
diff --git a/vp9/common/vp9_scale.h b/vp9/common/vp9_scale.h
index aaafdf867..2f3b60948 100644
--- a/vp9/common/vp9_scale.h
+++ b/vp9/common/vp9_scale.h
@@ -20,7 +20,7 @@ extern "C" {
#define REF_SCALE_SHIFT 14
#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
-#define REF_INVALID_SCALE -1
+#define REF_INVALID_SCALE (-1)
struct scale_factors {
int x_scale_fp; // horizontal fixed point scale factor
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index a68a0926a..276510204 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -56,7 +56,7 @@ static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] = {
// 'num' can be negative, but 'shift' must be non-negative.
#define RIGHT_SHIFT_POSSIBLY_NEGATIVE(num, shift) \
- ((num) >= 0) ? (num) >> (shift) : -((-(num)) >> (shift))
+ (((num) >= 0) ? (num) >> (shift) : -((-(num)) >> (shift)))
int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
int ctx) {
diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h
index 0807097ac..5d9a7fd0d 100644
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -41,7 +41,7 @@ typedef struct {
} FIRSTPASS_MB_STATS;
#endif
-#define INVALID_ROW -1
+#define INVALID_ROW (-1)
#define MAX_ARF_LAYERS 6
diff --git a/vp9/encoder/vp9_rd.h b/vp9/encoder/vp9_rd.h
index 062ca3277..21f8ddd37 100644
--- a/vp9/encoder/vp9_rd.h
+++ b/vp9/encoder/vp9_rd.h
@@ -27,7 +27,7 @@ extern "C" {
#define RD_EPB_SHIFT 6
#define RDCOST(RM, DM, R, D) \
- (ROUND_POWER_OF_TWO(((int64_t)R) * (RM), VP9_PROB_COST_SHIFT) + (D << DM))
+ ROUND_POWER_OF_TWO(((int64_t)(R)) * (RM), VP9_PROB_COST_SHIFT) + ((D) << (DM))
#define QIDX_SKIP_THRESH 115
#define MV_COST_WEIGHT 108
@@ -101,8 +101,8 @@ typedef enum {
typedef struct RD_OPT {
// Thresh_mult is used to set a threshold for the rd score. A higher value
// means that we will accept the best mode so far more often. This number
- // is used in combination with the current block size, and thresh_freq_fact
- // to pick a threshold.
+ // is used in combination with the current block size, and thresh_freq_fact to
+ // pick a threshold.
int thresh_mult[MAX_MODES];
int thresh_mult_sub8x8[MAX_REFS];
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 85f83a662..2baa21364 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -130,10 +130,10 @@ static vpx_codec_err_t update_error_state(
return VPX_CODEC_INVALID_PARAM; \
} while (0)
-#define RANGE_CHECK(p, memb, lo, hi) \
- do { \
- if (!(((p)->memb == lo || (p)->memb > (lo)) && (p)->memb <= hi)) \
- ERROR(#memb " out of range [" #lo ".." #hi "]"); \
+#define RANGE_CHECK(p, memb, lo, hi) \
+ do { \
+ if (!(((p)->memb == (lo) || (p)->memb > (lo)) && (p)->memb <= (hi))) \
+ ERROR(#memb " out of range [" #lo ".." #hi "]"); \
} while (0)
#define RANGE_CHECK_HI(p, memb, hi) \
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 6a4cb9acf..fa79f7aed 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -245,10 +245,10 @@ static void set_ppflags(const vpx_codec_alg_priv_t *ctx, vp9_ppflags_t *flags) {
return VPX_CODEC_INVALID_PARAM; \
} while (0)
-#define RANGE_CHECK(p, memb, lo, hi) \
- do { \
- if (!(((p)->memb == lo || (p)->memb > (lo)) && (p)->memb <= hi)) \
- ERROR(#memb " out of range [" #lo ".." #hi "]"); \
+#define RANGE_CHECK(p, memb, lo, hi) \
+ do { \
+ if (!(((p)->memb == (lo) || (p)->memb > (lo)) && (p)->memb <= (hi))) \
+ ERROR(#memb " out of range [" #lo ".." #hi "]"); \
} while (0)
static vpx_codec_err_t init_decoder(vpx_codec_alg_priv_t *ctx) {