Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg
[gecko.git] / media / libvpx / I6f2b218d.patch
blob2e4a367eb2a5ebd4d1d41028bb11aff7cee48b7a
1 # HG changeset patch
2 # Parent d02aa133060bcdfd44634038c8c28654c718c2ff
3 # User Timothy B. Terriberry <tterribe@vt.edu>
4 remove __inline for compiler compatibility
6 Upstream Change-Id: I6f2b218dfc808b73212bbb90c69e2b6cc1fa90ce
8 diff --git a/media/libvpx/vp8/common/loopfilter_filters.c b/media/libvpx/vp8/common/loopfilter_filters.c
9 --- a/media/libvpx/vp8/common/loopfilter_filters.c
10 +++ b/media/libvpx/vp8/common/loopfilter_filters.c
11 @@ -10,50 +10,50 @@
14 #include <stdlib.h>
15 #include "loopfilter.h"
16 #include "onyxc_int.h"
18 typedef unsigned char uc;
20 -static __inline signed char vp8_signed_char_clamp(int t)
21 +static signed char vp8_signed_char_clamp(int t)
23 t = (t < -128 ? -128 : t);
24 t = (t > 127 ? 127 : t);
25 return (signed char) t;
29 /* should we apply any filter at all ( 11111111 yes, 00000000 no) */
30 -static __inline signed char vp8_filter_mask(uc limit, uc blimit,
31 - uc p3, uc p2, uc p1, uc p0,
32 - uc q0, uc q1, uc q2, uc q3)
33 +static signed char vp8_filter_mask(uc limit, uc blimit,
34 + uc p3, uc p2, uc p1, uc p0,
35 + uc q0, uc q1, uc q2, uc q3)
37 signed char mask = 0;
38 mask |= (abs(p3 - p2) > limit);
39 mask |= (abs(p2 - p1) > limit);
40 mask |= (abs(p1 - p0) > limit);
41 mask |= (abs(q1 - q0) > limit);
42 mask |= (abs(q2 - q1) > limit);
43 mask |= (abs(q3 - q2) > limit);
44 mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit);
45 return mask - 1;
48 /* is there high variance internal edge ( 11111111 yes, 00000000 no) */
49 -static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
50 +static signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
52 signed char hev = 0;
53 hev |= (abs(p1 - p0) > thresh) * -1;
54 hev |= (abs(q1 - q0) > thresh) * -1;
55 return hev;
58 -static __inline void vp8_filter(signed char mask, uc hev, uc *op1,
59 +static void vp8_filter(signed char mask, uc hev, uc *op1,
60 uc *op0, uc *oq0, uc *oq1)
63 signed char ps0, qs0;
64 signed char ps1, qs1;
65 signed char vp8_filter, Filter1, Filter2;
66 signed char u;
68 @@ -153,17 +153,17 @@ void vp8_loop_filter_vertical_edge_c
70 vp8_filter(mask, hev, s - 2, s - 1, s, s + 1);
72 s += p;
74 while (++i < count * 8);
77 -static __inline void vp8_mbfilter(signed char mask, uc hev,
78 +static void vp8_mbfilter(signed char mask, uc hev,
79 uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2)
81 signed char s, u;
82 signed char vp8_filter, Filter1, Filter2;
83 signed char ps2 = (signed char) * op2 ^ 0x80;
84 signed char ps1 = (signed char) * op1 ^ 0x80;
85 signed char ps0 = (signed char) * op0 ^ 0x80;
86 signed char qs0 = (signed char) * oq0 ^ 0x80;
87 @@ -274,27 +274,27 @@ void vp8_mbloop_filter_vertical_edge_c
89 s += p;
91 while (++i < count * 8);
95 /* should we apply any filter at all ( 11111111 yes, 00000000 no) */
96 -static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
97 +static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
99 /* Why does this cause problems for win32?
100 * error C2143: syntax error : missing ';' before 'type'
101 * (void) limit;
103 signed char mask = (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 <= blimit) * -1;
104 return mask;
107 -static __inline void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
108 +static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
110 signed char vp8_filter, Filter1, Filter2;
111 signed char p1 = (signed char) * op1 ^ 0x80;
112 signed char p0 = (signed char) * op0 ^ 0x80;
113 signed char q0 = (signed char) * oq0 ^ 0x80;
114 signed char q1 = (signed char) * oq1 ^ 0x80;
115 signed char u;
117 diff --git a/media/libvpx/vp8/common/onyx.h b/media/libvpx/vp8/common/onyx.h
118 --- a/media/libvpx/vp8/common/onyx.h
119 +++ b/media/libvpx/vp8/common/onyx.h
120 @@ -67,17 +67,17 @@ extern "C"
122 FRAMEFLAGS_KEY = 1,
123 FRAMEFLAGS_GOLDEN = 2,
124 FRAMEFLAGS_ALTREF = 4,
125 } FRAMETYPE_FLAGS;
128 #include <assert.h>
129 - static __inline void Scale2Ratio(int mode, int *hr, int *hs)
130 + static void Scale2Ratio(int mode, int *hr, int *hs)
132 switch (mode)
134 case NORMAL:
135 *hr = 1;
136 *hs = 1;
137 break;
138 case FOURFIVE:
139 diff --git a/media/libvpx/vp8/encoder/encodemv.c b/media/libvpx/vp8/encoder/encodemv.c
140 --- a/media/libvpx/vp8/encoder/encodemv.c
141 +++ b/media/libvpx/vp8/encoder/encodemv.c
142 @@ -181,17 +181,17 @@ void vp8_build_component_cost_table(int
144 // Motion vector probability table update depends on benefit.
145 // Small correction allows for the fact that an update to an MV probability
146 // may have benefit in subsequent frames as well as the current one.
148 #define MV_PROB_UPDATE_CORRECTION -1
151 -__inline static void calc_prob(vp8_prob *p, const unsigned int ct[2])
152 +static void calc_prob(vp8_prob *p, const unsigned int ct[2])
154 const unsigned int tot = ct[0] + ct[1];
156 if (tot)
158 const vp8_prob x = ((ct[0] * 255) / tot) & -2;
159 *p = x ? x : 1;
161 diff --git a/media/libvpx/vp8/encoder/rdopt.c b/media/libvpx/vp8/encoder/rdopt.c
162 --- a/media/libvpx/vp8/encoder/rdopt.c
163 +++ b/media/libvpx/vp8/encoder/rdopt.c
164 @@ -1326,17 +1326,17 @@ static void rd_check_segment(VP8_COMP *c
166 bsi->mvs[i].as_mv = x->partition_info->bmi[i].mv.as_mv;
167 bsi->modes[i] = x->partition_info->bmi[i].mode;
168 bsi->eobs[i] = x->e_mbd.eobs[i];
173 -static __inline
174 +static
175 void vp8_cal_step_param(int sr, int *sp)
177 int step = 0;
179 if (sr > MAX_FIRST_STEP) sr = MAX_FIRST_STEP;
180 else if (sr < 1) sr = 1;
182 while (sr>>=1)
183 diff --git a/media/libvpx/vp8/encoder/sad_c.c b/media/libvpx/vp8/encoder/sad_c.c
184 --- a/media/libvpx/vp8/encoder/sad_c.c
185 +++ b/media/libvpx/vp8/encoder/sad_c.c
186 @@ -34,17 +34,17 @@ unsigned int vp8_sad16x16_c(
187 src_ptr += src_stride;
188 ref_ptr += ref_stride;
191 return sad;
195 -static __inline
196 +static
197 unsigned int sad_mx_n_c(
198 const unsigned char *src_ptr,
199 int src_stride,
200 const unsigned char *ref_ptr,
201 int ref_stride,
202 int m,
203 int n)
205 diff --git a/media/libvpx/vp8/encoder/tokenize.c b/media/libvpx/vp8/encoder/tokenize.c
206 --- a/media/libvpx/vp8/encoder/tokenize.c
207 +++ b/media/libvpx/vp8/encoder/tokenize.c
208 @@ -480,17 +480,17 @@ void print_context_counters()
211 void vp8_tokenize_initialize()
213 fill_value_tokens();
217 -static __inline void stuff2nd_order_b
218 +static void stuff2nd_order_b
220 TOKENEXTRA **tp,
221 ENTROPY_CONTEXT *a,
222 ENTROPY_CONTEXT *l,
223 VP8_COMP *cpi
226 int pt; /* near block/prev token context index */
227 @@ -504,17 +504,17 @@ static __inline void stuff2nd_order_b
228 ++t;
230 *tp = t;
231 pt = 0;
232 *a = *l = pt;
236 -static __inline void stuff1st_order_b
237 +static void stuff1st_order_b
239 TOKENEXTRA **tp,
240 ENTROPY_CONTEXT *a,
241 ENTROPY_CONTEXT *l,
242 int type,
243 VP8_COMP *cpi
246 @@ -528,17 +528,17 @@ static __inline void stuff1st_order_b
247 t->skip_eob_node = 0;
248 ++cpi->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN];
249 ++t;
250 *tp = t;
251 pt = 0; /* 0 <-> all coeff data is zero */
252 *a = *l = pt;
255 -static __inline
256 +static
257 void stuff1st_order_buv
259 TOKENEXTRA **tp,
260 ENTROPY_CONTEXT *a,
261 ENTROPY_CONTEXT *l,
262 VP8_COMP *cpi
265 diff --git a/media/libvpx/vp8/encoder/treewriter.h b/media/libvpx/vp8/encoder/treewriter.h
266 --- a/media/libvpx/vp8/encoder/treewriter.h
267 +++ b/media/libvpx/vp8/encoder/treewriter.h
268 @@ -37,28 +37,28 @@ typedef BOOL_CODER vp8_writer;
270 #define vp8_cost_bit( x, b) vp8_cost_zero( (b)? vp8_complement(x) : (x) )
272 /* VP8BC version is scaled by 2^20 rather than 2^8; see bool_coder.h */
275 /* Both of these return bits, not scaled bits. */
277 -static __inline unsigned int vp8_cost_branch(const unsigned int ct[2], vp8_prob p)
278 +static unsigned int vp8_cost_branch(const unsigned int ct[2], vp8_prob p)
280 /* Imitate existing calculation */
282 return ((ct[0] * vp8_cost_zero(p))
283 + (ct[1] * vp8_cost_one(p))) >> 8;
286 /* Small functions to write explicit values and tokens, as well as
287 estimate their lengths. */
289 -static __inline void vp8_treed_write
290 +static void vp8_treed_write
292 vp8_writer *const w,
293 vp8_tree t,
294 const vp8_prob *const p,
295 int v,
296 int n /* number of bits in v, assumed nonzero */
299 @@ -67,28 +67,28 @@ static __inline void vp8_treed_write
302 const int b = (v >> --n) & 1;
303 vp8_write(w, b, p[i>>1]);
304 i = t[i+b];
306 while (n);
308 -static __inline void vp8_write_token
309 +static void vp8_write_token
311 vp8_writer *const w,
312 vp8_tree t,
313 const vp8_prob *const p,
314 vp8_token *const x
317 vp8_treed_write(w, t, p, x->value, x->Len);
320 -static __inline int vp8_treed_cost(
321 +static int vp8_treed_cost(
322 vp8_tree t,
323 const vp8_prob *const p,
324 int v,
325 int n /* number of bits in v, assumed nonzero */
328 int c = 0;
329 vp8_tree_index i = 0;
330 @@ -98,17 +98,17 @@ static __inline int vp8_treed_cost(
331 const int b = (v >> --n) & 1;
332 c += vp8_cost_bit(p[i>>1], b);
333 i = t[i+b];
335 while (n);
337 return c;
339 -static __inline int vp8_cost_token
340 +static int vp8_cost_token
342 vp8_tree t,
343 const vp8_prob *const p,
344 vp8_token *const x
347 return vp8_treed_cost(t, p, x->value, x->Len);