annotate lib/libavutil/common.h @ 2535:3a36de426f5f

For draw uPlayerCreationUI_ArrowAnim
author Ritor1
date Sun, 15 Feb 2015 23:39:07 +0600
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 * @file
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23 * common internal and external API header
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26 #ifndef AVUTIL_COMMON_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 #define AVUTIL_COMMON_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29 #include <errno.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 #include <stdint.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31 #include <limits.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32 #include <math.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33 #include <stdio.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 #include <stdlib.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 #include <string.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 #include "attributes.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38 #include "version.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 #include "avconfig.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41 #if AV_HAVE_BIGENDIAN
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 # define AV_NE(be, le) (be)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43 #else
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 # define AV_NE(be, le) (le)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 //rounded division & shift
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 /* assume b>0 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50 #define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 /* assume a>0 and b>0 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52 #define FF_CEIL_RSHIFT(a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 : ((a) + (1<<(b)) - 1) >> (b))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 #define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 #define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 #define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 #define FFSIGN(a) ((a) > 0 ? 1 : -1)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 #define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61 #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 #define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64 #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65 #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
66 #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
67
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
68 /* misc math functions */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
69
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
70 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
71 * Reverse the order of the bits of an 8-bits unsigned integer.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
72 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
73 #if FF_API_AV_REVERSE
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
74 extern attribute_deprecated const uint8_t av_reverse[256];
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
75 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
76
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
77 #ifdef HAVE_AV_CONFIG_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
78 # include "config.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
79 # include "intmath.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
80 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
81
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
82 /* Pull in unguarded fallback defines at the end of this file. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
83 #include "common.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
84
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
85 #ifndef av_log2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
86 av_const int av_log2(unsigned v);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
87 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
88
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
89 #ifndef av_log2_16bit
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
90 av_const int av_log2_16bit(unsigned v);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
91 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
92
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
93 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
94 * Clip a signed integer value into the amin-amax range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
95 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
96 * @param amin minimum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
97 * @param amax maximum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
98 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
99 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
100 static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
101 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
102 #if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
103 if (amin > amax) abort();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
104 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
105 if (a < amin) return amin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
106 else if (a > amax) return amax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
107 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
108 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
109
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
110 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
111 * Clip a signed 64bit integer value into the amin-amax range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
112 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
113 * @param amin minimum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
114 * @param amax maximum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
115 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
116 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
117 static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
118 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
119 #if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
120 if (amin > amax) abort();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
121 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
122 if (a < amin) return amin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
123 else if (a > amax) return amax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
124 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
125 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
126
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
127 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
128 * Clip a signed integer value into the 0-255 range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
129 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
130 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
131 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
132 static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
133 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
134 if (a&(~0xFF)) return (-a)>>31;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
135 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
136 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
137
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
138 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
139 * Clip a signed integer value into the -128,127 range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
140 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
141 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
142 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
143 static av_always_inline av_const int8_t av_clip_int8_c(int a)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
144 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
145 if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
146 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
147 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
148
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
149 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
150 * Clip a signed integer value into the 0-65535 range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
151 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
152 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
153 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
154 static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
155 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
156 if (a&(~0xFFFF)) return (-a)>>31;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
157 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
158 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
159
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
160 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
161 * Clip a signed integer value into the -32768,32767 range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
162 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
163 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
164 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
165 static av_always_inline av_const int16_t av_clip_int16_c(int a)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
166 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
167 if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
168 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
169 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
170
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
171 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
172 * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
173 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
174 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
175 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
176 static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
177 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
178 if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
179 else return (int32_t)a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
180 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
181
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
182 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
183 * Clip a signed integer to an unsigned power of two range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
184 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
185 * @param p bit position to clip at
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
186 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
187 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
188 static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
189 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
190 if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
191 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
192 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
193
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
194 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
195 * Add two signed 32-bit values with saturation.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
196 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
197 * @param a one value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
198 * @param b another value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
199 * @return sum with signed saturation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
200 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
201 static av_always_inline int av_sat_add32_c(int a, int b)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
202 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
203 return av_clipl_int32((int64_t)a + b);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
204 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
205
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
206 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
207 * Add a doubled value to another value with saturation at both stages.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
208 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
209 * @param a first value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
210 * @param b value doubled and added to a
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
211 * @return sum with signed saturation
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
212 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
213 static av_always_inline int av_sat_dadd32_c(int a, int b)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
214 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
215 return av_sat_add32(a, av_sat_add32(b, b));
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
216 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
217
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
218 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
219 * Clip a float value into the amin-amax range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
220 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
221 * @param amin minimum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
222 * @param amax maximum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
223 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
224 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
225 static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
226 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
227 #if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
228 if (amin > amax) abort();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
229 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
230 if (a < amin) return amin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
231 else if (a > amax) return amax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
232 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
233 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
234
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
235 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
236 * Clip a double value into the amin-amax range.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
237 * @param a value to clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
238 * @param amin minimum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
239 * @param amax maximum value of the clip range
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
240 * @return clipped value
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
241 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
242 static av_always_inline av_const double av_clipd_c(double a, double amin, double amax)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
243 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
244 #if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
245 if (amin > amax) abort();
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
246 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
247 if (a < amin) return amin;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
248 else if (a > amax) return amax;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
249 else return a;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
250 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
251
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
252 /** Compute ceil(log2(x)).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
253 * @param x value used to compute ceil(log2(x))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
254 * @return computed ceiling of log2(x)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
255 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
256 static av_always_inline av_const int av_ceil_log2_c(int x)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
257 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
258 return av_log2((x - 1) << 1);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
259 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
260
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
261 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
262 * Count number of bits set to one in x
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
263 * @param x value to count bits of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
264 * @return the number of bits set to one in x
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
265 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
266 static av_always_inline av_const int av_popcount_c(uint32_t x)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
267 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
268 x -= (x >> 1) & 0x55555555;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
269 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
270 x = (x + (x >> 4)) & 0x0F0F0F0F;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
271 x += x >> 8;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
272 return (x + (x >> 16)) & 0x3F;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
273 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
274
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
275 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
276 * Count number of bits set to one in x
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
277 * @param x value to count bits of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
278 * @return the number of bits set to one in x
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
279 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
280 static av_always_inline av_const int av_popcount64_c(uint64_t x)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
281 {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
282 return av_popcount((uint32_t)x) + av_popcount(x >> 32);
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
283 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
284
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
285 #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
286 #define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
287
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
288 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
289 * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
290 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
291 * @param val Output value, must be an lvalue of type uint32_t.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
292 * @param GET_BYTE Expression reading one byte from the input.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
293 * Evaluated up to 7 times (4 for the currently
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
294 * assigned Unicode range). With a memory buffer
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
295 * input, this could be *ptr++.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
296 * @param ERROR Expression to be evaluated on invalid input,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
297 * typically a goto statement.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
298 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
299 #define GET_UTF8(val, GET_BYTE, ERROR)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
300 val= GET_BYTE;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
301 {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
302 uint32_t top = (val & 128) >> 1;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
303 if ((val & 0xc0) == 0x80 || val >= 0xFE)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
304 ERROR\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
305 while (val & top) {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
306 int tmp= GET_BYTE - 128;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
307 if(tmp>>6)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
308 ERROR\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
309 val= (val<<6) + tmp;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
310 top <<= 5;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
311 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
312 val &= (top << 1) - 1;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
313 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
314
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
315 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
316 * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
317 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
318 * @param val Output value, must be an lvalue of type uint32_t.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
319 * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
320 * to native byte order. Evaluated one or two times.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
321 * @param ERROR Expression to be evaluated on invalid input,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
322 * typically a goto statement.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
323 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
324 #define GET_UTF16(val, GET_16BIT, ERROR)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
325 val = GET_16BIT;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
326 {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
327 unsigned int hi = val - 0xD800;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
328 if (hi < 0x800) {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
329 val = GET_16BIT - 0xDC00;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
330 if (val > 0x3FFU || hi > 0x3FFU)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
331 ERROR\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
332 val += (hi<<10) + 0x10000;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
333 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
334 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
335
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
336 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
337 * @def PUT_UTF8(val, tmp, PUT_BYTE)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
338 * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
339 * @param val is an input-only argument and should be of type uint32_t. It holds
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
340 * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
341 * val is given as a function it is executed only once.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
342 * @param tmp is a temporary variable and should be of type uint8_t. It
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
343 * represents an intermediate value during conversion that is to be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
344 * output by PUT_BYTE.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
345 * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
346 * It could be a function or a statement, and uses tmp as the input byte.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
347 * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
348 * executed up to 4 times for values in the valid UTF-8 range and up to
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
349 * 7 times in the general case, depending on the length of the converted
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
350 * Unicode character.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
351 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
352 #define PUT_UTF8(val, tmp, PUT_BYTE)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
353 {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
354 int bytes, shift;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
355 uint32_t in = val;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
356 if (in < 0x80) {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
357 tmp = in;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
358 PUT_BYTE\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
359 } else {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
360 bytes = (av_log2(in) + 4) / 5;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
361 shift = (bytes - 1) * 6;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
362 tmp = (256 - (256 >> bytes)) | (in >> shift);\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
363 PUT_BYTE\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
364 while (shift >= 6) {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
365 shift -= 6;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
366 tmp = 0x80 | ((in >> shift) & 0x3f);\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
367 PUT_BYTE\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
368 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
369 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
370 }
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
371
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
372 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
373 * @def PUT_UTF16(val, tmp, PUT_16BIT)
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
374 * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
375 * @param val is an input-only argument and should be of type uint32_t. It holds
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
376 * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
377 * val is given as a function it is executed only once.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
378 * @param tmp is a temporary variable and should be of type uint16_t. It
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
379 * represents an intermediate value during conversion that is to be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
380 * output by PUT_16BIT.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
381 * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
382 * in desired endianness. It could be a function or a statement, and uses tmp
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
383 * as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
384 * PUT_BYTE will be executed 1 or 2 times depending on input character.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
385 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
386 #define PUT_UTF16(val, tmp, PUT_16BIT)\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
387 {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
388 uint32_t in = val;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
389 if (in < 0x10000) {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
390 tmp = in;\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
391 PUT_16BIT\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
392 } else {\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
393 tmp = 0xD800 | ((in - 0x10000) >> 10);\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
394 PUT_16BIT\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
395 tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
396 PUT_16BIT\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
397 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
398 }\
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
399
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
400
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
401
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
402 #include "mem.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
403
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
404 #ifdef HAVE_AV_CONFIG_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
405 # include "internal.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
406 #endif /* HAVE_AV_CONFIG_H */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
407
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
408 #endif /* AVUTIL_COMMON_H */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
409
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
410 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
411 * The following definitions are outside the multiple inclusion guard
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
412 * to ensure they are immediately available in intmath.h.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
413 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
414
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
415 #ifndef av_ceil_log2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
416 # define av_ceil_log2 av_ceil_log2_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
417 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
418 #ifndef av_clip
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
419 # define av_clip av_clip_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
420 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
421 #ifndef av_clip64
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
422 # define av_clip64 av_clip64_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
423 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
424 #ifndef av_clip_uint8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
425 # define av_clip_uint8 av_clip_uint8_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
426 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
427 #ifndef av_clip_int8
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
428 # define av_clip_int8 av_clip_int8_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
429 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
430 #ifndef av_clip_uint16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
431 # define av_clip_uint16 av_clip_uint16_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
432 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
433 #ifndef av_clip_int16
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
434 # define av_clip_int16 av_clip_int16_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
435 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
436 #ifndef av_clipl_int32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
437 # define av_clipl_int32 av_clipl_int32_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
438 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
439 #ifndef av_clip_uintp2
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
440 # define av_clip_uintp2 av_clip_uintp2_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
441 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
442 #ifndef av_sat_add32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
443 # define av_sat_add32 av_sat_add32_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
444 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
445 #ifndef av_sat_dadd32
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
446 # define av_sat_dadd32 av_sat_dadd32_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
447 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
448 #ifndef av_clipf
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
449 # define av_clipf av_clipf_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
450 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
451 #ifndef av_clipd
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
452 # define av_clipd av_clipd_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
453 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
454 #ifndef av_popcount
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
455 # define av_popcount av_popcount_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
456 #endif
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
457 #ifndef av_popcount64
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
458 # define av_popcount64 av_popcount64_c
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
459 #endif