shithub: libvpx

Download patch

ref: f45296176504475fce7b00c19aee984cfb6a7f82
parent: 201ebe554ca75b70a2171f54246f26fd37424587
author: Jim Bankoski <jimbankoski@google.com>
date: Tue Aug 12 12:51:07 EDT 2014

fixes several -Wunused-function warnings

Change-Id: I4dc2cb255f4fe30998b6ee61184895dee9f5da8e

--- a/vp9/common/vp9_mvref_common.h
+++ b/vp9/common/vp9_mvref_common.h
@@ -125,7 +125,7 @@
 // clamp_mv_ref
 #define MV_BORDER (16 << 3)  // Allow 16 pels in 1/8th pel units
 
-static void clamp_mv_ref(MV *mv, const MACROBLOCKD *xd) {
+static INLINE void clamp_mv_ref(MV *mv, const MACROBLOCKD *xd) {
   clamp_mv(mv, xd->mb_to_left_edge - MV_BORDER,
                xd->mb_to_right_edge + MV_BORDER,
                xd->mb_to_top_edge - MV_BORDER,
--- a/vp9/decoder/vp9_reader.h
+++ b/vp9/decoder/vp9_reader.h
@@ -52,7 +52,7 @@
 
 const uint8_t *vp9_reader_find_end(vp9_reader *r);
 
-static int vp9_read(vp9_reader *r, int prob) {
+static INLINE int vp9_read(vp9_reader *r, int prob) {
   unsigned int bit = 0;
   BD_VALUE value;
   BD_VALUE bigsplit;
@@ -89,11 +89,11 @@
   return bit;
 }
 
-static int vp9_read_bit(vp9_reader *r) {
+static INLINE int vp9_read_bit(vp9_reader *r) {
   return vp9_read(r, 128);  // vp9_prob_half
 }
 
-static int vp9_read_literal(vp9_reader *r, int bits) {
+static INLINE int vp9_read_literal(vp9_reader *r, int bits) {
   int literal = 0, bit;
 
   for (bit = bits - 1; bit >= 0; bit--)
@@ -102,8 +102,8 @@
   return literal;
 }
 
-static int vp9_read_tree(vp9_reader *r, const vp9_tree_index *tree,
-                         const vp9_prob *probs) {
+static INLINE int vp9_read_tree(vp9_reader *r, const vp9_tree_index *tree,
+                                const vp9_prob *probs) {
   vp9_tree_index i = 0;
 
   while ((i = tree[i + vp9_read(r, probs[i >> 1])]) > 0)
--- a/vp9/encoder/vp9_writer.h
+++ b/vp9/encoder/vp9_writer.h
@@ -35,7 +35,7 @@
 void vp9_start_encode(vp9_writer *bc, uint8_t *buffer);
 void vp9_stop_encode(vp9_writer *bc);
 
-static void vp9_write(vp9_writer *br, int bit, int probability) {
+static INLINE void vp9_write(vp9_writer *br, int bit, int probability) {
   unsigned int split;
   int count = br->count;
   unsigned int range = br->range;
@@ -83,11 +83,11 @@
   br->range = range;
 }
 
-static void vp9_write_bit(vp9_writer *w, int bit) {
+static INLINE void vp9_write_bit(vp9_writer *w, int bit) {
   vp9_write(w, bit, 128);  // vp9_prob_half
 }
 
-static void vp9_write_literal(vp9_writer *w, int data, int bits) {
+static INLINE void vp9_write_literal(vp9_writer *w, int data, int bits) {
   int bit;
 
   for (bit = bits - 1; bit >= 0; bit--)
--- a/vpx_ports/vpx_timer.h
+++ b/vpx_ports/vpx_timer.h
@@ -53,7 +53,7 @@
 };
 
 
-static void
+static INLINE void
 vpx_usec_timer_start(struct vpx_usec_timer *t) {
 #if defined(_WIN32)
   QueryPerformanceCounter(&t->begin);
@@ -63,7 +63,7 @@
 }
 
 
-static void
+static INLINE void
 vpx_usec_timer_mark(struct vpx_usec_timer *t) {
 #if defined(_WIN32)
   QueryPerformanceCounter(&t->end);
@@ -73,7 +73,7 @@
 }
 
 
-static int64_t
+static INLINE int64_t
 vpx_usec_timer_elapsed(struct vpx_usec_timer *t) {
 #if defined(_WIN32)
   LARGE_INTEGER freq, diff;
@@ -101,13 +101,13 @@
   void *dummy;
 };
 
-static void
+static INLINE void
 vpx_usec_timer_start(struct vpx_usec_timer *t) { }
 
-static void
+static INLINE void
 vpx_usec_timer_mark(struct vpx_usec_timer *t) { }
 
-static long
+static INLINE int
 vpx_usec_timer_elapsed(struct vpx_usec_timer *t) {
   return 0;
 }
--- a/vpx_ports/x86.h
+++ b/vpx_ports/x86.h
@@ -116,7 +116,7 @@
 #define BIT(n) (1<<n)
 #endif
 
-static int
+static INLINE int
 x86_simd_caps(void) {
   unsigned int flags = 0;
   unsigned int mask = ~0;
@@ -172,7 +172,7 @@
 unsigned __int64 __rdtsc(void);
 #pragma intrinsic(__rdtsc)
 #endif
-static unsigned int
+static INLINE unsigned int
 x86_readtsc(void) {
 #if defined(__GNUC__) && __GNUC__
   unsigned int tsc;
@@ -249,9 +249,9 @@
 }
 #endif
 
-static unsigned short
+static INLINE unsigned int
 x87_set_double_precision(void) {
-  unsigned short mode = x87_get_control_word();
+  unsigned int mode = x87_get_control_word();
   x87_set_control_word((mode&~0x300) | 0x200);
   return mode;
 }
--- a/vpxdec.c
+++ b/vpxdec.c
@@ -123,8 +123,8 @@
 };
 #endif
 
-static int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst,
-                           FilterModeEnum mode) {
+static INLINE int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst,
+                                  FilterModeEnum mode) {
   assert(src->fmt == VPX_IMG_FMT_I420);
   assert(dst->fmt == VPX_IMG_FMT_I420);
   return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y],