comparison libavcodec/sscc_h264_ompss.c @ 10:4d1f82230449

preprocessed source from newer mercurial ver.
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 13 Aug 2013 13:12:57 +0200
parents ea1ba68cf0ed
children
comparison
equal deleted inserted replaced
0:d9d00a910296 1:6d3bd748eb40
1 const char *__nanos_family __attribute__((weak)) = "master"; 1 typedef unsigned int uint32_t;
2 int __nanos_version __attribute__((weak)) = 5015; 2 static __inline __attribute__((always_inline)) uint32_t pack16to32(int a, int b)
3 int __mcc_master __attribute__((weak)) = 5015; 3 {
4 int __mcc_openmp __attribute__((weak)) = 5; 4 return (a & 65535) + (b << 16);
5 int __mcc_trunk __attribute__((weak)) = 399; 5 }
6 int __mcc_worksharing __attribute__((weak)) = 1000; 6 typedef unsigned short int uint16_t;
7 typedef unsigned char __u_char; 7 static __inline __attribute__((always_inline)) uint16_t pack8to16(int a, int b)
8 typedef unsigned short int __u_short; 8 {
9 typedef unsigned int __u_int; 9 return (a & 255) + (b << 8);
10 typedef unsigned long int __u_long; 10 }
11 typedef signed char __int8_t; 11 struct CABACContext;
12 typedef unsigned char __uint8_t; 12 typedef struct CABACContext CABACContext;
13 typedef signed short int __int16_t; 13 typedef unsigned char uint8_t;
14 typedef unsigned short int __uint16_t; 14 struct CABACContext
15 typedef signed int __int32_t; 15 {
16 typedef unsigned int __uint32_t; 16 int low;
17 typedef signed long int __int64_t; 17 int range;
18 typedef unsigned long int __uint64_t; 18 int outstanding_count;
19 typedef long int __quad_t; 19 const uint8_t *bytestream_start;
20 typedef unsigned long int __u_quad_t; 20 const uint8_t *bytestream;
21 typedef unsigned long int __dev_t; 21 const uint8_t *bytestream_end;
22 typedef unsigned int __uid_t; 22 uint8_t cabac_state[460];
23 typedef unsigned int __gid_t; 23 };
24 typedef unsigned long int __ino_t; 24 static void refill(CABACContext *c)
25 typedef unsigned long int __ino64_t; 25 {
26 typedef unsigned int __mode_t; 26 (*c).low += ((*c).bytestream[0] << 9) + ((*c).bytestream[1] << 1);
27 typedef unsigned long int __nlink_t; 27 (*c).low -= (1 << 16) - 1;
28 typedef long int __off_t; 28 (*c).bytestream += 16 / 8;
29 typedef long int __off64_t; 29 }
30 typedef int __pid_t; 30 extern const uint8_t ff_h264_norm_shift[512];
31 typedef struct 31 static void refill2(CABACContext *c)
32 { 32 {
33 int __val[2]; 33 int x;
34 } __fsid_t; 34 int i;
35 typedef long int __clock_t; 35 x = (*c).low ^ ((*c).low - 1);
36 typedef unsigned long int __rlim_t; 36 i = 7 - ff_h264_norm_shift[x >> (16 - 1)];
37 typedef unsigned long int __rlim64_t; 37 x = -((1 << 16) - 1);
38 typedef unsigned int __id_t; 38 x += ((*c).bytestream[0] << 9) + ((*c).bytestream[1] << 1);
39 typedef long int __time_t; 39 (*c).low += x << i;
40 typedef unsigned int __useconds_t; 40 (*c).bytestream += 16 / 8;
41 typedef long int __suseconds_t; 41 }
42 typedef int __daddr_t; 42 static __inline void renorm_cabac_decoder(CABACContext *c)
43 typedef long int __swblk_t; 43 {
44 typedef int __key_t; 44 while ((*c).range < 256)
45 typedef int __clockid_t; 45 {
46 typedef void *__timer_t; 46 {
47 typedef long int __blksize_t; 47 (*c).range += (*c).range;
48 typedef long int __blkcnt_t; 48 (*c).low += (*c).low;
49 typedef long int __blkcnt64_t; 49 if (!((*c).low & ((1 << 16) - 1)))
50 typedef unsigned long int __fsblkcnt_t; 50 {
51 typedef unsigned long int __fsblkcnt64_t; 51 refill(c);
52 typedef unsigned long int __fsfilcnt_t; 52 }
53 typedef unsigned long int __fsfilcnt64_t; 53 }
54 typedef long int __ssize_t; 54 }
55 typedef __off64_t __loff_t; 55 }
56 typedef __quad_t *__qaddr_t; 56 static __inline void renorm_cabac_decoder_once(CABACContext *c)
57 typedef char *__caddr_t; 57 {
58 typedef long int __intptr_t; 58 int shift = (uint32_t)((*c).range - 256) >> 31;
59 typedef unsigned int __socklen_t; 59 (*c).range <<= shift;
60 typedef __ssize_t ssize_t; 60 (*c).low <<= shift;
61 typedef long unsigned int size_t; 61 if (!((*c).low & ((1 << 16) - 1)))
62 typedef __gid_t gid_t; 62 {
63 typedef __uid_t uid_t; 63 refill(c);
64 typedef __off_t off_t; 64 }
65 typedef __useconds_t useconds_t; 65 }
66 typedef __pid_t pid_t; 66 extern uint8_t ff_h264_lps_range[512];
67 typedef __intptr_t intptr_t; 67 extern uint8_t ff_h264_mlps_state[256];
68 typedef __socklen_t socklen_t; 68 static __inline __attribute__((always_inline)) int get_cabac_inline(CABACContext *c, uint8_t *const state)
69 extern int access(__const char *__name, int __type) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); 69 {
70 extern int faccessat(int __fd, __const char *__file, int __type, int __flag) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warn_unused_result__)); 70 __attribute__((unused)) int lps_mask;
71 extern __off_t lseek(int __fd, __off_t __offset, int __whence) __attribute__((__nothrow__, __leaf__)); 71 int bit;
72 extern int close(int __fd); 72 int s = *state;
73 extern ssize_t read(int __fd, void *__buf, size_t __nbytes) __attribute__((__warn_unused_result__)); 73 int RangeLPS = ff_h264_lps_range[2 * ((*c).range & 192) + s];
74 extern ssize_t write(int __fd, __const void *__buf, size_t __n) __attribute__((__warn_unused_result__)); 74 (*c).range -= RangeLPS;
75 extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, __off_t __offset) __attribute__((__warn_unused_result__)); 75 lps_mask = (((*c).range << (16 + 1)) - (*c).low) >> 31;
76 extern ssize_t pwrite(int __fd, __const void *__buf, size_t __n, __off_t __offset) __attribute__((__warn_unused_result__)); 76 (*c).low -= (*c).range << (16 + 1) & lps_mask;
77 extern int pipe(int __pipedes[2]) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); 77 (*c).range += (RangeLPS - (*c).range) & lps_mask;
78 extern unsigned int alarm(unsigned int __seconds) __attribute__((__nothrow__, __leaf__)); 78 s ^= lps_mask;
79 extern unsigned int sleep(unsigned int __seconds); 79 *state = (ff_h264_mlps_state + 128)[s];
80 extern __useconds_t ualarm(__useconds_t __value, __useconds_t __interval) __attribute__((__nothrow__, __leaf__)); 80 bit = s & 1;
81 extern int usleep(__useconds_t __useconds); 81 lps_mask = ff_h264_norm_shift[(*c).range];
82 extern int pause(void); 82 (*c).range <<= lps_mask;
83 extern int chown(__const char *__file, __uid_t __owner, __gid_t __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); 83 (*c).low <<= lps_mask;
84 extern int fchown(int __fd, __uid_t __owner, __gid_t __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); 84 if (!((*c).low & ((1 << 16) - 1)))
85 extern int lchown(__const char *__file, __uid_t __owner, __gid_t __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); 85 {
86 extern int fchownat(int __fd, __const char *__file, __uid_t __owner, __gid_t __group, int __flag) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warn_unused_result__)); 86 refill2(c);
87 extern int chdir(__const char *__path) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); 87 }
88 extern int fchdir(int __fd) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); 88 return bit;
89 extern char *getcwd(char *__buf, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); 89 }
90 extern char *getwd(char *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__deprecated__)) __attribute__((__warn_unused_result__)); 90 static __attribute__((noinline)) __attribute__((unused)) int get_cabac_noinline(CABACContext *c, uint8_t *const state)
91 extern int dup(int __fd) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); 91 {
92 extern int dup2(int __fd, int __fd2) __attribute__((__nothrow__, __leaf__)); 92 return get_cabac_inline(c, state);
93 extern char **__environ; 93 }
94 extern int execve(__const char *__path, char *__const __argv[], char *__const __envp[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); 94 static __attribute__((unused)) int get_cabac(CABACContext *c, uint8_t *const state)
95 extern int fexecve(int __fd, char *__const __argv[], char *__const __envp[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); 95 {
96 extern int execv(__const char *__path, char *__const __argv[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); 96 return get_cabac_inline(c, state);
97 extern int execle(__const char *__path, __const char *__arg, ...) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); 97 }
98 extern int execl(__const char *__path, __const char *__arg, ...) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); 98 static __attribute__((unused)) int get_cabac_bypass(CABACContext *c)
99 extern int execvp(__const char *__file, char *__const __argv[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); 99 {
100 extern int execlp(__const char *__file, __const char *__arg, ...) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); 100 int range;
101 extern int nice(int __inc) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); 101 (*c).low += (*c).low;
102 extern void _exit(int __status) __attribute__((__noreturn__)); 102 if (!((*c).low & ((1 << 16) - 1)))
103 enum 103 {
104 { 104 refill(c);
105 _PC_LINK_MAX, 105 }
106 _PC_MAX_CANON, 106 range = (*c).range << (16 + 1);
107 _PC_MAX_INPUT, 107 if ((*c).low < range)
108 _PC_NAME_MAX, 108 {
109 _PC_PATH_MAX, 109 {
110 _PC_PIPE_BUF, 110 return 0;
111 _PC_CHOWN_RESTRICTED, 111 }
112 _PC_NO_TRUNC, 112 }
113 _PC_VDISABLE, 113 else
114 _PC_SYNC_IO, 114 {
115 _PC_ASYNC_IO, 115 {
116 _PC_PRIO_IO, 116 (*c).low -= range;
117 _PC_SOCK_MAXBUF, 117 return 1;
118 _PC_FILESIZEBITS, 118 }
119 _PC_REC_INCR_XFER_SIZE, 119 }
120 _PC_REC_MAX_XFER_SIZE, 120 }
121 _PC_REC_MIN_XFER_SIZE, 121 static __inline __attribute__((always_inline)) int get_cabac_bypass_sign(CABACContext *c, int val)
122 _PC_REC_XFER_ALIGN, 122 {
123 _PC_ALLOC_SIZE_MIN, 123 int range;
124 _PC_SYMLINK_MAX, 124 int mask;
125 _PC_2_SYMLINKS 125 (*c).low += (*c).low;
126 }; 126 if (!((*c).low & ((1 << 16) - 1)))
127 enum 127 {
128 { 128 refill(c);
129 _SC_ARG_MAX, 129 }
130 _SC_CHILD_MAX, 130 range = (*c).range << (16 + 1);
131 _SC_CLK_TCK, 131 (*c).low -= range;
132 _SC_NGROUPS_MAX, 132 mask = (*c).low >> 31;
133 _SC_OPEN_MAX, 133 range &= mask;
134 _SC_STREAM_MAX, 134 (*c).low += range;
135 _SC_TZNAME_MAX, 135 return (val ^ mask) - mask;
136 _SC_JOB_CONTROL, 136 }
137 _SC_SAVED_IDS, 137 static __attribute__((unused)) int get_cabac_terminate(CABACContext *c)
138 _SC_REALTIME_SIGNALS, 138 {
139 _SC_PRIORITY_SCHEDULING, 139 (*c).range -= 2;
140 _SC_TIMERS, 140 if ((*c).low < (*c).range << (16 + 1))
141 _SC_ASYNCHRONOUS_IO, 141 {
142 _SC_PRIORITIZED_IO, 142 {
143 _SC_SYNCHRONIZED_IO, 143 renorm_cabac_decoder_once(c);
144 _SC_FSYNC, 144 return 0;
145 _SC_MAPPED_FILES, 145 }
146 _SC_MEMLOCK, 146 }
147 _SC_MEMLOCK_RANGE, 147 else
148 _SC_MEMORY_PROTECTION, 148 {
149 _SC_MESSAGE_PASSING, 149 {
150 _SC_SEMAPHORES, 150 return (*c).bytestream - (*c).bytestream_start;
151 _SC_SHARED_MEMORY_OBJECTS, 151 }
152 _SC_AIO_LISTIO_MAX, 152 }
153 _SC_AIO_MAX, 153 }
154 _SC_AIO_PRIO_DELTA_MAX, 154 static __inline __attribute__((always_inline)) __attribute__((const)) uint16_t bswap_16(uint16_t x)
155 _SC_DELAYTIMER_MAX, 155 {
156 _SC_MQ_OPEN_MAX, 156 __asm__ ("rorw $8, %0" : "+r"(x) : );
157 _SC_MQ_PRIO_MAX, 157 return x;
158 _SC_VERSION, 158 }
159 _SC_PAGESIZE, 159 static __inline __attribute__((always_inline)) __attribute__((const)) uint32_t bswap_32(uint32_t x)
160 _SC_RTSIG_MAX, 160 {
161 _SC_SEM_NSEMS_MAX, 161 __asm__ ("bswap %0" : "+r"(x) : );
162 _SC_SEM_VALUE_MAX, 162 return x;
163 _SC_SIGQUEUE_MAX, 163 }
164 _SC_TIMER_MAX, 164 typedef unsigned long int uint64_t;
165 _SC_BC_BASE_MAX, 165 static __inline __attribute__((const)) uint64_t bswap_64(uint64_t x)
166 _SC_BC_DIM_MAX, 166 {
167 _SC_BC_SCALE_MAX, 167 __asm__ ("bswap %0" : "=r"(x) : "0"(x));
168 _SC_BC_STRING_MAX, 168 return x;
169 _SC_COLL_WEIGHTS_MAX, 169 }
170 _SC_EQUIV_CLASS_MAX, 170 extern const uint8_t ff_log2_tab[256];
171 _SC_EXPR_NEST_MAX, 171 static __inline __attribute__((const)) int av_log2_c(unsigned int v)
172 _SC_LINE_MAX, 172 {
173 _SC_RE_DUP_MAX, 173 int n = 0;
174 _SC_CHARCLASS_NAME_MAX, 174 if (v & 4294901760U)
175 _SC_2_VERSION, 175 {
176 _SC_2_C_BIND, 176 {
177 _SC_2_C_DEV, 177 v >>= 16;
178 _SC_2_FORT_DEV, 178 n += 16;
179 _SC_2_FORT_RUN, 179 }
180 _SC_2_SW_DEV, 180 }
181 _SC_2_LOCALEDEF, 181 if (v & 65280)
182 _SC_PII, 182 {
183 _SC_PII_XTI, 183 {
184 _SC_PII_SOCKET, 184 v >>= 8;
185 _SC_PII_INTERNET, 185 n += 8;
186 _SC_PII_OSI, 186 }
187 _SC_POLL, 187 }
188 _SC_SELECT, 188 n += ff_log2_tab[v];
189 _SC_UIO_MAXIOV, 189 return n;
190 _SC_IOV_MAX = _SC_UIO_MAXIOV, 190 }
191 _SC_PII_INTERNET_STREAM, 191 static __inline __attribute__((const)) int av_log2_16bit_c(unsigned int v)
192 _SC_PII_INTERNET_DGRAM, 192 {
193 _SC_PII_OSI_COTS, 193 int n = 0;
194 _SC_PII_OSI_CLTS, 194 if (v & 65280)
195 _SC_PII_OSI_M, 195 {
196 _SC_T_IOV_MAX, 196 {
197 _SC_THREADS, 197 v >>= 8;
198 _SC_THREAD_SAFE_FUNCTIONS, 198 n += 8;
199 _SC_GETGR_R_SIZE_MAX, 199 }
200 _SC_GETPW_R_SIZE_MAX, 200 }
201 _SC_LOGIN_NAME_MAX, 201 n += ff_log2_tab[v];
202 _SC_TTY_NAME_MAX, 202 return n;
203 _SC_THREAD_DESTRUCTOR_ITERATIONS, 203 }
204 _SC_THREAD_KEYS_MAX, 204 static __inline __attribute__((const)) int av_clip(int a, int amin, int amax)
205 _SC_THREAD_STACK_MIN, 205 {
206 _SC_THREAD_THREADS_MAX, 206 if (a < amin)
207 _SC_THREAD_ATTR_STACKADDR, 207 {
208 _SC_THREAD_ATTR_STACKSIZE, 208 return amin;
209 _SC_THREAD_PRIORITY_SCHEDULING, 209 }
210 _SC_THREAD_PRIO_INHERIT, 210 else
211 _SC_THREAD_PRIO_PROTECT, 211 {
212 _SC_THREAD_PROCESS_SHARED, 212 if (a > amax)
213 _SC_NPROCESSORS_CONF,
214 _SC_NPROCESSORS_ONLN,
215 _SC_PHYS_PAGES,
216 _SC_AVPHYS_PAGES,
217 _SC_ATEXIT_MAX,
218 _SC_PASS_MAX,
219 _SC_XOPEN_VERSION,
220 _SC_XOPEN_XCU_VERSION,
221 _SC_XOPEN_UNIX,
222 _SC_XOPEN_CRYPT,
223 _SC_XOPEN_ENH_I18N,
224 _SC_XOPEN_SHM,
225 _SC_2_CHAR_TERM,
226 _SC_2_C_VERSION,
227 _SC_2_UPE,
228 _SC_XOPEN_XPG2,
229 _SC_XOPEN_XPG3,
230 _SC_XOPEN_XPG4,
231 _SC_CHAR_BIT,
232 _SC_CHAR_MAX,
233 _SC_CHAR_MIN,
234 _SC_INT_MAX,
235 _SC_INT_MIN,
236 _SC_LONG_BIT,
237 _SC_WORD_BIT,
238 _SC_MB_LEN_MAX,
239 _SC_NZERO,
240 _SC_SSIZE_MAX,
241 _SC_SCHAR_MAX,
242 _SC_SCHAR_MIN,
243 _SC_SHRT_MAX,
244 _SC_SHRT_MIN,
245 _SC_UCHAR_MAX,
246 _SC_UINT_MAX,
247 _SC_ULONG_MAX,
248 _SC_USHRT_MAX,
249 _SC_NL_ARGMAX,
250 _SC_NL_LANGMAX,
251 _SC_NL_MSGMAX,
252 _SC_NL_NMAX,
253 _SC_NL_SETMAX,
254 _SC_NL_TEXTMAX,
255 _SC_XBS5_ILP32_OFF32,
256 _SC_XBS5_ILP32_OFFBIG,
257 _SC_XBS5_LP64_OFF64,
258 _SC_XBS5_LPBIG_OFFBIG,
259 _SC_XOPEN_LEGACY,
260 _SC_XOPEN_REALTIME,
261 _SC_XOPEN_REALTIME_THREADS,
262 _SC_ADVISORY_INFO,
263 _SC_BARRIERS,
264 _SC_BASE,
265 _SC_C_LANG_SUPPORT,
266 _SC_C_LANG_SUPPORT_R,
267 _SC_CLOCK_SELECTION,
268 _SC_CPUTIME,
269 _SC_THREAD_CPUTIME,
270 _SC_DEVICE_IO,
271 _SC_DEVICE_SPECIFIC,
272 _SC_DEVICE_SPECIFIC_R,
273 _SC_FD_MGMT,
274 _SC_FIFO,
275 _SC_PIPE,
276 _SC_FILE_ATTRIBUTES,
277 _SC_FILE_LOCKING,
278 _SC_FILE_SYSTEM,
279 _SC_MONOTONIC_CLOCK,
280 _SC_MULTI_PROCESS,
281 _SC_SINGLE_PROCESS,
282 _SC_NETWORKING,
283 _SC_READER_WRITER_LOCKS,
284 _SC_SPIN_LOCKS,
285 _SC_REGEXP,
286 _SC_REGEX_VERSION,
287 _SC_SHELL,
288 _SC_SIGNALS,
289 _SC_SPAWN,
290 _SC_SPORADIC_SERVER,
291 _SC_THREAD_SPORADIC_SERVER,
292 _SC_SYSTEM_DATABASE,
293 _SC_SYSTEM_DATABASE_R,
294 _SC_TIMEOUTS,
295 _SC_TYPED_MEMORY_OBJECTS,
296 _SC_USER_GROUPS,
297 _SC_USER_GROUPS_R,
298 _SC_2_PBS,
299 _SC_2_PBS_ACCOUNTING,
300 _SC_2_PBS_LOCATE,
301 _SC_2_PBS_MESSAGE,
302 _SC_2_PBS_TRACK,
303 _SC_SYMLOOP_MAX,
304 _SC_STREAMS,
305 _SC_2_PBS_CHECKPOINT,
306 _SC_V6_ILP32_OFF32,
307 _SC_V6_ILP32_OFFBIG,
308 _SC_V6_LP64_OFF64,
309 _SC_V6_LPBIG_OFFBIG,
310 _SC_HOST_NAME_MAX,
311 _SC_TRACE,
312 _SC_TRACE_EVENT_FILTER,
313 _SC_TRACE_INHERIT,
314 _SC_TRACE_LOG,
315 _SC_LEVEL1_ICACHE_SIZE,
316 _SC_LEVEL1_ICACHE_ASSOC,
317 _SC_LEVEL1_ICACHE_LINESIZE,
318 _SC_LEVEL1_DCACHE_SIZE,
319 _SC_LEVEL1_DCACHE_ASSOC,
320 _SC_LEVEL1_DCACHE_LINESIZE,
321 _SC_LEVEL2_CACHE_SIZE,
322 _SC_LEVEL2_CACHE_ASSOC,
323 _SC_LEVEL2_CACHE_LINESIZE,
324 _SC_LEVEL3_CACHE_SIZE,
325 _SC_LEVEL3_CACHE_ASSOC,
326 _SC_LEVEL3_CACHE_LINESIZE,
327 _SC_LEVEL4_CACHE_SIZE,
328 _SC_LEVEL4_CACHE_ASSOC,
329 _SC_LEVEL4_CACHE_LINESIZE,
330 _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
331 _SC_RAW_SOCKETS,
332 _SC_V7_ILP32_OFF32,
333 _SC_V7_ILP32_OFFBIG,
334 _SC_V7_LP64_OFF64,
335 _SC_V7_LPBIG_OFFBIG,
336 _SC_SS_REPL_MAX,
337 _SC_TRACE_EVENT_NAME_MAX,
338 _SC_TRACE_NAME_MAX,
339 _SC_TRACE_SYS_MAX,
340 _SC_TRACE_USER_EVENT_MAX,
341 _SC_XOPEN_STREAMS,
342 _SC_THREAD_ROBUST_PRIO_INHERIT,
343 _SC_THREAD_ROBUST_PRIO_PROTECT
344 };
345 enum
346 {
347 _CS_PATH,
348 _CS_V6_WIDTH_RESTRICTED_ENVS,
349 _CS_GNU_LIBC_VERSION,
350 _CS_GNU_LIBPTHREAD_VERSION,
351 _CS_V5_WIDTH_RESTRICTED_ENVS,
352 _CS_V7_WIDTH_RESTRICTED_ENVS,
353 _CS_LFS_CFLAGS = 1000,
354 _CS_LFS_LDFLAGS,
355 _CS_LFS_LIBS,
356 _CS_LFS_LINTFLAGS,
357 _CS_LFS64_CFLAGS,
358 _CS_LFS64_LDFLAGS,
359 _CS_LFS64_LIBS,
360 _CS_LFS64_LINTFLAGS,
361 _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
362 _CS_XBS5_ILP32_OFF32_LDFLAGS,
363 _CS_XBS5_ILP32_OFF32_LIBS,
364 _CS_XBS5_ILP32_OFF32_LINTFLAGS,
365 _CS_XBS5_ILP32_OFFBIG_CFLAGS,
366 _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
367 _CS_XBS5_ILP32_OFFBIG_LIBS,
368 _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
369 _CS_XBS5_LP64_OFF64_CFLAGS,
370 _CS_XBS5_LP64_OFF64_LDFLAGS,
371 _CS_XBS5_LP64_OFF64_LIBS,
372 _CS_XBS5_LP64_OFF64_LINTFLAGS,
373 _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
374 _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
375 _CS_XBS5_LPBIG_OFFBIG_LIBS,
376 _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
377 _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
378 _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
379 _CS_POSIX_V6_ILP32_OFF32_LIBS,
380 _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
381 _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
382 _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
383 _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
384 _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
385 _CS_POSIX_V6_LP64_OFF64_CFLAGS,
386 _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
387 _CS_POSIX_V6_LP64_OFF64_LIBS,
388 _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
389 _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
390 _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
391 _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
392 _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
393 _CS_POSIX_V7_ILP32_OFF32_CFLAGS,
394 _CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
395 _CS_POSIX_V7_ILP32_OFF32_LIBS,
396 _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
397 _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
398 _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
399 _CS_POSIX_V7_ILP32_OFFBIG_LIBS,
400 _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
401 _CS_POSIX_V7_LP64_OFF64_CFLAGS,
402 _CS_POSIX_V7_LP64_OFF64_LDFLAGS,
403 _CS_POSIX_V7_LP64_OFF64_LIBS,
404 _CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
405 _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
406 _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
407 _CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
408 _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
409 _CS_V6_ENV,
410 _CS_V7_ENV
411 };
412 extern long int pathconf(__const char *__path, int __name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
413 extern long int fpathconf(int __fd, int __name) __attribute__((__nothrow__, __leaf__));
414 extern long int sysconf(int __name) __attribute__((__nothrow__, __leaf__));
415 extern size_t confstr(int __name, char *__buf, size_t __len) __attribute__((__nothrow__, __leaf__));
416 extern __pid_t getpid(void) __attribute__((__nothrow__, __leaf__));
417 extern __pid_t getppid(void) __attribute__((__nothrow__, __leaf__));
418 extern __pid_t getpgrp(void) __attribute__((__nothrow__, __leaf__));
419 extern __pid_t __getpgid(__pid_t __pid) __attribute__((__nothrow__, __leaf__));
420 extern __pid_t getpgid(__pid_t __pid) __attribute__((__nothrow__, __leaf__));
421 extern int setpgid(__pid_t __pid, __pid_t __pgid) __attribute__((__nothrow__, __leaf__));
422 extern int setpgrp(void) __attribute__((__nothrow__, __leaf__));
423 extern __pid_t setsid(void) __attribute__((__nothrow__, __leaf__));
424 extern __pid_t getsid(__pid_t __pid) __attribute__((__nothrow__, __leaf__));
425 extern __uid_t getuid(void) __attribute__((__nothrow__, __leaf__));
426 extern __uid_t geteuid(void) __attribute__((__nothrow__, __leaf__));
427 extern __gid_t getgid(void) __attribute__((__nothrow__, __leaf__));
428 extern __gid_t getegid(void) __attribute__((__nothrow__, __leaf__));
429 extern int getgroups(int __size, __gid_t __list[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
430 extern int setuid(__uid_t __uid) __attribute__((__nothrow__, __leaf__));
431 extern int setreuid(__uid_t __ruid, __uid_t __euid) __attribute__((__nothrow__, __leaf__));
432 extern int seteuid(__uid_t __uid) __attribute__((__nothrow__, __leaf__));
433 extern int setgid(__gid_t __gid) __attribute__((__nothrow__, __leaf__));
434 extern int setregid(__gid_t __rgid, __gid_t __egid) __attribute__((__nothrow__, __leaf__));
435 extern int setegid(__gid_t __gid) __attribute__((__nothrow__, __leaf__));
436 extern __pid_t fork(void) __attribute__((__nothrow__));
437 extern __pid_t vfork(void) __attribute__((__nothrow__, __leaf__));
438 extern char *ttyname(int __fd) __attribute__((__nothrow__, __leaf__));
439 extern int ttyname_r(int __fd, char *__buf, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warn_unused_result__));
440 extern int isatty(int __fd) __attribute__((__nothrow__, __leaf__));
441 extern int ttyslot(void) __attribute__((__nothrow__, __leaf__));
442 extern int link(__const char *__from, __const char *__to) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__));
443 extern int linkat(int __fromfd, __const char *__from, int __tofd, __const char *__to, int __flags) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 4))) __attribute__((__warn_unused_result__));
444 extern int symlink(__const char *__from, __const char *__to) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__));
445 extern ssize_t readlink(__const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__));
446 extern int symlinkat(__const char *__from, int __tofd, __const char *__to) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 3))) __attribute__((__warn_unused_result__));
447 extern ssize_t readlinkat(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__));
448 extern int unlink(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
449 extern int unlinkat(int __fd, __const char *__name, int __flag) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
450 extern int rmdir(__const char *__path) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
451 extern __pid_t tcgetpgrp(int __fd) __attribute__((__nothrow__, __leaf__));
452 extern int tcsetpgrp(int __fd, __pid_t __pgrp_id) __attribute__((__nothrow__, __leaf__));
453 extern char *getlogin(void);
454 extern int getlogin_r(char *__name, size_t __name_len) __attribute__((__nonnull__(1)));
455 extern int setlogin(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
456 extern char *optarg;
457 extern int optind;
458 extern int opterr;
459 extern int optopt;
460 extern int getopt(int ___argc, char *const *___argv, const char *__shortopts) __attribute__((__nothrow__, __leaf__));
461 extern int gethostname(char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
462 extern int sethostname(__const char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
463 extern int sethostid(long int __id) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
464 extern int getdomainname(char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
465 extern int setdomainname(__const char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
466 extern int vhangup(void) __attribute__((__nothrow__, __leaf__));
467 extern int revoke(__const char *__file) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
468 extern int profil(unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
469 extern int acct(__const char *__name) __attribute__((__nothrow__, __leaf__));
470 extern char *getusershell(void) __attribute__((__nothrow__, __leaf__));
471 extern void endusershell(void) __attribute__((__nothrow__, __leaf__));
472 extern void setusershell(void) __attribute__((__nothrow__, __leaf__));
473 extern int daemon(int __nochdir, int __noclose) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
474 extern int chroot(__const char *__path) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
475 extern char *getpass(__const char *__prompt) __attribute__((__nonnull__(1)));
476 extern int fsync(int __fd);
477 extern long int gethostid(void);
478 extern void sync(void) __attribute__((__nothrow__, __leaf__));
479 extern int getpagesize(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
480 extern int getdtablesize(void) __attribute__((__nothrow__, __leaf__));
481 extern int truncate(__const char *__file, __off_t __length) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
482 extern int ftruncate(int __fd, __off_t __length) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
483 extern int brk(void *__addr) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
484 extern void *sbrk(intptr_t __delta) __attribute__((__nothrow__, __leaf__));
485 extern long int syscall(long int __sysno, ...) __attribute__((__nothrow__, __leaf__));
486 extern int lockf(int __fd, int __cmd, __off_t __len) __attribute__((__warn_unused_result__));
487 extern int fdatasync(int __fildes);
488 extern char *ctermid(char *__s) __attribute__((__nothrow__, __leaf__));
489 extern ssize_t __read_chk(int __fd, void *__buf, size_t __nbytes, size_t __buflen) __attribute__((__warn_unused_result__));
490 extern ssize_t __read_alias(int __fd, void *__buf, size_t __nbytes) __asm__ ("""read") __attribute__((__warn_unused_result__));
491 extern ssize_t __read_chk_warn(int __fd, void *__buf, size_t __nbytes, size_t __buflen) __asm__ ("""__read_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("read called with bigger length than size of ""the destination buffer")));
492 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) ssize_t read(int __fd, void *__buf, size_t __nbytes)
493 {
494 if (__builtin_object_size(__buf, 0) != (size_t) - 1)
495 {
496 if (!__builtin_constant_p(__nbytes))
497 return __read_chk(__fd, __buf, __nbytes, __builtin_object_size(__buf, 0));
498 if (__nbytes > __builtin_object_size(__buf, 0))
499 return __read_chk_warn(__fd, __buf, __nbytes, __builtin_object_size(__buf, 0));
500 }
501 return __read_alias(__fd, __buf, __nbytes);
502 }
503 extern ssize_t __readlink_chk(__const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__));
504 extern ssize_t __readlink_alias(__const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("""readlink") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__));
505 extern ssize_t __readlink_chk_warn(__const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("""__readlink_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("readlink called with bigger length ""than size of destination buffer")));
506 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)) ssize_t __attribute__((__nothrow__, __leaf__)) readlink(__const char *__restrict __path, char *__restrict __buf, size_t __len)
507 {
508 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
509 {
510 if (!__builtin_constant_p(__len))
511 return __readlink_chk(__path, __buf, __len, __builtin_object_size(__buf, 2 > 1));
512 if (__len > __builtin_object_size(__buf, 2 > 1))
513 return __readlink_chk_warn(__path, __buf, __len, __builtin_object_size(__buf, 2 > 1));
514 }
515 return __readlink_alias(__path, __buf, __len);
516 }
517 extern ssize_t __readlinkat_chk(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__));
518 extern ssize_t __readlinkat_alias(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("""readlinkat") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__));
519 extern ssize_t __readlinkat_chk_warn(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("""__readlinkat_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("readlinkat called with bigger ""length than size of destination ""buffer")));
520 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)) ssize_t __attribute__((__nothrow__, __leaf__)) readlinkat(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len)
521 {
522 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
523 {
524 if (!__builtin_constant_p(__len))
525 return __readlinkat_chk(__fd, __path, __buf, __len, __builtin_object_size(__buf, 2 > 1));
526 if (__len > __builtin_object_size(__buf, 2 > 1))
527 return __readlinkat_chk_warn(__fd, __path, __buf, __len, __builtin_object_size(__buf, 2 > 1));
528 }
529 return __readlinkat_alias(__fd, __path, __buf, __len);
530 }
531 extern char *__getcwd_chk(char *__buf, size_t __size, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
532 extern char *__getcwd_alias(char *__buf, size_t __size) __asm__ ("""getcwd") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
533 extern char *__getcwd_chk_warn(char *__buf, size_t __size, size_t __buflen) __asm__ ("""__getcwd_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)) __attribute__((__warning__("getcwd caller with bigger length than size of ""destination buffer")));
534 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *__attribute__((__nothrow__, __leaf__)) getcwd(char *__buf, size_t __size)
535 {
536 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
537 {
538 if (!__builtin_constant_p(__size))
539 return __getcwd_chk(__buf, __size, __builtin_object_size(__buf, 2 > 1));
540 if (__size > __builtin_object_size(__buf, 2 > 1))
541 return __getcwd_chk_warn(__buf, __size, __builtin_object_size(__buf, 2 > 1));
542 }
543 return __getcwd_alias(__buf, __size);
544 }
545 extern char *__getwd_chk(char *__buf, size_t buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
546 extern char *__getwd_warn(char *__buf) __asm__ ("""getwd") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("please use getcwd instead, as getwd ""doesn't specify buffer size")));
547 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__nonnull__(1))) __attribute__((__deprecated__)) __attribute__((__warn_unused_result__)) char *__attribute__((__nothrow__, __leaf__)) getwd(char *__buf)
548 {
549 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
550 return __getwd_chk(__buf, __builtin_object_size(__buf, 2 > 1));
551 return __getwd_warn(__buf);
552 }
553 extern size_t __confstr_chk(int __name, char *__buf, size_t __len, size_t __buflen) __attribute__((__nothrow__, __leaf__));
554 extern size_t __confstr_alias(int __name, char *__buf, size_t __len) __asm__ ("""confstr") __attribute__((__nothrow__, __leaf__));
555 extern size_t __confstr_chk_warn(int __name, char *__buf, size_t __len, size_t __buflen) __asm__ ("""__confstr_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warning__("confstr called with bigger length than size of destination ""buffer")));
556 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) size_t __attribute__((__nothrow__, __leaf__)) confstr(int __name, char *__buf, size_t __len)
557 {
558 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
559 {
560 if (!__builtin_constant_p(__len))
561 return __confstr_chk(__name, __buf, __len, __builtin_object_size(__buf, 2 > 1));
562 if (__builtin_object_size(__buf, 2 > 1) < __len)
563 return __confstr_chk_warn(__name, __buf, __len, __builtin_object_size(__buf, 2 > 1));
564 }
565 return __confstr_alias(__name, __buf, __len);
566 }
567 extern int __getgroups_chk(int __size, __gid_t __list[], size_t __listlen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
568 extern int __getgroups_alias(int __size, __gid_t __list[]) __asm__ ("""getgroups") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
569 extern int __getgroups_chk_warn(int __size, __gid_t __list[], size_t __listlen) __asm__ ("""__getgroups_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)) __attribute__((__warning__("getgroups called with bigger group count than what ""can fit into destination buffer")));
570 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) getgroups(int __size, __gid_t __list[])
571 {
572 if (__builtin_object_size(__list, 2 > 1) != (size_t) - 1)
573 {
574 if (!__builtin_constant_p(__size) || __size < 0)
575 return __getgroups_chk(__size, __list, __builtin_object_size(__list, 2 > 1));
576 if (__size * sizeof(__gid_t) > __builtin_object_size(__list, 2 > 1))
577 return __getgroups_chk_warn(__size, __list, __builtin_object_size(__list, 2 > 1));
578 }
579 return __getgroups_alias(__size, __list);
580 }
581 extern int __ttyname_r_chk(int __fd, char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
582 extern int __ttyname_r_alias(int __fd, char *__buf, size_t __buflen) __asm__ ("""ttyname_r") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
583 extern int __ttyname_r_chk_warn(int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__ttyname_r_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warning__("ttyname_r called with bigger buflen than ""size of destination buffer")));
584 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) ttyname_r(int __fd, char *__buf, size_t __buflen)
585 {
586 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
587 {
588 if (!__builtin_constant_p(__buflen))
589 return __ttyname_r_chk(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1));
590 if (__buflen > __builtin_object_size(__buf, 2 > 1))
591 return __ttyname_r_chk_warn(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1));
592 }
593 return __ttyname_r_alias(__fd, __buf, __buflen);
594 }
595 extern int __getlogin_r_chk(char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nonnull__(1)));
596 extern int __getlogin_r_alias(char *__buf, size_t __buflen) __asm__ ("""getlogin_r") __attribute__((__nonnull__(1)));
597 extern int __getlogin_r_chk_warn(char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__getlogin_r_chk") __attribute__((__nonnull__(1))) __attribute__((__warning__("getlogin_r called with bigger buflen than ""size of destination buffer")));
598 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int getlogin_r(char *__buf, size_t __buflen)
599 {
600 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
601 {
602 if (!__builtin_constant_p(__buflen))
603 return __getlogin_r_chk(__buf, __buflen, __builtin_object_size(__buf, 2 > 1));
604 if (__buflen > __builtin_object_size(__buf, 2 > 1))
605 return __getlogin_r_chk_warn(__buf, __buflen, __builtin_object_size(__buf, 2 > 1));
606 }
607 return __getlogin_r_alias(__buf, __buflen);
608 }
609 extern int __gethostname_chk(char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
610 extern int __gethostname_alias(char *__buf, size_t __buflen) __asm__ ("""gethostname") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
611 extern int __gethostname_chk_warn(char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__gethostname_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warning__("gethostname called with bigger buflen than ""size of destination buffer")));
612 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) gethostname(char *__buf, size_t __buflen)
613 {
614 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
615 {
616 if (!__builtin_constant_p(__buflen))
617 return __gethostname_chk(__buf, __buflen, __builtin_object_size(__buf, 2 > 1));
618 if (__buflen > __builtin_object_size(__buf, 2 > 1))
619 return __gethostname_chk_warn(__buf, __buflen, __builtin_object_size(__buf, 2 > 1));
620 }
621 return __gethostname_alias(__buf, __buflen);
622 }
623 extern int __getdomainname_chk(char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
624 extern int __getdomainname_alias(char *__buf, size_t __buflen) __asm__ ("""getdomainname") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
625 extern int __getdomainname_chk_warn(char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__getdomainname_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("getdomainname called with bigger ""buflen than size of destination ""buffer")));
626 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) getdomainname(char *__buf, size_t __buflen)
627 {
628 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
629 {
630 if (!__builtin_constant_p(__buflen))
631 return __getdomainname_chk(__buf, __buflen, __builtin_object_size(__buf, 2 > 1));
632 if (__buflen > __builtin_object_size(__buf, 2 > 1))
633 return __getdomainname_chk_warn(__buf, __buflen, __builtin_object_size(__buf, 2 > 1));
634 }
635 return __getdomainname_alias(__buf, __buflen);
636 }
637 struct _IO_FILE;
638 typedef struct _IO_FILE FILE;
639 typedef struct _IO_FILE __FILE;
640 typedef struct
641 {
642 int __count;
643 union
644 { 213 {
645 unsigned int __wch; 214 return amax;
646 char __wchb[4]; 215 }
647 } __value; 216 else
648 } __mbstate_t;
649 typedef struct
650 {
651 __off_t __pos;
652 __mbstate_t __state;
653 } _G_fpos_t;
654 typedef struct
655 {
656 __off64_t __pos;
657 __mbstate_t __state;
658 } _G_fpos64_t;
659 typedef int _G_int16_t __attribute__((__mode__(__HI__)));
660 typedef int _G_int32_t __attribute__((__mode__(__SI__)));
661 typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__)));
662 typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__)));
663 typedef __builtin_va_list __gnuc_va_list;
664 struct _IO_jump_t;
665 struct _IO_FILE;
666 typedef void _IO_lock_t;
667 struct _IO_marker
668 {
669 struct _IO_marker *_next;
670 struct _IO_FILE *_sbuf;
671 int _pos;
672 };
673 enum __codecvt_result
674 {
675 __codecvt_ok,
676 __codecvt_partial,
677 __codecvt_error,
678 __codecvt_noconv
679 };
680 struct _IO_FILE
681 {
682 int _flags;
683 char *_IO_read_ptr;
684 char *_IO_read_end;
685 char *_IO_read_base;
686 char *_IO_write_base;
687 char *_IO_write_ptr;
688 char *_IO_write_end;
689 char *_IO_buf_base;
690 char *_IO_buf_end;
691 char *_IO_save_base;
692 char *_IO_backup_base;
693 char *_IO_save_end;
694 struct _IO_marker *_markers;
695 struct _IO_FILE *_chain;
696 int _fileno;
697 int _flags2;
698 __off_t _old_offset;
699 unsigned short _cur_column;
700 signed char _vtable_offset;
701 char _shortbuf[1];
702 _IO_lock_t *_lock;
703 __off64_t _offset;
704 void *__pad1;
705 void *__pad2;
706 void *__pad3;
707 void *__pad4;
708 size_t __pad5;
709 int _mode;
710 char _unused2[15 * sizeof(int) - 4 * sizeof(void *) - sizeof(size_t)];
711 };
712 typedef struct _IO_FILE _IO_FILE;
713 struct _IO_FILE_plus;
714 extern struct _IO_FILE_plus _IO_2_1_stdin_;
715 extern struct _IO_FILE_plus _IO_2_1_stdout_;
716 extern struct _IO_FILE_plus _IO_2_1_stderr_;
717 typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __nbytes);
718 typedef __ssize_t __io_write_fn(void *__cookie, __const char *__buf, size_t __n);
719 typedef int __io_seek_fn(void *__cookie, __off64_t *__pos, int __w);
720 typedef int __io_close_fn(void *__cookie);
721 extern int __underflow(_IO_FILE *);
722 extern int __uflow(_IO_FILE *);
723 extern int __overflow(_IO_FILE *, int);
724 extern int _IO_getc(_IO_FILE *__fp);
725 extern int _IO_putc(int __c, _IO_FILE *__fp);
726 extern int _IO_feof(_IO_FILE *__fp) __attribute__((__nothrow__, __leaf__));
727 extern int _IO_ferror(_IO_FILE *__fp) __attribute__((__nothrow__, __leaf__));
728 extern int _IO_peekc_locked(_IO_FILE *__fp);
729 extern void _IO_flockfile(_IO_FILE *) __attribute__((__nothrow__, __leaf__));
730 extern void _IO_funlockfile(_IO_FILE *) __attribute__((__nothrow__, __leaf__));
731 extern int _IO_ftrylockfile(_IO_FILE *) __attribute__((__nothrow__, __leaf__));
732 extern int _IO_vfscanf(_IO_FILE *__restrict , const char *__restrict , __gnuc_va_list, int *__restrict );
733 extern int _IO_vfprintf(_IO_FILE *__restrict , const char *__restrict , __gnuc_va_list);
734 extern __ssize_t _IO_padn(_IO_FILE *, int, __ssize_t);
735 extern size_t _IO_sgetn(_IO_FILE *, void *, size_t);
736 extern __off64_t _IO_seekoff(_IO_FILE *, __off64_t, int, int);
737 extern __off64_t _IO_seekpos(_IO_FILE *, __off64_t, int);
738 extern void _IO_free_backup_area(_IO_FILE *) __attribute__((__nothrow__, __leaf__));
739 typedef __gnuc_va_list va_list;
740 typedef _G_fpos_t fpos_t;
741 extern struct _IO_FILE *stdin;
742 extern struct _IO_FILE *stdout;
743 extern struct _IO_FILE *stderr;
744 extern int remove(__const char *__filename) __attribute__((__nothrow__, __leaf__));
745 extern int rename(__const char *__old, __const char *__new) __attribute__((__nothrow__, __leaf__));
746 extern int renameat(int __oldfd, __const char *__old, int __newfd, __const char *__new) __attribute__((__nothrow__, __leaf__));
747 extern FILE *tmpfile(void) __attribute__((__warn_unused_result__));
748 extern char *tmpnam(char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
749 extern char *tmpnam_r(char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
750 extern char *tempnam(__const char *__dir, __const char *__pfx) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
751 extern int fclose(FILE *__stream);
752 extern int fflush(FILE *__stream);
753 extern int fflush_unlocked(FILE *__stream);
754 extern FILE *fopen(__const char *__restrict __filename, __const char *__restrict __modes) __attribute__((__warn_unused_result__));
755 extern FILE *freopen(__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
756 extern FILE *fdopen(int __fd, __const char *__modes) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
757 extern FILE *fmemopen(void *__s, size_t __len, __const char *__modes) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
758 extern FILE *open_memstream(char **__bufloc, size_t *__sizeloc) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
759 extern void setbuf(FILE *__restrict __stream, char *__restrict __buf) __attribute__((__nothrow__, __leaf__));
760 extern int setvbuf(FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__((__nothrow__, __leaf__));
761 extern void setbuffer(FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__((__nothrow__, __leaf__));
762 extern void setlinebuf(FILE *__stream) __attribute__((__nothrow__, __leaf__));
763 extern int fprintf(FILE *__restrict __stream, __const char *__restrict __format, ...);
764 extern int printf(__const char *__restrict __format, ...);
765 extern int sprintf(char *__restrict __s, __const char *__restrict __format, ...) __attribute__((__nothrow__));
766 extern int vfprintf(FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg);
767 extern int vprintf(__const char *__restrict __format, __gnuc_va_list __arg);
768 extern int vsprintf(char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__nothrow__));
769 extern int snprintf(char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__((__nothrow__)) __attribute__((__format__(__printf__, 3, 4)));
770 extern int vsnprintf(char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__nothrow__)) __attribute__((__format__(__printf__, 3, 0)));
771 extern int vdprintf(int __fd, __const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__((__format__(__printf__, 2, 0)));
772 extern int dprintf(int __fd, __const char *__restrict __fmt, ...) __attribute__((__format__(__printf__, 2, 3)));
773 extern int fscanf(FILE *__restrict __stream, __const char *__restrict __format, ...) __attribute__((__warn_unused_result__));
774 extern int scanf(__const char *__restrict __format, ...) __attribute__((__warn_unused_result__));
775 extern int sscanf(__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__((__nothrow__, __leaf__));
776 extern int fscanf(FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("""__isoc99_fscanf") __attribute__((__warn_unused_result__));
777 extern int scanf(__const char *__restrict __format, ...) __asm__ ("""__isoc99_scanf") __attribute__((__warn_unused_result__));
778 extern int sscanf(__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("""__isoc99_sscanf") __attribute__((__nothrow__, __leaf__));
779 extern int vfscanf(FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__format__(__scanf__, 2, 0))) __attribute__((__warn_unused_result__));
780 extern int vscanf(__const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__format__(__scanf__, 1, 0))) __attribute__((__warn_unused_result__));
781 extern int vsscanf(__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__nothrow__, __leaf__)) __attribute__((__format__(__scanf__, 2, 0)));
782 extern int vfscanf(FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("""__isoc99_vfscanf") __attribute__((__format__(__scanf__, 2, 0))) __attribute__((__warn_unused_result__));
783 extern int vscanf(__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("""__isoc99_vscanf") __attribute__((__format__(__scanf__, 1, 0))) __attribute__((__warn_unused_result__));
784 extern int vsscanf(__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("""__isoc99_vsscanf") __attribute__((__nothrow__, __leaf__)) __attribute__((__format__(__scanf__, 2, 0)));
785 extern int fgetc(FILE *__stream);
786 extern int getc(FILE *__stream);
787 extern int getchar(void);
788 extern int getc_unlocked(FILE *__stream);
789 extern int getchar_unlocked(void);
790 extern int fgetc_unlocked(FILE *__stream);
791 extern int fputc(int __c, FILE *__stream);
792 extern int putc(int __c, FILE *__stream);
793 extern int putchar(int __c);
794 extern int fputc_unlocked(int __c, FILE *__stream);
795 extern int putc_unlocked(int __c, FILE *__stream);
796 extern int putchar_unlocked(int __c);
797 extern int getw(FILE *__stream);
798 extern int putw(int __w, FILE *__stream);
799 extern char *fgets(char *__restrict __s, int __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
800 extern char *gets(char *__s) __attribute__((__warn_unused_result__));
801 extern __ssize_t __getdelim(char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
802 extern __ssize_t getdelim(char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
803 extern __ssize_t getline(char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
804 extern int fputs(__const char *__restrict __s, FILE *__restrict __stream);
805 extern int puts(__const char *__s);
806 extern int ungetc(int __c, FILE *__stream);
807 extern size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
808 extern size_t fwrite(__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s);
809 extern size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
810 extern size_t fwrite_unlocked(__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream);
811 extern int fseek(FILE *__stream, long int __off, int __whence);
812 extern long int ftell(FILE *__stream) __attribute__((__warn_unused_result__));
813 extern void rewind(FILE *__stream);
814 extern int fseeko(FILE *__stream, __off_t __off, int __whence);
815 extern __off_t ftello(FILE *__stream) __attribute__((__warn_unused_result__));
816 extern int fgetpos(FILE *__restrict __stream, fpos_t *__restrict __pos);
817 extern int fsetpos(FILE *__stream, __const fpos_t *__pos);
818 extern void clearerr(FILE *__stream) __attribute__((__nothrow__, __leaf__));
819 extern int feof(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
820 extern int ferror(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
821 extern void clearerr_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__));
822 extern int feof_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
823 extern int ferror_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
824 extern void perror(__const char *__s);
825 extern int sys_nerr;
826 extern __const char *__const sys_errlist[];
827 extern int fileno(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
828 extern int fileno_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
829 extern FILE *popen(__const char *__command, __const char *__modes) __attribute__((__warn_unused_result__));
830 extern int pclose(FILE *__stream);
831 extern char *ctermid(char *__s) __attribute__((__nothrow__, __leaf__));
832 extern void flockfile(FILE *__stream) __attribute__((__nothrow__, __leaf__));
833 extern int ftrylockfile(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
834 extern void funlockfile(FILE *__stream) __attribute__((__nothrow__, __leaf__));
835 extern __inline __attribute__((__gnu_inline__)) int getchar(void)
836 {
837 return _IO_getc(stdin);
838 }
839 extern __inline __attribute__((__gnu_inline__)) int fgetc_unlocked(FILE *__fp)
840 {
841 return (__builtin_expect(((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow(__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
842 }
843 extern __inline __attribute__((__gnu_inline__)) int getc_unlocked(FILE *__fp)
844 {
845 return (__builtin_expect(((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow(__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
846 }
847 extern __inline __attribute__((__gnu_inline__)) int getchar_unlocked(void)
848 {
849 return (__builtin_expect(((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow(stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
850 }
851 extern __inline __attribute__((__gnu_inline__)) int putchar(int __c)
852 {
853 return _IO_putc(__c, stdout);
854 }
855 extern __inline __attribute__((__gnu_inline__)) int fputc_unlocked(int __c, FILE *__stream)
856 {
857 return (__builtin_expect(((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow(__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
858 }
859 extern __inline __attribute__((__gnu_inline__)) int putc_unlocked(int __c, FILE *__stream)
860 {
861 return (__builtin_expect(((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow(__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
862 }
863 extern __inline __attribute__((__gnu_inline__)) int putchar_unlocked(int __c)
864 {
865 return (__builtin_expect(((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow(stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
866 }
867 extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) feof_unlocked(FILE *__stream)
868 {
869 return (((__stream)->_flags & 0x10) != 0);
870 }
871 extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) ferror_unlocked(FILE *__stream)
872 {
873 return (((__stream)->_flags & 0x20) != 0);
874 }
875 extern int __sprintf_chk(char *__restrict __s, int __flag, size_t __slen, __const char *__restrict __format, ...) __attribute__((__nothrow__, __leaf__));
876 extern int __vsprintf_chk(char *__restrict __s, int __flag, size_t __slen, __const char *__restrict __format, __gnuc_va_list __ap) __attribute__((__nothrow__, __leaf__));
877 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) sprintf(char *__restrict __s, __const char *__restrict __fmt, ...)
878 {
879 return __builtin___sprintf_chk(__s, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __builtin_va_arg_pack());
880 }
881 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) vsprintf(char *__restrict __s, __const char *__restrict __fmt, __gnuc_va_list __ap)
882 {
883 return __builtin___vsprintf_chk(__s, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __ap);
884 }
885 extern int __snprintf_chk(char *__restrict __s, size_t __n, int __flag, size_t __slen, __const char *__restrict __format, ...) __attribute__((__nothrow__, __leaf__));
886 extern int __vsnprintf_chk(char *__restrict __s, size_t __n, int __flag, size_t __slen, __const char *__restrict __format, __gnuc_va_list __ap) __attribute__((__nothrow__, __leaf__));
887 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) snprintf(char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...)
888 {
889 return __builtin___snprintf_chk(__s, __n, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __builtin_va_arg_pack());
890 }
891 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) vsnprintf(char *__restrict __s, size_t __n, __const char *__restrict __fmt, __gnuc_va_list __ap)
892 {
893 return __builtin___vsnprintf_chk(__s, __n, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __ap);
894 }
895 extern int __fprintf_chk(FILE *__restrict __stream, int __flag, __const char *__restrict __format, ...);
896 extern int __printf_chk(int __flag, __const char *__restrict __format, ...);
897 extern int __vfprintf_chk(FILE *__restrict __stream, int __flag, __const char *__restrict __format, __gnuc_va_list __ap);
898 extern int __vprintf_chk(int __flag, __const char *__restrict __format, __gnuc_va_list __ap);
899 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int fprintf(FILE *__restrict __stream, __const char *__restrict __fmt, ...)
900 {
901 return __fprintf_chk(__stream, 2 - 1, __fmt, __builtin_va_arg_pack());
902 }
903 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int printf(__const char *__restrict __fmt, ...)
904 {
905 return __printf_chk(2 - 1, __fmt, __builtin_va_arg_pack());
906 }
907 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int vprintf(__const char *__restrict __fmt, __gnuc_va_list __ap)
908 {
909 return __vfprintf_chk(stdout, 2 - 1, __fmt, __ap);
910 }
911 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int vfprintf(FILE *__restrict __stream, __const char *__restrict __fmt, __gnuc_va_list __ap)
912 {
913 return __vfprintf_chk(__stream, 2 - 1, __fmt, __ap);
914 }
915 extern char *__gets_chk(char *__str, size_t) __attribute__((__warn_unused_result__));
916 extern char *__gets_warn(char *__str) __asm__ ("""gets") __attribute__((__warn_unused_result__)) __attribute__((__warning__("please use fgets or getline instead, gets can't ""specify buffer size")));
917 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *gets(char *__str)
918 {
919 if (__builtin_object_size(__str, 2 > 1) != (size_t) - 1)
920 return __gets_chk(__str, __builtin_object_size(__str, 2 > 1));
921 return __gets_warn(__str);
922 }
923 extern char *__fgets_chk(char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
924 extern char *__fgets_alias(char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("""fgets") __attribute__((__warn_unused_result__));
925 extern char *__fgets_chk_warn(char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("""__fgets_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("fgets called with bigger size than length ""of destination buffer")));
926 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *fgets(char *__restrict __s, int __n, FILE *__restrict __stream)
927 {
928 if (__builtin_object_size(__s, 2 > 1) != (size_t) - 1)
929 {
930 if (!__builtin_constant_p(__n) || __n <= 0)
931 return __fgets_chk(__s, __builtin_object_size(__s, 2 > 1), __n, __stream);
932 if ((size_t) __n > __builtin_object_size(__s, 2 > 1))
933 return __fgets_chk_warn(__s, __builtin_object_size(__s, 2 > 1), __n, __stream);
934 }
935 return __fgets_alias(__s, __n, __stream);
936 }
937 extern size_t __fread_chk(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
938 extern size_t __fread_alias(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""fread") __attribute__((__warn_unused_result__));
939 extern size_t __fread_chk_warn(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""__fread_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("fread called with bigger size * nmemb than length ""of destination buffer")));
940 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream)
941 {
942 if (__builtin_object_size(__ptr, 0) != (size_t) - 1)
943 {
944 if (!__builtin_constant_p(__size) || !__builtin_constant_p(__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof(size_t) / 2)))
945 return __fread_chk(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream);
946 if (__size * __n > __builtin_object_size(__ptr, 0))
947 return __fread_chk_warn(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream);
948 }
949 return __fread_alias(__ptr, __size, __n, __stream);
950 }
951 extern size_t __fread_unlocked_chk(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__));
952 extern size_t __fread_unlocked_alias(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""fread_unlocked") __attribute__((__warn_unused_result__));
953 extern size_t __fread_unlocked_chk_warn(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""__fread_unlocked_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("fread_unlocked called with bigger size * nmemb than ""length of destination buffer")));
954 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream)
955 {
956 if (__builtin_object_size(__ptr, 0) != (size_t) - 1)
957 {
958 if (!__builtin_constant_p(__size) || !__builtin_constant_p(__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof(size_t) / 2)))
959 return __fread_unlocked_chk(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream);
960 if (__size * __n > __builtin_object_size(__ptr, 0))
961 return __fread_unlocked_chk_warn(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream);
962 }
963 if (__builtin_constant_p(__size) && __builtin_constant_p(__n) && (__size | __n) < (((size_t) 1) << (8 * sizeof(size_t) / 2)) && __size * __n <= 8)
964 {
965 size_t __cnt = __size * __n;
966 char *__cptr = (char *) __ptr;
967 if (__cnt == 0)
968 return 0;
969 for (;
970 __cnt > 0;
971 --__cnt)
972 { 217 {
973 int __c = (__builtin_expect(((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow(__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++); 218 return a;
974 if (__c == (- 1))
975 break;
976 *__cptr++ = __c;
977 } 219 }
978 return (__cptr - (char *) __ptr) / __size; 220 }
979 } 221 }
980 return __fread_unlocked_alias(__ptr, __size, __n, __stream); 222 static __inline __attribute__((const)) uint8_t av_clip_uint8(int a)
981 } 223 {
982 typedef signed char int8_t; 224 if (a & ~255)
225 {
226 return -a >> 31;
227 }
228 else
229 {
230 return a;
231 }
232 }
233 static __inline __attribute__((const)) uint16_t av_clip_uint16(int a)
234 {
235 if (a & ~65535)
236 {
237 return -a >> 31;
238 }
239 else
240 {
241 return a;
242 }
243 }
983 typedef short int int16_t; 244 typedef short int int16_t;
245 static __inline __attribute__((const)) int16_t av_clip_int16(int a)
246 {
247 if ((a + 32768) & ~65535)
248 {
249 return a >> 31 ^ 32767;
250 }
251 else
252 {
253 return a;
254 }
255 }
984 typedef int int32_t; 256 typedef int int32_t;
985 typedef long int int64_t; 257 typedef long int int64_t;
986 typedef unsigned char uint8_t; 258 static __inline __attribute__((const)) int32_t av_clipl_int32(int64_t a)
987 typedef unsigned short int uint16_t; 259 {
988 typedef unsigned int uint32_t; 260 if ((a + 2147483648U) & ~4294967295LU)
989 typedef unsigned long int uint64_t; 261 {
990 typedef signed char int_least8_t; 262 return a >> 63 ^ 2147483647;
991 typedef short int int_least16_t; 263 }
992 typedef int int_least32_t; 264 else
993 typedef long int int_least64_t; 265 {
994 typedef unsigned char uint_least8_t; 266 return a;
995 typedef unsigned short int uint_least16_t; 267 }
996 typedef unsigned int uint_least32_t; 268 }
997 typedef unsigned long int uint_least64_t; 269 static __inline __attribute__((const)) float av_clipf(float a, float amin, float amax)
998 typedef signed char int_fast8_t; 270 {
999 typedef long int int_fast16_t; 271 if (a < amin)
1000 typedef long int int_fast32_t; 272 {
1001 typedef long int int_fast64_t; 273 return amin;
1002 typedef unsigned char uint_fast8_t; 274 }
1003 typedef unsigned long int uint_fast16_t; 275 else
1004 typedef unsigned long int uint_fast32_t; 276 {
1005 typedef unsigned long int uint_fast64_t; 277 if (a > amax)
1006 typedef unsigned long int uintptr_t;
1007 typedef long int intmax_t;
1008 typedef unsigned long int uintmax_t;
1009 typedef long int ptrdiff_t;
1010 typedef int wchar_t;
1011 typedef struct
1012 {
1013 void **address;
1014 ptrdiff_t offset;
1015 struct
1016 { 278 {
1017 _Bool input : 1; 279 return amax;
1018 _Bool output : 1; 280 }
1019 _Bool can_rename : 1; 281 else
1020 _Bool commutative : 1;
1021 } flags;
1022 size_t size;
1023 } nanos_dependence_internal_t;
1024 typedef enum
1025 {
1026 NANOS_PRIVATE,
1027 NANOS_SHARED
1028 } nanos_sharing_t;
1029 typedef struct
1030 {
1031 void *original;
1032 void *privates;
1033 void (*bop)(void *, void *);
1034 void (*vop)(int n, void *, void *);
1035 void (*cleanup)(void *);
1036 } nanos_reduction_t;
1037 typedef struct
1038 {
1039 uint64_t address;
1040 nanos_sharing_t sharing;
1041 struct
1042 { 282 {
1043 _Bool input : 1; 283 return a;
1044 _Bool output : 1; 284 }
1045 } flags; 285 }
1046 size_t size; 286 }
1047 } nanos_copy_data_internal_t; 287 static __inline __attribute__((const)) int av_ceil_log2(int x)
1048 typedef nanos_dependence_internal_t nanos_dependence_t; 288 {
1049 typedef nanos_copy_data_internal_t nanos_copy_data_t; 289 return av_log2_c((x - 1) << 1);
1050 typedef void *nanos_thread_t; 290 }
1051 typedef void *nanos_wd_t; 291 static __inline __attribute__((always_inline)) void AV_COPY64(void *d, const void *s)
1052 typedef struct 292 {
1053 { 293 __asm__ ("movq %1, %%mm0 \n\t""movq %%mm0, %0 \n\t" : "=m"(*((uint64_t *)d)) : "m"(*((const uint64_t *)s)) : "mm0");
1054 int nsect; 294 }
1055 nanos_wd_t lwd[]; 295 static __inline __attribute__((always_inline)) void AV_SWAP64(void *a, void *b)
1056 } nanos_compound_wd_data_t; 296 {
1057 typedef struct 297 __asm__ ("movq %1, %%mm0 \n\t""movq %0, %%mm1 \n\t""movq %%mm0, %0 \n\t""movq %%mm1, %1 \n\t" : "+m"(*((uint64_t *)a)), "+m"(*((uint64_t *)b)) : : "mm0", "mm1");
1058 { 298 }
1059 int n; 299 static __inline __attribute__((always_inline)) void AV_ZERO64(void *d)
1060 } nanos_repeat_n_info_t; 300 {
1061 typedef struct 301 __asm__ ("pxor %%mm0, %%mm0 \n\t""movq %%mm0, %0 \n\t" : "=m"(*((uint64_t *)d)) : : "mm0");
1062 { 302 }
1063 int lower; 303 static __inline __attribute__((always_inline)) void AV_COPY128(void *d, const void *s)
1064 int upper; 304 {
1065 int step; 305 struct v;
1066 _Bool last; 306 struct v
1067 int chunk; 307 {
1068 int stride; 308 uint64_t v[2];
1069 int thid; 309 };
1070 void *args; 310 __asm__ ("movaps %1, %%xmm0 \n\t""movaps %%xmm0, %0 \n\t" : "=m"(*((struct v *)d)) : "m"(*((const struct v *)s)) : "xmm0");
1071 } nanos_loop_info_t; 311 }
1072 typedef void *nanos_ws_t; 312 static __inline __attribute__((always_inline)) void AV_ZERO128(void *d)
1073 typedef void *nanos_ws_info_t; 313 {
1074 typedef void *nanos_ws_data_t; 314 struct v;
1075 typedef void *nanos_ws_item_t; 315 struct v
1076 typedef struct 316 {
1077 { 317 uint64_t v[2];
1078 int lower_bound; 318 };
1079 int upper_bound; 319 __asm__ ("pxor %%xmm0, %%xmm0 \n\t""movdqa %%xmm0, %0 \n\t" : "=m"(*((struct v *)d)) : : "xmm0");
1080 int loop_step; 320 }
1081 int chunk_size; 321 static __inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
1082 } nanos_ws_info_loop_t; 322 {
1083 typedef struct 323 return (a | b) - (((a ^ b) & ~(1 * 16843009LU)) >> 1);
1084 { 324 }
1085 int lower; 325 static __inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
1086 int upper; 326 {
1087 _Bool execute : 1; 327 return (a & b) + (((a ^ b) & ~(1 * 16843009LU)) >> 1);
1088 _Bool last : 1; 328 }
1089 } nanos_ws_item_loop_t; 329 static __inline void emms(void)
1090 typedef struct nanos_ws_desc 330 {
1091 { 331 __asm__ volatile("emms;" : : : "memory");
1092 volatile nanos_ws_t ws; 332 }
1093 nanos_ws_data_t data; 333 static __inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
1094 struct nanos_ws_desc *next; 334 {
1095 nanos_thread_t *threads; 335 int i;
1096 int nths; 336 for (i = 0; i < h; i++)
1097 } nanos_ws_desc_t; 337 {
1098 typedef struct 338 {
1099 { 339 do
1100 _Bool mandatory_creation : 1; 340 {
1101 _Bool tied : 1;
1102 _Bool reserved0 : 1;
1103 _Bool reserved1 : 1;
1104 _Bool reserved2 : 1;
1105 _Bool reserved3 : 1;
1106 _Bool reserved4 : 1;
1107 _Bool reserved5 : 1;
1108 } nanos_wd_props_t;
1109 typedef struct
1110 {
1111 nanos_thread_t tie_to;
1112 unsigned int priority;
1113 } nanos_wd_dyn_props_t;
1114 typedef struct
1115 {
1116 void *(*factory)(void *arg);
1117 void *arg;
1118 } nanos_device_t;
1119 typedef enum
1120 {
1121 NANOS_STATE_START,
1122 NANOS_STATE_END,
1123 NANOS_SUBSTATE_START,
1124 NANOS_SUBSTATE_END,
1125 NANOS_BURST_START,
1126 NANOS_BURST_END,
1127 NANOS_PTP_START,
1128 NANOS_PTP_END,
1129 NANOS_POINT,
1130 EVENT_TYPES
1131 } nanos_event_type_t;
1132 typedef enum
1133 {
1134 NANOS_NOT_CREATED,
1135 NANOS_NOT_RUNNING,
1136 NANOS_STARTUP,
1137 NANOS_SHUTDOWN,
1138 NANOS_ERROR,
1139 NANOS_IDLE,
1140 NANOS_RUNTIME,
1141 NANOS_RUNNING,
1142 NANOS_SYNCHRONIZATION,
1143 NANOS_SCHEDULING,
1144 NANOS_CREATION,
1145 NANOS_MEM_TRANSFER_IN,
1146 NANOS_MEM_TRANSFER_OUT,
1147 NANOS_MEM_TRANSFER_LOCAL,
1148 NANOS_MEM_TRANSFER_DEVICE_IN,
1149 NANOS_MEM_TRANSFER_DEVICE_OUT,
1150 NANOS_MEM_TRANSFER_DEVICE_LOCAL,
1151 NANOS_CACHE,
1152 NANOS_YIELD,
1153 NANOS_ACQUIRING_LOCK,
1154 NANOS_CONTEXT_SWITCH,
1155 NANOS_DEBUG,
1156 NANOS_EVENT_STATE_TYPES
1157 } nanos_event_state_value_t;
1158 typedef enum
1159 {
1160 NANOS_WD_DOMAIN,
1161 NANOS_WD_DEPENDENCY,
1162 NANOS_WAIT,
1163 NANOS_WD_REMOTE,
1164 NANOS_XFER_PUT,
1165 NANOS_XFER_GET
1166 } nanos_event_domain_t;
1167 typedef long long nanos_event_id_t;
1168 typedef unsigned int nanos_event_key_t;
1169 typedef unsigned long long nanos_event_value_t;
1170 typedef struct
1171 {
1172 nanos_event_key_t key;
1173 nanos_event_value_t value;
1174 } nanos_event_burst_t;
1175 typedef struct
1176 {
1177 nanos_event_state_value_t value;
1178 } nanos_event_state_t;
1179 typedef struct
1180 {
1181 unsigned int nkvs;
1182 nanos_event_key_t *keys;
1183 nanos_event_value_t *values;
1184 } nanos_event_point_t;
1185 typedef struct
1186 {
1187 nanos_event_domain_t domain;
1188 nanos_event_id_t id;
1189 unsigned int nkvs;
1190 nanos_event_key_t *keys;
1191 nanos_event_value_t *values;
1192 } nanos_event_ptp_t;
1193 typedef struct
1194 {
1195 nanos_event_type_t type;
1196 union
1197 {
1198 nanos_event_burst_t burst;
1199 nanos_event_state_t state;
1200 nanos_event_point_t point;
1201 nanos_event_ptp_t ptp;
1202 } info;
1203 } nanos_event_t;
1204 typedef enum
1205 {
1206 NANOS_LOCK_FREE = 0,
1207 NANOS_LOCK_BUSY = 1
1208 } nanos_lock_state_t;
1209 typedef struct nanos_lock_t
1210 {
1211 volatile nanos_lock_state_t _state;
1212 } nanos_lock_t;
1213 typedef void (*nanos_translate_args_t)(void *, nanos_wd_t);
1214 typedef void (nanos_init_func_t)(void *);
1215 typedef struct
1216 {
1217 nanos_init_func_t *func;
1218 void *data;
1219 } nanos_init_desc_t;
1220 typedef void *nanos_wg_t;
1221 typedef void *nanos_team_t;
1222 typedef void *nanos_sched_t;
1223 typedef void *nanos_slicer_t;
1224 typedef void *nanos_dd_t;
1225 typedef void *nanos_sync_cond_t;
1226 typedef unsigned int nanos_copy_id_t;
1227 typedef struct nanos_const_wd_definition_tag
1228 {
1229 nanos_wd_props_t props;
1230 size_t data_alignment;
1231 size_t num_copies;
1232 size_t num_devices;
1233 } nanos_const_wd_definition_t;
1234 typedef struct
1235 {
1236 int nthreads;
1237 void *arch;
1238 } nanos_constraint_t;
1239 typedef enum
1240 {
1241 NANOS_OK = 0,
1242 NANOS_UNKNOWN_ERR,
1243 NANOS_UNIMPLEMENTED
1244 } nanos_err_t;
1245 typedef struct
1246 {
1247 void (*outline)(void *);
1248 } nanos_smp_args_t;
1249 extern nanos_wd_t nanos_current_wd_(void);
1250 extern nanos_wd_t nanos_current_wd(void);
1251 extern int nanos_get_wd_id_(nanos_wd_t wd);
1252 extern int nanos_get_wd_id(nanos_wd_t wd);
1253 extern nanos_slicer_t nanos_find_slicer_(const char *slicer);
1254 extern nanos_slicer_t nanos_find_slicer(const char *slicer);
1255 extern nanos_ws_t nanos_find_worksharing_(const char *label);
1256 extern nanos_ws_t nanos_find_worksharing(const char *label);
1257 extern nanos_err_t nanos_create_wd_compact_(nanos_wd_t *wd, nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void **data, nanos_wg_t wg, nanos_copy_data_t **copies);
1258 extern nanos_err_t nanos_create_wd_compact(nanos_wd_t *wd, nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void **data, nanos_wg_t wg, nanos_copy_data_t **copies);
1259 extern nanos_err_t nanos_set_translate_function_(nanos_wd_t wd, nanos_translate_args_t translate_args);
1260 extern nanos_err_t nanos_set_translate_function(nanos_wd_t wd, nanos_translate_args_t translate_args);
1261 extern nanos_err_t nanos_create_sliced_wd_(nanos_wd_t *uwd, size_t num_devices, nanos_device_t *devices, size_t outline_data_size, int outline_data_align, void **outline_data, nanos_wg_t uwg, nanos_slicer_t slicer, nanos_wd_props_t *props, nanos_wd_dyn_props_t *dyn_props, size_t num_copies, nanos_copy_data_t **copies);
1262 extern nanos_err_t nanos_create_sliced_wd(nanos_wd_t *uwd, size_t num_devices, nanos_device_t *devices, size_t outline_data_size, int outline_data_align, void **outline_data, nanos_wg_t uwg, nanos_slicer_t slicer, nanos_wd_props_t *props, nanos_wd_dyn_props_t *dyn_props, size_t num_copies, nanos_copy_data_t **copies);
1263 extern nanos_err_t nanos_submit_(nanos_wd_t wd, size_t num_deps, nanos_dependence_t *deps, nanos_team_t team);
1264 extern nanos_err_t nanos_submit(nanos_wd_t wd, size_t num_deps, nanos_dependence_t *deps, nanos_team_t team);
1265 extern nanos_err_t nanos_create_wd_and_run_compact_(nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void *data, size_t num_deps, nanos_dependence_t *deps, nanos_copy_data_t *copies, nanos_translate_args_t translate_args);
1266 extern nanos_err_t nanos_create_wd_and_run_compact(nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void *data, size_t num_deps, nanos_dependence_t *deps, nanos_copy_data_t *copies, nanos_translate_args_t translate_args);
1267 extern nanos_err_t nanos_create_for_(void);
1268 extern nanos_err_t nanos_create_for(void);
1269 extern nanos_err_t nanos_set_internal_wd_data_(nanos_wd_t wd, void *data);
1270 extern nanos_err_t nanos_set_internal_wd_data(nanos_wd_t wd, void *data);
1271 extern nanos_err_t nanos_get_internal_wd_data_(nanos_wd_t wd, void **data);
1272 extern nanos_err_t nanos_get_internal_wd_data(nanos_wd_t wd, void **data);
1273 extern nanos_err_t nanos_yield_(void);
1274 extern nanos_err_t nanos_yield(void);
1275 extern nanos_err_t nanos_slicer_get_specific_data_(nanos_slicer_t slicer, void **data);
1276 extern nanos_err_t nanos_slicer_get_specific_data(nanos_slicer_t slicer, void **data);
1277 extern nanos_err_t nanos_create_team_(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, nanos_constraint_t *constraints, _Bool reuse, nanos_thread_t *info);
1278 extern nanos_err_t nanos_create_team(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, nanos_constraint_t *constraints, _Bool reuse, nanos_thread_t *info);
1279 extern nanos_err_t nanos_create_team_mapped_(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, unsigned int *mapping);
1280 extern nanos_err_t nanos_create_team_mapped(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, unsigned int *mapping);
1281 extern nanos_err_t nanos_leave_team_();
1282 extern nanos_err_t nanos_leave_team();
1283 extern nanos_err_t nanos_end_team_(nanos_team_t team);
1284 extern nanos_err_t nanos_end_team(nanos_team_t team);
1285 extern nanos_err_t nanos_team_barrier_(void);
1286 extern nanos_err_t nanos_team_barrier(void);
1287 extern nanos_err_t nanos_single_guard_(_Bool *);
1288 extern nanos_err_t nanos_single_guard(_Bool *);
1289 extern nanos_err_t nanos_enter_sync_init_(_Bool *b);
1290 extern nanos_err_t nanos_enter_sync_init(_Bool *b);
1291 extern nanos_err_t nanos_wait_sync_init_(void);
1292 extern nanos_err_t nanos_wait_sync_init(void);
1293 extern nanos_err_t nanos_release_sync_init_(void);
1294 extern nanos_err_t nanos_release_sync_init(void);
1295 extern nanos_err_t nanos_team_get_num_starring_threads_(int *n);
1296 extern nanos_err_t nanos_team_get_num_starring_threads(int *n);
1297 extern nanos_err_t nanos_team_get_starring_threads_(int *n, nanos_thread_t *list_of_threads);
1298 extern nanos_err_t nanos_team_get_starring_threads(int *n, nanos_thread_t *list_of_threads);
1299 extern nanos_err_t nanos_team_get_num_supporting_threads_(int *n);
1300 extern nanos_err_t nanos_team_get_num_supporting_threads(int *n);
1301 extern nanos_err_t nanos_team_get_supporting_threads_(int *n, nanos_thread_t *list_of_threads);
1302 extern nanos_err_t nanos_team_get_supporting_threads(int *n, nanos_thread_t *list_of_threads);
1303 extern nanos_err_t nanos_register_reduction_(nanos_reduction_t *red);
1304 extern nanos_err_t nanos_register_reduction(nanos_reduction_t *red);
1305 extern nanos_err_t nanos_reduction_get_private_data_(void **copy, void *sink);
1306 extern nanos_err_t nanos_reduction_get_private_data(void **copy, void *sink);
1307 extern nanos_err_t nanos_worksharing_create_(nanos_ws_desc_t **wsd, nanos_ws_t ws, nanos_ws_info_t *info, _Bool *b);
1308 extern nanos_err_t nanos_worksharing_create(nanos_ws_desc_t **wsd, nanos_ws_t ws, nanos_ws_info_t *info, _Bool *b);
1309 extern nanos_err_t nanos_worksharing_next_item_(nanos_ws_desc_t *wsd, nanos_ws_item_t *wsi);
1310 extern nanos_err_t nanos_worksharing_next_item(nanos_ws_desc_t *wsd, nanos_ws_item_t *wsi);
1311 extern nanos_err_t nanos_wg_wait_completion_(nanos_wg_t wg, _Bool avoid_flush);
1312 extern nanos_err_t nanos_wg_wait_completion(nanos_wg_t wg, _Bool avoid_flush);
1313 extern nanos_err_t nanos_create_int_sync_cond_(nanos_sync_cond_t *sync_cond, volatile int *p, int condition);
1314 extern nanos_err_t nanos_create_int_sync_cond(nanos_sync_cond_t *sync_cond, volatile int *p, int condition);
1315 extern nanos_err_t nanos_create_bool_sync_cond_(nanos_sync_cond_t *sync_cond, volatile _Bool *p, _Bool condition);
1316 extern nanos_err_t nanos_create_bool_sync_cond(nanos_sync_cond_t *sync_cond, volatile _Bool *p, _Bool condition);
1317 extern nanos_err_t nanos_sync_cond_wait_(nanos_sync_cond_t *sync_cond);
1318 extern nanos_err_t nanos_sync_cond_wait(nanos_sync_cond_t *sync_cond);
1319 extern nanos_err_t nanos_sync_cond_signal_(nanos_sync_cond_t *sync_cond);
1320 extern nanos_err_t nanos_sync_cond_signal(nanos_sync_cond_t *sync_cond);
1321 extern nanos_err_t nanos_destroy_sync_cond_(nanos_sync_cond_t *sync_cond);
1322 extern nanos_err_t nanos_destroy_sync_cond(nanos_sync_cond_t *sync_cond);
1323 extern nanos_err_t nanos_wait_on_(size_t num_deps, nanos_dependence_t *deps);
1324 extern nanos_err_t nanos_wait_on(size_t num_deps, nanos_dependence_t *deps);
1325 extern nanos_err_t nanos_init_lock_(nanos_lock_t **lock);
1326 extern nanos_err_t nanos_init_lock(nanos_lock_t **lock);
1327 extern nanos_err_t nanos_set_lock_(nanos_lock_t *lock);
1328 extern nanos_err_t nanos_set_lock(nanos_lock_t *lock);
1329 extern nanos_err_t nanos_unset_lock_(nanos_lock_t *lock);
1330 extern nanos_err_t nanos_unset_lock(nanos_lock_t *lock);
1331 extern nanos_err_t nanos_try_lock_(nanos_lock_t *lock, _Bool *result);
1332 extern nanos_err_t nanos_try_lock(nanos_lock_t *lock, _Bool *result);
1333 extern nanos_err_t nanos_destroy_lock_(nanos_lock_t *lock);
1334 extern nanos_err_t nanos_destroy_lock(nanos_lock_t *lock);
1335 extern nanos_err_t nanos_get_addr_(nanos_copy_id_t copy_id, void **addr, nanos_wd_t cwd);
1336 extern nanos_err_t nanos_get_addr(nanos_copy_id_t copy_id, void **addr, nanos_wd_t cwd);
1337 extern nanos_err_t nanos_copy_value_(void *dst, nanos_copy_id_t copy_id, nanos_wd_t cwd);
1338 extern nanos_err_t nanos_copy_value(void *dst, nanos_copy_id_t copy_id, nanos_wd_t cwd);
1339 extern nanos_err_t nanos_get_num_running_tasks_(int *num);
1340 extern nanos_err_t nanos_get_num_running_tasks(int *num);
1341 extern nanos_err_t nanos_start_scheduler_();
1342 extern nanos_err_t nanos_start_scheduler();
1343 extern nanos_err_t nanos_stop_scheduler_();
1344 extern nanos_err_t nanos_stop_scheduler();
1345 extern nanos_err_t nanos_scheduler_enabled_(_Bool *res);
1346 extern nanos_err_t nanos_scheduler_enabled(_Bool *res);
1347 extern nanos_err_t nanos_wait_until_threads_paused_();
1348 extern nanos_err_t nanos_wait_until_threads_paused();
1349 extern nanos_err_t nanos_wait_until_threads_unpaused_();
1350 extern nanos_err_t nanos_wait_until_threads_unpaused();
1351 extern nanos_err_t nanos_delay_start_();
1352 extern nanos_err_t nanos_delay_start();
1353 extern nanos_err_t nanos_start_();
1354 extern nanos_err_t nanos_start();
1355 extern nanos_err_t nanos_finish_();
1356 extern nanos_err_t nanos_finish();
1357 extern nanos_err_t nanos_malloc_(void **p, size_t size, const char *file, int line);
1358 extern nanos_err_t nanos_malloc(void **p, size_t size, const char *file, int line);
1359 extern nanos_err_t nanos_free_(void *p);
1360 extern nanos_err_t nanos_free(void *p);
1361 extern void nanos_handle_error_(nanos_err_t err);
1362 extern void nanos_handle_error(nanos_err_t err);
1363 extern void *nanos_smp_factory_(void *args);
1364 extern void *nanos_smp_factory(void *args);
1365 extern nanos_err_t nanos_instrument_register_key_(nanos_event_key_t *event_key, const char *key, const char *description, _Bool abort_when_registered);
1366 extern nanos_err_t nanos_instrument_register_key(nanos_event_key_t *event_key, const char *key, const char *description, _Bool abort_when_registered);
1367 extern nanos_err_t nanos_instrument_register_value_(nanos_event_value_t *event_value, const char *key, const char *value, const char *description, _Bool abort_when_registered);
1368 extern nanos_err_t nanos_instrument_register_value(nanos_event_value_t *event_value, const char *key, const char *value, const char *description, _Bool abort_when_registered);
1369 extern nanos_err_t nanos_instrument_register_value_with_val_(nanos_event_value_t val, const char *key, const char *value, const char *description, _Bool abort_when_registered);
1370 extern nanos_err_t nanos_instrument_register_value_with_val(nanos_event_value_t val, const char *key, const char *value, const char *description, _Bool abort_when_registered);
1371 extern nanos_err_t nanos_instrument_get_key_(const char *key, nanos_event_key_t *event_key);
1372 extern nanos_err_t nanos_instrument_get_key(const char *key, nanos_event_key_t *event_key);
1373 extern nanos_err_t nanos_instrument_get_value_(const char *key, const char *value, nanos_event_value_t *event_value);
1374 extern nanos_err_t nanos_instrument_get_value(const char *key, const char *value, nanos_event_value_t *event_value);
1375 extern nanos_err_t nanos_instrument_events_(unsigned int num_events, nanos_event_t events[]);
1376 extern nanos_err_t nanos_instrument_events(unsigned int num_events, nanos_event_t events[]);
1377 extern nanos_err_t nanos_instrument_enter_state_(nanos_event_state_value_t state);
1378 extern nanos_err_t nanos_instrument_enter_state(nanos_event_state_value_t state);
1379 extern nanos_err_t nanos_instrument_leave_state_(void);
1380 extern nanos_err_t nanos_instrument_leave_state(void);
1381 extern nanos_err_t nanos_instrument_enter_burst_(nanos_event_key_t key, nanos_event_value_t value);
1382 extern nanos_err_t nanos_instrument_enter_burst(nanos_event_key_t key, nanos_event_value_t value);
1383 extern nanos_err_t nanos_instrument_leave_burst_(nanos_event_key_t key);
1384 extern nanos_err_t nanos_instrument_leave_burst(nanos_event_key_t key);
1385 extern nanos_err_t nanos_instrument_point_event_(unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values);
1386 extern nanos_err_t nanos_instrument_point_event(unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values);
1387 extern nanos_err_t nanos_instrument_ptp_start_(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values);
1388 extern nanos_err_t nanos_instrument_ptp_start(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values);
1389 extern nanos_err_t nanos_instrument_ptp_end_(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values);
1390 extern nanos_err_t nanos_instrument_ptp_end(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values);
1391 extern nanos_err_t nanos_instrument_disable_state_events_(nanos_event_state_value_t state);
1392 extern nanos_err_t nanos_instrument_disable_state_events(nanos_event_state_value_t state);
1393 extern nanos_err_t nanos_instrument_enable_state_events_(void);
1394 extern nanos_err_t nanos_instrument_enable_state_events(void);
1395 extern nanos_err_t nanos_instrument_close_user_fun_event_();
1396 extern nanos_err_t nanos_instrument_close_user_fun_event();
1397 extern nanos_err_t nanos_instrument_enable_(void);
1398 extern nanos_err_t nanos_instrument_enable(void);
1399 extern nanos_err_t nanos_instrument_disable_(void);
1400 extern nanos_err_t nanos_instrument_disable(void);
1401 void nanos_reduction_int_vop(int, void *, void *);
1402 void nanos_reduction_bop_add_char(void *arg1, void *arg2);
1403 void nanos_reduction_vop_add_char(int i, void *arg1, void *arg2);
1404 void nanos_reduction_bop_add_uchar(void *arg1, void *arg2);
1405 void nanos_reduction_vop_add_uchar(int i, void *arg1, void *arg2);
1406 void nanos_reduction_bop_add_schar(void *arg1, void *arg2);
1407 void nanos_reduction_vop_add_schar(int i, void *arg1, void *arg2);
1408 void nanos_reduction_bop_add_short(void *arg1, void *arg2);
1409 void nanos_reduction_vop_add_short(int i, void *arg1, void *arg2);
1410 void nanos_reduction_bop_add_ushort(void *arg1, void *arg2);
1411 void nanos_reduction_vop_add_ushort(int i, void *arg1, void *arg2);
1412 void nanos_reduction_bop_add_int(void *arg1, void *arg2);
1413 void nanos_reduction_vop_add_int(int i, void *arg1, void *arg2);
1414 void nanos_reduction_bop_add_uint(void *arg1, void *arg2);
1415 void nanos_reduction_vop_add_uint(int i, void *arg1, void *arg2);
1416 void nanos_reduction_bop_add_long(void *arg1, void *arg2);
1417 void nanos_reduction_vop_add_long(int i, void *arg1, void *arg2);
1418 void nanos_reduction_bop_add_ulong(void *arg1, void *arg2);
1419 void nanos_reduction_vop_add_ulong(int i, void *arg1, void *arg2);
1420 void nanos_reduction_bop_add_longlong(void *arg1, void *arg2);
1421 void nanos_reduction_vop_add_longlong(int i, void *arg1, void *arg2);
1422 void nanos_reduction_bop_add_ulonglong(void *arg1, void *arg2);
1423 void nanos_reduction_vop_add_ulonglong(int i, void *arg1, void *arg2);
1424 void nanos_reduction_bop_add__Bool(void *arg1, void *arg2);
1425 void nanos_reduction_vop_add__Bool(int i, void *arg1, void *arg2);
1426 void nanos_reduction_bop_add_float(void *arg1, void *arg2);
1427 void nanos_reduction_vop_add_float(int i, void *arg1, void *arg2);
1428 void nanos_reduction_bop_add_double(void *arg1, void *arg2);
1429 void nanos_reduction_vop_add_double(int i, void *arg1, void *arg2);
1430 void nanos_reduction_bop_add_longdouble(void *arg1, void *arg2);
1431 void nanos_reduction_vop_add_longdouble(int i, void *arg1, void *arg2);
1432 void nanos_reduction_bop_sub_char(void *arg1, void *arg2);
1433 void nanos_reduction_vop_sub_char(int i, void *arg1, void *arg2);
1434 void nanos_reduction_bop_sub_uchar(void *arg1, void *arg2);
1435 void nanos_reduction_vop_sub_uchar(int i, void *arg1, void *arg2);
1436 void nanos_reduction_bop_sub_schar(void *arg1, void *arg2);
1437 void nanos_reduction_vop_sub_schar(int i, void *arg1, void *arg2);
1438 void nanos_reduction_bop_sub_short(void *arg1, void *arg2);
1439 void nanos_reduction_vop_sub_short(int i, void *arg1, void *arg2);
1440 void nanos_reduction_bop_sub_ushort(void *arg1, void *arg2);
1441 void nanos_reduction_vop_sub_ushort(int i, void *arg1, void *arg2);
1442 void nanos_reduction_bop_sub_int(void *arg1, void *arg2);
1443 void nanos_reduction_vop_sub_int(int i, void *arg1, void *arg2);
1444 void nanos_reduction_bop_sub_uint(void *arg1, void *arg2);
1445 void nanos_reduction_vop_sub_uint(int i, void *arg1, void *arg2);
1446 void nanos_reduction_bop_sub_long(void *arg1, void *arg2);
1447 void nanos_reduction_vop_sub_long(int i, void *arg1, void *arg2);
1448 void nanos_reduction_bop_sub_ulong(void *arg1, void *arg2);
1449 void nanos_reduction_vop_sub_ulong(int i, void *arg1, void *arg2);
1450 void nanos_reduction_bop_sub_longlong(void *arg1, void *arg2);
1451 void nanos_reduction_vop_sub_longlong(int i, void *arg1, void *arg2);
1452 void nanos_reduction_bop_sub_ulonglong(void *arg1, void *arg2);
1453 void nanos_reduction_vop_sub_ulonglong(int i, void *arg1, void *arg2);
1454 void nanos_reduction_bop_sub__Bool(void *arg1, void *arg2);
1455 void nanos_reduction_vop_sub__Bool(int i, void *arg1, void *arg2);
1456 void nanos_reduction_bop_sub_float(void *arg1, void *arg2);
1457 void nanos_reduction_vop_sub_float(int i, void *arg1, void *arg2);
1458 void nanos_reduction_bop_sub_double(void *arg1, void *arg2);
1459 void nanos_reduction_vop_sub_double(int i, void *arg1, void *arg2);
1460 void nanos_reduction_bop_sub_longdouble(void *arg1, void *arg2);
1461 void nanos_reduction_vop_sub_longdouble(int i, void *arg1, void *arg2);
1462 void nanos_reduction_bop_prod_char(void *arg1, void *arg2);
1463 void nanos_reduction_vop_prod_char(int i, void *arg1, void *arg2);
1464 void nanos_reduction_bop_prod_uchar(void *arg1, void *arg2);
1465 void nanos_reduction_vop_prod_uchar(int i, void *arg1, void *arg2);
1466 void nanos_reduction_bop_prod_schar(void *arg1, void *arg2);
1467 void nanos_reduction_vop_prod_schar(int i, void *arg1, void *arg2);
1468 void nanos_reduction_bop_prod_short(void *arg1, void *arg2);
1469 void nanos_reduction_vop_prod_short(int i, void *arg1, void *arg2);
1470 void nanos_reduction_bop_prod_ushort(void *arg1, void *arg2);
1471 void nanos_reduction_vop_prod_ushort(int i, void *arg1, void *arg2);
1472 void nanos_reduction_bop_prod_int(void *arg1, void *arg2);
1473 void nanos_reduction_vop_prod_int(int i, void *arg1, void *arg2);
1474 void nanos_reduction_bop_prod_uint(void *arg1, void *arg2);
1475 void nanos_reduction_vop_prod_uint(int i, void *arg1, void *arg2);
1476 void nanos_reduction_bop_prod_long(void *arg1, void *arg2);
1477 void nanos_reduction_vop_prod_long(int i, void *arg1, void *arg2);
1478 void nanos_reduction_bop_prod_ulong(void *arg1, void *arg2);
1479 void nanos_reduction_vop_prod_ulong(int i, void *arg1, void *arg2);
1480 void nanos_reduction_bop_prod_longlong(void *arg1, void *arg2);
1481 void nanos_reduction_vop_prod_longlong(int i, void *arg1, void *arg2);
1482 void nanos_reduction_bop_prod_ulonglong(void *arg1, void *arg2);
1483 void nanos_reduction_vop_prod_ulonglong(int i, void *arg1, void *arg2);
1484 void nanos_reduction_bop_prod__Bool(void *arg1, void *arg2);
1485 void nanos_reduction_vop_prod__Bool(int i, void *arg1, void *arg2);
1486 void nanos_reduction_bop_prod_float(void *arg1, void *arg2);
1487 void nanos_reduction_vop_prod_float(int i, void *arg1, void *arg2);
1488 void nanos_reduction_bop_prod_double(void *arg1, void *arg2);
1489 void nanos_reduction_vop_prod_double(int i, void *arg1, void *arg2);
1490 void nanos_reduction_bop_prod_longdouble(void *arg1, void *arg2);
1491 void nanos_reduction_vop_prod_longdouble(int i, void *arg1, void *arg2);
1492 void nanos_reduction_bop_and_char(void *arg1, void *arg2);
1493 void nanos_reduction_vop_and_char(int i, void *arg1, void *arg2);
1494 void nanos_reduction_bop_and_uchar(void *arg1, void *arg2);
1495 void nanos_reduction_vop_and_uchar(int i, void *arg1, void *arg2);
1496 void nanos_reduction_bop_and_schar(void *arg1, void *arg2);
1497 void nanos_reduction_vop_and_schar(int i, void *arg1, void *arg2);
1498 void nanos_reduction_bop_and_short(void *arg1, void *arg2);
1499 void nanos_reduction_vop_and_short(int i, void *arg1, void *arg2);
1500 void nanos_reduction_bop_and_ushort(void *arg1, void *arg2);
1501 void nanos_reduction_vop_and_ushort(int i, void *arg1, void *arg2);
1502 void nanos_reduction_bop_and_int(void *arg1, void *arg2);
1503 void nanos_reduction_vop_and_int(int i, void *arg1, void *arg2);
1504 void nanos_reduction_bop_and_uint(void *arg1, void *arg2);
1505 void nanos_reduction_vop_and_uint(int i, void *arg1, void *arg2);
1506 void nanos_reduction_bop_and_long(void *arg1, void *arg2);
1507 void nanos_reduction_vop_and_long(int i, void *arg1, void *arg2);
1508 void nanos_reduction_bop_and_ulong(void *arg1, void *arg2);
1509 void nanos_reduction_vop_and_ulong(int i, void *arg1, void *arg2);
1510 void nanos_reduction_bop_and_longlong(void *arg1, void *arg2);
1511 void nanos_reduction_vop_and_longlong(int i, void *arg1, void *arg2);
1512 void nanos_reduction_bop_and_ulonglong(void *arg1, void *arg2);
1513 void nanos_reduction_vop_and_ulonglong(int i, void *arg1, void *arg2);
1514 void nanos_reduction_bop_and__Bool(void *arg1, void *arg2);
1515 void nanos_reduction_vop_and__Bool(int i, void *arg1, void *arg2);
1516 void nanos_reduction_bop_or_char(void *arg1, void *arg2);
1517 void nanos_reduction_vop_or_char(int i, void *arg1, void *arg2);
1518 void nanos_reduction_bop_or_uchar(void *arg1, void *arg2);
1519 void nanos_reduction_vop_or_uchar(int i, void *arg1, void *arg2);
1520 void nanos_reduction_bop_or_schar(void *arg1, void *arg2);
1521 void nanos_reduction_vop_or_schar(int i, void *arg1, void *arg2);
1522 void nanos_reduction_bop_or_short(void *arg1, void *arg2);
1523 void nanos_reduction_vop_or_short(int i, void *arg1, void *arg2);
1524 void nanos_reduction_bop_or_ushort(void *arg1, void *arg2);
1525 void nanos_reduction_vop_or_ushort(int i, void *arg1, void *arg2);
1526 void nanos_reduction_bop_or_int(void *arg1, void *arg2);
1527 void nanos_reduction_vop_or_int(int i, void *arg1, void *arg2);
1528 void nanos_reduction_bop_or_uint(void *arg1, void *arg2);
1529 void nanos_reduction_vop_or_uint(int i, void *arg1, void *arg2);
1530 void nanos_reduction_bop_or_long(void *arg1, void *arg2);
1531 void nanos_reduction_vop_or_long(int i, void *arg1, void *arg2);
1532 void nanos_reduction_bop_or_ulong(void *arg1, void *arg2);
1533 void nanos_reduction_vop_or_ulong(int i, void *arg1, void *arg2);
1534 void nanos_reduction_bop_or_longlong(void *arg1, void *arg2);
1535 void nanos_reduction_vop_or_longlong(int i, void *arg1, void *arg2);
1536 void nanos_reduction_bop_or_ulonglong(void *arg1, void *arg2);
1537 void nanos_reduction_vop_or_ulonglong(int i, void *arg1, void *arg2);
1538 void nanos_reduction_bop_or__Bool(void *arg1, void *arg2);
1539 void nanos_reduction_vop_or__Bool(int i, void *arg1, void *arg2);
1540 void nanos_reduction_bop_xor_char(void *arg1, void *arg2);
1541 void nanos_reduction_vop_xor_char(int i, void *arg1, void *arg2);
1542 void nanos_reduction_bop_xor_uchar(void *arg1, void *arg2);
1543 void nanos_reduction_vop_xor_uchar(int i, void *arg1, void *arg2);
1544 void nanos_reduction_bop_xor_schar(void *arg1, void *arg2);
1545 void nanos_reduction_vop_xor_schar(int i, void *arg1, void *arg2);
1546 void nanos_reduction_bop_xor_short(void *arg1, void *arg2);
1547 void nanos_reduction_vop_xor_short(int i, void *arg1, void *arg2);
1548 void nanos_reduction_bop_xor_ushort(void *arg1, void *arg2);
1549 void nanos_reduction_vop_xor_ushort(int i, void *arg1, void *arg2);
1550 void nanos_reduction_bop_xor_int(void *arg1, void *arg2);
1551 void nanos_reduction_vop_xor_int(int i, void *arg1, void *arg2);
1552 void nanos_reduction_bop_xor_uint(void *arg1, void *arg2);
1553 void nanos_reduction_vop_xor_uint(int i, void *arg1, void *arg2);
1554 void nanos_reduction_bop_xor_long(void *arg1, void *arg2);
1555 void nanos_reduction_vop_xor_long(int i, void *arg1, void *arg2);
1556 void nanos_reduction_bop_xor_ulong(void *arg1, void *arg2);
1557 void nanos_reduction_vop_xor_ulong(int i, void *arg1, void *arg2);
1558 void nanos_reduction_bop_xor_longlong(void *arg1, void *arg2);
1559 void nanos_reduction_vop_xor_longlong(int i, void *arg1, void *arg2);
1560 void nanos_reduction_bop_xor_ulonglong(void *arg1, void *arg2);
1561 void nanos_reduction_vop_xor_ulonglong(int i, void *arg1, void *arg2);
1562 void nanos_reduction_bop_xor__Bool(void *arg1, void *arg2);
1563 void nanos_reduction_vop_xor__Bool(int i, void *arg1, void *arg2);
1564 void nanos_reduction_bop_land_char(void *arg1, void *arg2);
1565 void nanos_reduction_vop_land_char(int i, void *arg1, void *arg2);
1566 void nanos_reduction_bop_land_uchar(void *arg1, void *arg2);
1567 void nanos_reduction_vop_land_uchar(int i, void *arg1, void *arg2);
1568 void nanos_reduction_bop_land_schar(void *arg1, void *arg2);
1569 void nanos_reduction_vop_land_schar(int i, void *arg1, void *arg2);
1570 void nanos_reduction_bop_land_short(void *arg1, void *arg2);
1571 void nanos_reduction_vop_land_short(int i, void *arg1, void *arg2);
1572 void nanos_reduction_bop_land_ushort(void *arg1, void *arg2);
1573 void nanos_reduction_vop_land_ushort(int i, void *arg1, void *arg2);
1574 void nanos_reduction_bop_land_int(void *arg1, void *arg2);
1575 void nanos_reduction_vop_land_int(int i, void *arg1, void *arg2);
1576 void nanos_reduction_bop_land_uint(void *arg1, void *arg2);
1577 void nanos_reduction_vop_land_uint(int i, void *arg1, void *arg2);
1578 void nanos_reduction_bop_land_long(void *arg1, void *arg2);
1579 void nanos_reduction_vop_land_long(int i, void *arg1, void *arg2);
1580 void nanos_reduction_bop_land_ulong(void *arg1, void *arg2);
1581 void nanos_reduction_vop_land_ulong(int i, void *arg1, void *arg2);
1582 void nanos_reduction_bop_land_longlong(void *arg1, void *arg2);
1583 void nanos_reduction_vop_land_longlong(int i, void *arg1, void *arg2);
1584 void nanos_reduction_bop_land_ulonglong(void *arg1, void *arg2);
1585 void nanos_reduction_vop_land_ulonglong(int i, void *arg1, void *arg2);
1586 void nanos_reduction_bop_land__Bool(void *arg1, void *arg2);
1587 void nanos_reduction_vop_land__Bool(int i, void *arg1, void *arg2);
1588 void nanos_reduction_bop_land_float(void *arg1, void *arg2);
1589 void nanos_reduction_vop_land_float(int i, void *arg1, void *arg2);
1590 void nanos_reduction_bop_land_double(void *arg1, void *arg2);
1591 void nanos_reduction_vop_land_double(int i, void *arg1, void *arg2);
1592 void nanos_reduction_bop_land_longdouble(void *arg1, void *arg2);
1593 void nanos_reduction_vop_land_longdouble(int i, void *arg1, void *arg2);
1594 void nanos_reduction_bop_lor_char(void *arg1, void *arg2);
1595 void nanos_reduction_vop_lor_char(int i, void *arg1, void *arg2);
1596 void nanos_reduction_bop_lor_uchar(void *arg1, void *arg2);
1597 void nanos_reduction_vop_lor_uchar(int i, void *arg1, void *arg2);
1598 void nanos_reduction_bop_lor_schar(void *arg1, void *arg2);
1599 void nanos_reduction_vop_lor_schar(int i, void *arg1, void *arg2);
1600 void nanos_reduction_bop_lor_short(void *arg1, void *arg2);
1601 void nanos_reduction_vop_lor_short(int i, void *arg1, void *arg2);
1602 void nanos_reduction_bop_lor_ushort(void *arg1, void *arg2);
1603 void nanos_reduction_vop_lor_ushort(int i, void *arg1, void *arg2);
1604 void nanos_reduction_bop_lor_int(void *arg1, void *arg2);
1605 void nanos_reduction_vop_lor_int(int i, void *arg1, void *arg2);
1606 void nanos_reduction_bop_lor_uint(void *arg1, void *arg2);
1607 void nanos_reduction_vop_lor_uint(int i, void *arg1, void *arg2);
1608 void nanos_reduction_bop_lor_long(void *arg1, void *arg2);
1609 void nanos_reduction_vop_lor_long(int i, void *arg1, void *arg2);
1610 void nanos_reduction_bop_lor_ulong(void *arg1, void *arg2);
1611 void nanos_reduction_vop_lor_ulong(int i, void *arg1, void *arg2);
1612 void nanos_reduction_bop_lor_longlong(void *arg1, void *arg2);
1613 void nanos_reduction_vop_lor_longlong(int i, void *arg1, void *arg2);
1614 void nanos_reduction_bop_lor_ulonglong(void *arg1, void *arg2);
1615 void nanos_reduction_vop_lor_ulonglong(int i, void *arg1, void *arg2);
1616 void nanos_reduction_bop_lor__Bool(void *arg1, void *arg2);
1617 void nanos_reduction_vop_lor__Bool(int i, void *arg1, void *arg2);
1618 void nanos_reduction_bop_lor_float(void *arg1, void *arg2);
1619 void nanos_reduction_vop_lor_float(int i, void *arg1, void *arg2);
1620 void nanos_reduction_bop_lor_double(void *arg1, void *arg2);
1621 void nanos_reduction_vop_lor_double(int i, void *arg1, void *arg2);
1622 void nanos_reduction_bop_lor_longdouble(void *arg1, void *arg2);
1623 void nanos_reduction_vop_lor_longdouble(int i, void *arg1, void *arg2);
1624 void nanos_reduction_bop_max_char(void *arg1, void *arg2);
1625 void nanos_reduction_vop_max_char(int i, void *arg1, void *arg2);
1626 void nanos_reduction_bop_max_uchar(void *arg1, void *arg2);
1627 void nanos_reduction_vop_max_uchar(int i, void *arg1, void *arg2);
1628 void nanos_reduction_bop_max_schar(void *arg1, void *arg2);
1629 void nanos_reduction_vop_max_schar(int i, void *arg1, void *arg2);
1630 void nanos_reduction_bop_max_short(void *arg1, void *arg2);
1631 void nanos_reduction_vop_max_short(int i, void *arg1, void *arg2);
1632 void nanos_reduction_bop_max_ushort(void *arg1, void *arg2);
1633 void nanos_reduction_vop_max_ushort(int i, void *arg1, void *arg2);
1634 void nanos_reduction_bop_max_int(void *arg1, void *arg2);
1635 void nanos_reduction_vop_max_int(int i, void *arg1, void *arg2);
1636 void nanos_reduction_bop_max_uint(void *arg1, void *arg2);
1637 void nanos_reduction_vop_max_uint(int i, void *arg1, void *arg2);
1638 void nanos_reduction_bop_max_long(void *arg1, void *arg2);
1639 void nanos_reduction_vop_max_long(int i, void *arg1, void *arg2);
1640 void nanos_reduction_bop_max_ulong(void *arg1, void *arg2);
1641 void nanos_reduction_vop_max_ulong(int i, void *arg1, void *arg2);
1642 void nanos_reduction_bop_max_longlong(void *arg1, void *arg2);
1643 void nanos_reduction_vop_max_longlong(int i, void *arg1, void *arg2);
1644 void nanos_reduction_bop_max_ulonglong(void *arg1, void *arg2);
1645 void nanos_reduction_vop_max_ulonglong(int i, void *arg1, void *arg2);
1646 void nanos_reduction_bop_max__Bool(void *arg1, void *arg2);
1647 void nanos_reduction_vop_max__Bool(int i, void *arg1, void *arg2);
1648 void nanos_reduction_bop_max_float(void *arg1, void *arg2);
1649 void nanos_reduction_vop_max_float(int i, void *arg1, void *arg2);
1650 void nanos_reduction_bop_max_double(void *arg1, void *arg2);
1651 void nanos_reduction_vop_max_double(int i, void *arg1, void *arg2);
1652 void nanos_reduction_bop_max_longdouble(void *arg1, void *arg2);
1653 void nanos_reduction_vop_max_longdouble(int i, void *arg1, void *arg2);
1654 void nanos_reduction_bop_min_char(void *arg1, void *arg2);
1655 void nanos_reduction_vop_min_char(int i, void *arg1, void *arg2);
1656 void nanos_reduction_bop_min_uchar(void *arg1, void *arg2);
1657 void nanos_reduction_vop_min_uchar(int i, void *arg1, void *arg2);
1658 void nanos_reduction_bop_min_schar(void *arg1, void *arg2);
1659 void nanos_reduction_vop_min_schar(int i, void *arg1, void *arg2);
1660 void nanos_reduction_bop_min_short(void *arg1, void *arg2);
1661 void nanos_reduction_vop_min_short(int i, void *arg1, void *arg2);
1662 void nanos_reduction_bop_min_ushort(void *arg1, void *arg2);
1663 void nanos_reduction_vop_min_ushort(int i, void *arg1, void *arg2);
1664 void nanos_reduction_bop_min_int(void *arg1, void *arg2);
1665 void nanos_reduction_vop_min_int(int i, void *arg1, void *arg2);
1666 void nanos_reduction_bop_min_uint(void *arg1, void *arg2);
1667 void nanos_reduction_vop_min_uint(int i, void *arg1, void *arg2);
1668 void nanos_reduction_bop_min_long(void *arg1, void *arg2);
1669 void nanos_reduction_vop_min_long(int i, void *arg1, void *arg2);
1670 void nanos_reduction_bop_min_ulong(void *arg1, void *arg2);
1671 void nanos_reduction_vop_min_ulong(int i, void *arg1, void *arg2);
1672 void nanos_reduction_bop_min_longlong(void *arg1, void *arg2);
1673 void nanos_reduction_vop_min_longlong(int i, void *arg1, void *arg2);
1674 void nanos_reduction_bop_min_ulonglong(void *arg1, void *arg2);
1675 void nanos_reduction_vop_min_ulonglong(int i, void *arg1, void *arg2);
1676 void nanos_reduction_bop_min__Bool(void *arg1, void *arg2);
1677 void nanos_reduction_vop_min__Bool(int i, void *arg1, void *arg2);
1678 void nanos_reduction_bop_min_float(void *arg1, void *arg2);
1679 void nanos_reduction_vop_min_float(int i, void *arg1, void *arg2);
1680 void nanos_reduction_bop_min_double(void *arg1, void *arg2);
1681 void nanos_reduction_vop_min_double(int i, void *arg1, void *arg2);
1682 void nanos_reduction_bop_min_longdouble(void *arg1, void *arg2);
1683 void nanos_reduction_vop_min_longdouble(int i, void *arg1, void *arg2);
1684 void nanos_reduction_default_cleanup_char(void *r);
1685 void nanos_reduction_default_cleanup_uchar(void *r);
1686 void nanos_reduction_default_cleanup_schar(void *r);
1687 void nanos_reduction_default_cleanup_short(void *r);
1688 void nanos_reduction_default_cleanup_ushort(void *r);
1689 void nanos_reduction_default_cleanup_int(void *r);
1690 void nanos_reduction_default_cleanup_uint(void *r);
1691 void nanos_reduction_default_cleanup_long(void *r);
1692 void nanos_reduction_default_cleanup_ulong(void *r);
1693 void nanos_reduction_default_cleanup_longlong(void *r);
1694 void nanos_reduction_default_cleanup_ulonglong(void *r);
1695 void nanos_reduction_default_cleanup__Bool(void *r);
1696 void nanos_reduction_default_cleanup_float(void *r);
1697 void nanos_reduction_default_cleanup_double(void *r);
1698 void nanos_reduction_default_cleanup_longdouble(void *r);
1699 typedef void *omp_lock_t;
1700 typedef void *omp_nest_lock_t;
1701 typedef enum omp_sched_t
1702 {
1703 omp_sched_static = 1,
1704 omp_sched_dynamic = 2,
1705 omp_sched_guided = 3,
1706 omp_sched_auto = 4
1707 } omp_sched_t;
1708 extern void omp_set_num_threads(int num_threads);
1709 extern int omp_get_num_threads(void);
1710 extern int omp_get_max_threads(void);
1711 extern int omp_get_thread_num(void);
1712 extern int omp_get_num_procs(void);
1713 extern int omp_in_parallel(void);
1714 extern void omp_set_dynamic(int dynamic_threads);
1715 extern int omp_get_dynamic(void);
1716 extern void omp_set_nested(int nested);
1717 extern int omp_get_nested(void);
1718 extern int omp_get_thread_limit(void);
1719 extern void omp_set_max_active_levels(int max_active_levels);
1720 extern int omp_get_max_active_levels(void);
1721 extern void omp_set_schedule(omp_sched_t kind, int modifier);
1722 extern void omp_get_schedule(omp_sched_t *kind, int *modifier);
1723 extern int omp_get_level(void);
1724 extern int omp_get_ancestor_thread_num(int level);
1725 extern int omp_get_team_size(int level);
1726 extern int omp_get_active_level(void);
1727 extern void omp_init_lock(omp_lock_t *lock);
1728 extern void omp_destroy_lock(omp_lock_t *lock);
1729 extern void omp_set_lock(omp_lock_t *lock);
1730 extern void omp_unset_lock(omp_lock_t *lock);
1731 extern int omp_test_lock(omp_lock_t *lock);
1732 extern void omp_init_nest_lock(omp_nest_lock_t *lock);
1733 extern void omp_destroy_nest_lock(omp_nest_lock_t *lock);
1734 extern void omp_set_nest_lock(omp_nest_lock_t *lock);
1735 extern void omp_unset_nest_lock(omp_nest_lock_t *lock);
1736 extern int omp_test_nest_lock(omp_nest_lock_t *lock);
1737 extern double omp_get_wtime(void);
1738 extern double omp_get_wtick(void);
1739 extern int omp_in_final(void);
1740 nanos_err_t nanos_omp_single(_Bool *);
1741 nanos_err_t nanos_omp_barrier(void);
1742 void nanos_omp_set_interface(void *);
1743 nanos_err_t nanos_omp_set_implicit(nanos_wd_t uwd);
1744 int nanos_omp_get_max_threads(void);
1745 nanos_ws_t nanos_omp_find_worksharing(omp_sched_t kind);
1746 nanos_err_t nanos_omp_get_schedule(omp_sched_t *kind, int *modifier);
1747 typedef __time_t time_t;
1748 struct timespec
1749 {
1750 __time_t tv_sec;
1751 long int tv_nsec;
1752 };
1753 struct sched_param
1754 {
1755 int __sched_priority;
1756 };
1757 struct __sched_param
1758 {
1759 int __sched_priority;
1760 };
1761 typedef unsigned long int __cpu_mask;
1762 typedef struct
1763 {
1764 __cpu_mask __bits[1024 / (8 * sizeof(__cpu_mask))];
1765 } cpu_set_t;
1766 extern int __sched_cpucount(size_t __setsize, const cpu_set_t *__setp) __attribute__((__nothrow__, __leaf__));
1767 extern cpu_set_t *__sched_cpualloc(size_t __count) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
1768 extern void __sched_cpufree(cpu_set_t *__set) __attribute__((__nothrow__, __leaf__));
1769 extern int sched_setparam(__pid_t __pid, __const struct sched_param *__param) __attribute__((__nothrow__, __leaf__));
1770 extern int sched_getparam(__pid_t __pid, struct sched_param *__param) __attribute__((__nothrow__, __leaf__));
1771 extern int sched_setscheduler(__pid_t __pid, int __policy, __const struct sched_param *__param) __attribute__((__nothrow__, __leaf__));
1772 extern int sched_getscheduler(__pid_t __pid) __attribute__((__nothrow__, __leaf__));
1773 extern int sched_yield(void) __attribute__((__nothrow__, __leaf__));
1774 extern int sched_get_priority_max(int __algorithm) __attribute__((__nothrow__, __leaf__));
1775 extern int sched_get_priority_min(int __algorithm) __attribute__((__nothrow__, __leaf__));
1776 extern int sched_rr_get_interval(__pid_t __pid, struct timespec *__t) __attribute__((__nothrow__, __leaf__));
1777 typedef __clock_t clock_t;
1778 typedef __clockid_t clockid_t;
1779 typedef __timer_t timer_t;
1780 struct tm
1781 {
1782 int tm_sec;
1783 int tm_min;
1784 int tm_hour;
1785 int tm_mday;
1786 int tm_mon;
1787 int tm_year;
1788 int tm_wday;
1789 int tm_yday;
1790 int tm_isdst;
1791 long int tm_gmtoff;
1792 __const char *tm_zone;
1793 };
1794 struct itimerspec
1795 {
1796 struct timespec it_interval;
1797 struct timespec it_value;
1798 };
1799 struct sigevent;
1800 extern clock_t clock(void) __attribute__((__nothrow__, __leaf__));
1801 extern time_t time(time_t *__timer) __attribute__((__nothrow__, __leaf__));
1802 extern double difftime(time_t __time1, time_t __time0) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
1803 extern time_t mktime(struct tm *__tp) __attribute__((__nothrow__, __leaf__));
1804 extern size_t strftime(char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) __attribute__((__nothrow__, __leaf__));
1805 typedef struct __locale_struct
1806 {
1807 struct __locale_data *__locales[13];
1808 const unsigned short int *__ctype_b;
1809 const int *__ctype_tolower;
1810 const int *__ctype_toupper;
1811 const char *__names[13];
1812 } *__locale_t;
1813 typedef __locale_t locale_t;
1814 extern size_t strftime_l(char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp, __locale_t __loc) __attribute__((__nothrow__, __leaf__));
1815 extern struct tm *gmtime(__const time_t *__timer) __attribute__((__nothrow__, __leaf__));
1816 extern struct tm *localtime(__const time_t *__timer) __attribute__((__nothrow__, __leaf__));
1817 extern struct tm *gmtime_r(__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__((__nothrow__, __leaf__));
1818 extern struct tm *localtime_r(__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__((__nothrow__, __leaf__));
1819 extern char *asctime(__const struct tm *__tp) __attribute__((__nothrow__, __leaf__));
1820 extern char *ctime(__const time_t *__timer) __attribute__((__nothrow__, __leaf__));
1821 extern char *asctime_r(__const struct tm *__restrict __tp, char *__restrict __buf) __attribute__((__nothrow__, __leaf__));
1822 extern char *ctime_r(__const time_t *__restrict __timer, char *__restrict __buf) __attribute__((__nothrow__, __leaf__));
1823 extern char *__tzname[2];
1824 extern int __daylight;
1825 extern long int __timezone;
1826 extern char *tzname[2];
1827 extern void tzset(void) __attribute__((__nothrow__, __leaf__));
1828 extern int daylight;
1829 extern long int timezone;
1830 extern int stime(__const time_t *__when) __attribute__((__nothrow__, __leaf__));
1831 extern time_t timegm(struct tm *__tp) __attribute__((__nothrow__, __leaf__));
1832 extern time_t timelocal(struct tm *__tp) __attribute__((__nothrow__, __leaf__));
1833 extern int dysize(int __year) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
1834 extern int nanosleep(__const struct timespec *__requested_time, struct timespec *__remaining);
1835 extern int clock_getres(clockid_t __clock_id, struct timespec *__res) __attribute__((__nothrow__, __leaf__));
1836 extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp) __attribute__((__nothrow__, __leaf__));
1837 extern int clock_settime(clockid_t __clock_id, __const struct timespec *__tp) __attribute__((__nothrow__, __leaf__));
1838 extern int clock_nanosleep(clockid_t __clock_id, int __flags, __const struct timespec *__req, struct timespec *__rem);
1839 extern int clock_getcpuclockid(pid_t __pid, clockid_t *__clock_id) __attribute__((__nothrow__, __leaf__));
1840 extern int timer_create(clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __attribute__((__nothrow__, __leaf__));
1841 extern int timer_delete(timer_t __timerid) __attribute__((__nothrow__, __leaf__));
1842 extern int timer_settime(timer_t __timerid, int __flags, __const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __attribute__((__nothrow__, __leaf__));
1843 extern int timer_gettime(timer_t __timerid, struct itimerspec *__value) __attribute__((__nothrow__, __leaf__));
1844 extern int timer_getoverrun(timer_t __timerid) __attribute__((__nothrow__, __leaf__));
1845 typedef unsigned long int pthread_t;
1846 typedef union
1847 {
1848 char __size[56];
1849 long int __align;
1850 } pthread_attr_t;
1851 typedef struct __pthread_internal_list
1852 {
1853 struct __pthread_internal_list *__prev;
1854 struct __pthread_internal_list *__next;
1855 } __pthread_list_t;
1856 typedef union
1857 {
1858 struct __pthread_mutex_s
1859 {
1860 int __lock;
1861 unsigned int __count;
1862 int __owner;
1863 unsigned int __nusers;
1864 int __kind;
1865 int __spins;
1866 __pthread_list_t __list;
1867 } __data;
1868 char __size[40];
1869 long int __align;
1870 } pthread_mutex_t;
1871 typedef union
1872 {
1873 char __size[4];
1874 int __align;
1875 } pthread_mutexattr_t;
1876 typedef union
1877 {
1878 struct
1879 {
1880 int __lock;
1881 unsigned int __futex;
1882 __extension__
1883 unsigned long long int __total_seq;
1884 __extension__
1885 unsigned long long int __wakeup_seq;
1886 __extension__
1887 unsigned long long int __woken_seq;
1888 void *__mutex;
1889 unsigned int __nwaiters;
1890 unsigned int __broadcast_seq;
1891 } __data;
1892 char __size[48];
1893 __extension__
1894 long long int __align;
1895 } pthread_cond_t;
1896 typedef union
1897 {
1898 char __size[4];
1899 int __align;
1900 } pthread_condattr_t;
1901 typedef unsigned int pthread_key_t;
1902 typedef int pthread_once_t;
1903 typedef union
1904 {
1905 struct
1906 {
1907 int __lock;
1908 unsigned int __nr_readers;
1909 unsigned int __readers_wakeup;
1910 unsigned int __writer_wakeup;
1911 unsigned int __nr_readers_queued;
1912 unsigned int __nr_writers_queued;
1913 int __writer;
1914 int __shared;
1915 unsigned long int __pad1;
1916 unsigned long int __pad2;
1917 unsigned int __flags;
1918 } __data;
1919 char __size[56];
1920 long int __align;
1921 } pthread_rwlock_t;
1922 typedef union
1923 {
1924 char __size[8];
1925 long int __align;
1926 } pthread_rwlockattr_t;
1927 typedef volatile int pthread_spinlock_t;
1928 typedef union
1929 {
1930 char __size[32];
1931 long int __align;
1932 } pthread_barrier_t;
1933 typedef union
1934 {
1935 char __size[4];
1936 int __align;
1937 } pthread_barrierattr_t;
1938 typedef long int __jmp_buf[8];
1939 enum
1940 {
1941 PTHREAD_CREATE_JOINABLE,
1942 PTHREAD_CREATE_DETACHED
1943 };
1944 enum
1945 {
1946 PTHREAD_MUTEX_TIMED_NP,
1947 PTHREAD_MUTEX_RECURSIVE_NP,
1948 PTHREAD_MUTEX_ERRORCHECK_NP,
1949 PTHREAD_MUTEX_ADAPTIVE_NP,
1950 PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
1951 PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
1952 PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
1953 PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
1954 };
1955 enum
1956 {
1957 PTHREAD_MUTEX_STALLED,
1958 PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
1959 PTHREAD_MUTEX_ROBUST,
1960 PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
1961 };
1962 enum
1963 {
1964 PTHREAD_RWLOCK_PREFER_READER_NP,
1965 PTHREAD_RWLOCK_PREFER_WRITER_NP,
1966 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
1967 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
1968 };
1969 enum
1970 {
1971 PTHREAD_INHERIT_SCHED,
1972 PTHREAD_EXPLICIT_SCHED
1973 };
1974 enum
1975 {
1976 PTHREAD_SCOPE_SYSTEM,
1977 PTHREAD_SCOPE_PROCESS
1978 };
1979 enum
1980 {
1981 PTHREAD_PROCESS_PRIVATE,
1982 PTHREAD_PROCESS_SHARED
1983 };
1984 struct _pthread_cleanup_buffer
1985 {
1986 void (*__routine)(void *);
1987 void *__arg;
1988 int __canceltype;
1989 struct _pthread_cleanup_buffer *__prev;
1990 };
1991 enum
1992 {
1993 PTHREAD_CANCEL_ENABLE,
1994 PTHREAD_CANCEL_DISABLE
1995 };
1996 enum
1997 {
1998 PTHREAD_CANCEL_DEFERRED,
1999 PTHREAD_CANCEL_ASYNCHRONOUS
2000 };
2001 extern int pthread_create(pthread_t *__restrict __newthread, __const pthread_attr_t *__restrict __attr, void *(*__start_routine)(void *), void *__restrict __arg) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 3)));
2002 extern void pthread_exit(void *__retval) __attribute__((__noreturn__));
2003 extern int pthread_join(pthread_t __th, void **__thread_return);
2004 extern int pthread_detach(pthread_t __th) __attribute__((__nothrow__, __leaf__));
2005 extern pthread_t pthread_self(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2006 extern int pthread_equal(pthread_t __thread1, pthread_t __thread2) __attribute__((__nothrow__, __leaf__));
2007 extern int pthread_attr_init(pthread_attr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2008 extern int pthread_attr_destroy(pthread_attr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2009 extern int pthread_attr_getdetachstate(__const pthread_attr_t *__attr, int *__detachstate) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2010 extern int pthread_attr_setdetachstate(pthread_attr_t *__attr, int __detachstate) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2011 extern int pthread_attr_getguardsize(__const pthread_attr_t *__attr, size_t *__guardsize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2012 extern int pthread_attr_setguardsize(pthread_attr_t *__attr, size_t __guardsize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2013 extern int pthread_attr_getschedparam(__const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2014 extern int pthread_attr_setschedparam(pthread_attr_t *__restrict __attr, __const struct sched_param *__restrict __param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2015 extern int pthread_attr_getschedpolicy(__const pthread_attr_t *__restrict __attr, int *__restrict __policy) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2016 extern int pthread_attr_setschedpolicy(pthread_attr_t *__attr, int __policy) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2017 extern int pthread_attr_getinheritsched(__const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2018 extern int pthread_attr_setinheritsched(pthread_attr_t *__attr, int __inherit) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2019 extern int pthread_attr_getscope(__const pthread_attr_t *__restrict __attr, int *__restrict __scope) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2020 extern int pthread_attr_setscope(pthread_attr_t *__attr, int __scope) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2021 extern int pthread_attr_getstackaddr(__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__deprecated__));
2022 extern int pthread_attr_setstackaddr(pthread_attr_t *__attr, void *__stackaddr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__deprecated__));
2023 extern int pthread_attr_getstacksize(__const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2024 extern int pthread_attr_setstacksize(pthread_attr_t *__attr, size_t __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2025 extern int pthread_attr_getstack(__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2, 3)));
2026 extern int pthread_attr_setstack(pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2027 extern int pthread_setschedparam(pthread_t __target_thread, int __policy, __const struct sched_param *__param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3)));
2028 extern int pthread_getschedparam(pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3)));
2029 extern int pthread_setschedprio(pthread_t __target_thread, int __prio) __attribute__((__nothrow__, __leaf__));
2030 extern int pthread_once(pthread_once_t *__once_control, void (*__init_routine)(void)) __attribute__((__nonnull__(1, 2)));
2031 extern int pthread_setcancelstate(int __state, int *__oldstate);
2032 extern int pthread_setcanceltype(int __type, int *__oldtype);
2033 extern int pthread_cancel(pthread_t __th);
2034 extern void pthread_testcancel(void);
2035 typedef struct
2036 {
2037 struct
2038 {
2039 __jmp_buf __cancel_jmp_buf;
2040 int __mask_was_saved;
2041 } __cancel_jmp_buf[1];
2042 void *__pad[4];
2043 } __pthread_unwind_buf_t __attribute__((__aligned__));
2044 struct __pthread_cleanup_frame
2045 {
2046 void (*__cancel_routine)(void *);
2047 void *__cancel_arg;
2048 int __do_it;
2049 int __cancel_type;
2050 };
2051 extern void __pthread_register_cancel(__pthread_unwind_buf_t *__buf);
2052 extern void __pthread_unregister_cancel(__pthread_unwind_buf_t *__buf);
2053 extern void __pthread_unwind_next(__pthread_unwind_buf_t *__buf) __attribute__((__noreturn__)) __attribute__((__weak__));
2054 struct __jmp_buf_tag;
2055 extern int __sigsetjmp(struct __jmp_buf_tag *__env, int __savemask) __attribute__((__nothrow__, __leaf__));
2056 extern int pthread_mutex_init(pthread_mutex_t *__mutex, __const pthread_mutexattr_t *__mutexattr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2057 extern int pthread_mutex_destroy(pthread_mutex_t *__mutex) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2058 extern int pthread_mutex_trylock(pthread_mutex_t *__mutex) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2059 extern int pthread_mutex_lock(pthread_mutex_t *__mutex) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2060 extern int pthread_mutex_timedlock(pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 2)));
2061 extern int pthread_mutex_unlock(pthread_mutex_t *__mutex) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2062 extern int pthread_mutex_getprioceiling(__const pthread_mutex_t *__restrict __mutex, int *__restrict __prioceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2063 extern int pthread_mutex_setprioceiling(pthread_mutex_t *__restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 3)));
2064 extern int pthread_mutex_consistent(pthread_mutex_t *__mutex) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2065 extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2066 extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2067 extern int pthread_mutexattr_getpshared(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2068 extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2069 extern int pthread_mutexattr_gettype(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2070 extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, int __kind) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2071 extern int pthread_mutexattr_getprotocol(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __protocol) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2072 extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr, int __protocol) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2073 extern int pthread_mutexattr_getprioceiling(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __prioceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2074 extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr, int __prioceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2075 extern int pthread_mutexattr_getrobust(__const pthread_mutexattr_t *__attr, int *__robustness) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2076 extern int pthread_mutexattr_setrobust(pthread_mutexattr_t *__attr, int __robustness) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2077 extern int pthread_rwlock_init(pthread_rwlock_t *__restrict __rwlock, __const pthread_rwlockattr_t *__restrict __attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2078 extern int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2079 extern int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2080 extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2081 extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *__restrict __rwlock, __const struct timespec *__restrict __abstime) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 2)));
2082 extern int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2083 extern int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2084 extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *__restrict __rwlock, __const struct timespec *__restrict __abstime) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 2)));
2085 extern int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2086 extern int pthread_rwlockattr_init(pthread_rwlockattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2087 extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2088 extern int pthread_rwlockattr_getpshared(__const pthread_rwlockattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2089 extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2090 extern int pthread_rwlockattr_getkind_np(__const pthread_rwlockattr_t *__restrict __attr, int *__restrict __pref) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2091 extern int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *__attr, int __pref) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2092 extern int pthread_cond_init(pthread_cond_t *__restrict __cond, __const pthread_condattr_t *__restrict __cond_attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2093 extern int pthread_cond_destroy(pthread_cond_t *__cond) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2094 extern int pthread_cond_signal(pthread_cond_t *__cond) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2095 extern int pthread_cond_broadcast(pthread_cond_t *__cond) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2096 extern int pthread_cond_wait(pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex) __attribute__((__nonnull__(1, 2)));
2097 extern int pthread_cond_timedwait(pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime) __attribute__((__nonnull__(1, 2, 3)));
2098 extern int pthread_condattr_init(pthread_condattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2099 extern int pthread_condattr_destroy(pthread_condattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2100 extern int pthread_condattr_getpshared(__const pthread_condattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2101 extern int pthread_condattr_setpshared(pthread_condattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2102 extern int pthread_condattr_getclock(__const pthread_condattr_t *__restrict __attr, __clockid_t *__restrict __clock_id) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2103 extern int pthread_condattr_setclock(pthread_condattr_t *__attr, __clockid_t __clock_id) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2104 extern int pthread_spin_init(pthread_spinlock_t *__lock, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2105 extern int pthread_spin_destroy(pthread_spinlock_t *__lock) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2106 extern int pthread_spin_lock(pthread_spinlock_t *__lock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2107 extern int pthread_spin_trylock(pthread_spinlock_t *__lock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2108 extern int pthread_spin_unlock(pthread_spinlock_t *__lock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2109 extern int pthread_barrier_init(pthread_barrier_t *__restrict __barrier, __const pthread_barrierattr_t *__restrict __attr, unsigned int __count) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2110 extern int pthread_barrier_destroy(pthread_barrier_t *__barrier) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2111 extern int pthread_barrier_wait(pthread_barrier_t *__barrier) __attribute__((__nothrow__)) __attribute__((__nonnull__(1)));
2112 extern int pthread_barrierattr_init(pthread_barrierattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2113 extern int pthread_barrierattr_destroy(pthread_barrierattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2114 extern int pthread_barrierattr_getpshared(__const pthread_barrierattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
2115 extern int pthread_barrierattr_setpshared(pthread_barrierattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2116 extern int pthread_key_create(pthread_key_t *__key, void (*__destr_function)(void *)) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
2117 extern int pthread_key_delete(pthread_key_t __key) __attribute__((__nothrow__, __leaf__));
2118 extern void *pthread_getspecific(pthread_key_t __key) __attribute__((__nothrow__, __leaf__));
2119 extern int pthread_setspecific(pthread_key_t __key, __const void *__pointer) __attribute__((__nothrow__, __leaf__));
2120 extern int pthread_getcpuclockid(pthread_t __thread_id, __clockid_t *__clock_id) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
2121 extern int pthread_atfork(void (*__prepare)(void), void (*__parent)(void), void (*__child)(void)) __attribute__((__nothrow__, __leaf__));
2122 extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) pthread_equal(pthread_t __thread1, pthread_t __thread2)
2123 {
2124 return __thread1 == __thread2;
2125 }
2126 extern int *__errno_location(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2127 void *av_malloc(unsigned int size) __attribute__((__malloc__));
2128 void *av_realloc(void *ptr, unsigned int size);
2129 void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);
2130 void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size);
2131 void av_free(void *ptr);
2132 void *av_mallocz(unsigned int size) __attribute__((__malloc__));
2133 char *av_strdup(const char *s) __attribute__((__malloc__));
2134 void av_freep(void *ptr);
2135 static __attribute__((always_inline)) inline uint32_t pack16to32(int a, int b)
2136 {
2137 return (a & 0xFFFF) + (b << 16);
2138 }
2139 static __attribute__((always_inline)) inline uint16_t pack8to16(int a, int b)
2140 {
2141 return (a & 0xFF) + (b << 8);
2142 }
2143 typedef short DCTELEM;
2144 enum AVColorPrimaries
2145 {
2146 AVCOL_PRI_BT709 = 1,
2147 AVCOL_PRI_UNSPECIFIED = 2,
2148 AVCOL_PRI_BT470M = 4,
2149 AVCOL_PRI_BT470BG = 5,
2150 AVCOL_PRI_SMPTE170M = 6,
2151 AVCOL_PRI_SMPTE240M = 7,
2152 AVCOL_PRI_FILM = 8,
2153 AVCOL_PRI_NB
2154 };
2155 enum AVColorTransferCharacteristic
2156 {
2157 AVCOL_TRC_BT709 = 1,
2158 AVCOL_TRC_UNSPECIFIED = 2,
2159 AVCOL_TRC_GAMMA22 = 4,
2160 AVCOL_TRC_GAMMA28 = 5,
2161 AVCOL_TRC_NB
2162 };
2163 enum AVColorSpace
2164 {
2165 AVCOL_SPC_RGB = 0,
2166 AVCOL_SPC_BT709 = 1,
2167 AVCOL_SPC_UNSPECIFIED = 2,
2168 AVCOL_SPC_FCC = 4,
2169 AVCOL_SPC_BT470BG = 5,
2170 AVCOL_SPC_SMPTE170M = 6,
2171 AVCOL_SPC_SMPTE240M = 7,
2172 AVCOL_SPC_NB
2173 };
2174 enum AVColorRange
2175 {
2176 AVCOL_RANGE_UNSPECIFIED = 0,
2177 AVCOL_RANGE_MPEG = 1,
2178 AVCOL_RANGE_JPEG = 2,
2179 AVCOL_RANGE_NB
2180 };
2181 typedef enum MMCOOpcode
2182 {
2183 MMCO_END = 0,
2184 MMCO_SHORT2UNUSED,
2185 MMCO_LONG2UNUSED,
2186 MMCO_SHORT2LONG,
2187 MMCO_SET_MAX_LONG,
2188 MMCO_RESET,
2189 MMCO_LONG
2190 } MMCOOpcode;
2191 enum
2192 {
2193 NAL_SLICE = 1,
2194 NAL_DPA,
2195 NAL_DPB,
2196 NAL_DPC,
2197 NAL_IDR_SLICE,
2198 NAL_SEI,
2199 NAL_SPS,
2200 NAL_PPS,
2201 NAL_AUD,
2202 NAL_END_SEQUENCE,
2203 NAL_END_STREAM,
2204 NAL_FILLER_DATA,
2205 NAL_SPS_EXT,
2206 NAL_AUXILIARY_SLICE = 19
2207 };
2208 typedef enum
2209 {
2210 SEI_BUFFERING_PERIOD = 0,
2211 SEI_TYPE_PIC_TIMING = 1,
2212 SEI_TYPE_USER_DATA_UNREGISTERED = 5,
2213 SEI_TYPE_RECOVERY_POINT = 6
2214 } SEI_Type;
2215 typedef enum
2216 {
2217 SEI_PIC_STRUCT_FRAME = 0,
2218 SEI_PIC_STRUCT_TOP_FIELD = 1,
2219 SEI_PIC_STRUCT_BOTTOM_FIELD = 2,
2220 SEI_PIC_STRUCT_TOP_BOTTOM = 3,
2221 SEI_PIC_STRUCT_BOTTOM_TOP = 4,
2222 SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5,
2223 SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6,
2224 SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
2225 SEI_PIC_STRUCT_FRAME_TRIPLING = 8
2226 } SEI_PicStructType;
2227 typedef struct SPS
2228 {
2229 int profile_idc;
2230 int level_idc;
2231 int chroma_format_idc;
2232 int transform_bypass;
2233 int log2_max_frame_num;
2234 int poc_type;
2235 int log2_max_poc_lsb;
2236 int delta_pic_order_always_zero_flag;
2237 int offset_for_non_ref_pic;
2238 int offset_for_top_to_bottom_field;
2239 int poc_cycle_length;
2240 int ref_frame_count;
2241 int gaps_in_frame_num_allowed_flag;
2242 int mb_width;
2243 int mb_height;
2244 int frame_mbs_only_flag;
2245 int mb_aff;
2246 int direct_8x8_inference_flag;
2247 int crop;
2248 unsigned int crop_left;
2249 unsigned int crop_right;
2250 unsigned int crop_top;
2251 unsigned int crop_bottom;
2252 int vui_parameters_present_flag;
2253 int num, den;
2254 int video_signal_type_present_flag;
2255 int full_range;
2256 int colour_description_present_flag;
2257 enum AVColorPrimaries color_primaries;
2258 enum AVColorTransferCharacteristic color_trc;
2259 enum AVColorSpace colorspace;
2260 int timing_info_present_flag;
2261 uint32_t num_units_in_tick;
2262 uint32_t time_scale;
2263 int fixed_frame_rate_flag;
2264 short offset_for_ref_frame[256];
2265 int bitstream_restriction_flag;
2266 int num_reorder_frames;
2267 int scaling_matrix_present;
2268 uint8_t scaling_matrix4[6][16];
2269 uint8_t scaling_matrix8[2][64];
2270 int nal_hrd_parameters_present_flag;
2271 int vcl_hrd_parameters_present_flag;
2272 int pic_struct_present_flag;
2273 int time_offset_length;
2274 int cpb_cnt;
2275 int initial_cpb_removal_delay_length;
2276 int cpb_removal_delay_length;
2277 int dpb_output_delay_length;
2278 int bit_depth_luma;
2279 int bit_depth_chroma;
2280 int residual_color_transform_flag;
2281 } SPS;
2282 typedef struct PPS
2283 {
2284 unsigned int sps_id;
2285 int cabac;
2286 int pic_order_present;
2287 int slice_group_count;
2288 int mb_slice_group_map_type;
2289 unsigned int ref_count[2];
2290 int weighted_pred;
2291 int weighted_bipred_idc;
2292 int init_qp;
2293 int init_qs;
2294 int chroma_qp_index_offset[2];
2295 int deblocking_filter_parameters_present;
2296 int constrained_intra_pred;
2297 int redundant_pic_cnt_present;
2298 int transform_8x8_mode;
2299 uint8_t scaling_matrix4[6][16];
2300 uint8_t scaling_matrix8[2][64];
2301 uint8_t chroma_qp_table[2][64];
2302 int chroma_qp_diff;
2303 } PPS;
2304 typedef struct TopBorder
2305 {
2306 uint8_t unfiltered_y[16];
2307 uint8_t unfiltered_cb[8];
2308 uint8_t unfiltered_cr[8];
2309 uint8_t top_borders_y[16 * 4];
2310 uint8_t top_borders_cb[8 * 2];
2311 uint8_t top_borders_cr[8 * 2];
2312 } TopBorder;
2313 typedef struct LeftBorder
2314 {
2315 uint8_t unfiltered_y[17];
2316 uint8_t unfiltered_cb[9];
2317 uint8_t unfiltered_cr[9];
2318 } LeftBorder;
2319 typedef struct H264Mb
2320 {
2321 int16_t mb_x, mb_y;
2322 int32_t mb_type;
2323 uint16_t cbp;
2324 int8_t qscale_mb_xy;
2325 int8_t qscale_left_mb_xy;
2326 int8_t qscale_top_mb_xy;
2327 uint16_t __attribute__((aligned(8))) sub_mb_type[4];
2328 uint8_t __attribute__((aligned(8))) non_zero_count[24];
2329 int16_t __attribute__((aligned(16))) mb[16 * 24];
2330 union
2331 {
2332 struct
2333 {
2334 int8_t __attribute__((aligned(8))) ref_index[2][4];
2335 int16_t __attribute__((aligned(16))) mvd[2][16][2];
2336 };
2337 struct
2338 {
2339 int8_t __attribute__((aligned(8))) intra4x4_pred_mode[16];
2340 int8_t chroma_pred_mode;
2341 int8_t intra16x16_pred_mode;
2342 };
2343 };
2344 uint8_t __attribute__((aligned(8))) top_border[16 + 2 * 8];
2345 uint8_t __attribute__((aligned(8))) top_border_next[8];
2346 uint8_t __attribute__((aligned(8))) left_border[17 + 2 * 9];
2347 int8_t intra4x4_pred_mode_left[4];
2348 } H264Mb;
2349 typedef struct RawFrame
2350 {
2351 uint8_t *data;
2352 int size;
2353 unsigned int data_size;
2354 int64_t pos;
2355 int state;
2356 } RawFrame;
2357 typedef struct PictureInfo
2358 {
2359 int ref_poc[2][16];
2360 int ref_count[2];
2361 int poc;
2362 int frame_num;
2363 int pic_id;
2364 int long_ref;
2365 int cpn;
2366 int slice_type_nos;
2367 int reference;
2368 } PictureInfo;
2369 typedef struct DecodedPicture
2370 {
2371 int16_t (*motion_val[2])[2];
2372 int16_t (*motion_val_base[2])[2];
2373 int8_t *ref_index[2];
2374 uint32_t *mb_type;
2375 uint32_t *mb_type_base;
2376 int8_t *intra4x4_pred_mode;
2377 int8_t *non_zero_count;
2378 uint8_t *data[3];
2379 int linesize[3];
2380 uint8_t *base[3];
2381 int cpn;
2382 int poc;
2383 int reference;
2384 int key_frame;
2385 int mmco_reset;
2386 } DecodedPicture;
2387 extern void __assert_fail(__const char *__assertion, __const char *__file, unsigned int __line, __const char *__function) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
2388 extern void __assert_perror_fail(int __errnum, __const char *__file, unsigned int __line, __const char *__function) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
2389 extern void __assert(const char *__assertion, const char *__file, int __line) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
2390 typedef int64_t x86_reg;
2391 typedef struct CABACContext
2392 {
2393 int low;
2394 int range;
2395 int outstanding_count;
2396 const uint8_t *bytestream_start;
2397 const uint8_t *bytestream;
2398 const uint8_t *bytestream_end;
2399 uint8_t cabac_state[460];
2400 } CABACContext;
2401 extern uint8_t ff_h264_mlps_state[4 * 64];
2402 extern uint8_t ff_h264_lps_range[4 * 2 * 64];
2403 extern uint8_t ff_h264_mps_state[2 * 64];
2404 extern uint8_t ff_h264_lps_state[2 * 64];
2405 extern const uint8_t ff_h264_norm_shift[512];
2406 void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
2407 void ff_init_cabac_states(void);
2408 static void refill(CABACContext *c)
2409 {
2410 c->low += (c->bytestream[0] << 9) + (c->bytestream[1] << 1);
2411 c->low -= ((1 << 16) - 1);
2412 c->bytestream += 16 / 8;
2413 }
2414 static void refill2(CABACContext *c)
2415 {
2416 int i, x;
2417 x = c->low ^ (c->low - 1);
2418 i = 7 - ff_h264_norm_shift[x >> (16 - 1)];
2419 x = - ((1 << 16) - 1);
2420 x += (c->bytestream[0] << 9) + (c->bytestream[1] << 1);
2421 c->low += x << i;
2422 c->bytestream += 16 / 8;
2423 }
2424 static inline void renorm_cabac_decoder(CABACContext *c)
2425 {
2426 while (c->range < 0x100)
2427 {
2428 c->range += c->range;
2429 c->low += c->low;
2430 if (!(c->low & ((1 << 16) - 1)))
2431 refill(c);
2432 }
2433 }
2434 static inline void renorm_cabac_decoder_once(CABACContext *c)
2435 {
2436 int shift = (uint32_t) (c->range - 0x100) >> 31;
2437 c->range <<= shift;
2438 c->low <<= shift;
2439 if (!(c->low & ((1 << 16) - 1)))
2440 refill(c);
2441 }
2442 static __attribute__((always_inline)) inline int get_cabac_inline(CABACContext *c, uint8_t *const state)
2443 {
2444 int s = *state;
2445 int RangeLPS = ff_h264_lps_range[2 * (c->range & 0xC0) + s];
2446 int bit, lps_mask __attribute__((unused));
2447 c->range -= RangeLPS;
2448 lps_mask = ((c->range << (16 + 1)) - c->low) >> 31;
2449 c->low -= (c->range << (16 + 1)) & lps_mask;
2450 c->range += (RangeLPS - c->range) & lps_mask;
2451 s ^= lps_mask;
2452 *state = (ff_h264_mlps_state + 128)[s];
2453 bit = s & 1;
2454 lps_mask = ff_h264_norm_shift[c->range];
2455 c->range <<= lps_mask;
2456 c->low <<= lps_mask;
2457 if (!(c->low & ((1 << 16) - 1)))
2458 refill2(c);
2459 return bit;
2460 }
2461 static int __attribute__((noinline)) __attribute__((unused)) get_cabac_noinline(CABACContext *c, uint8_t *const state)
2462 {
2463 return get_cabac_inline(c, state);
2464 }
2465 static int __attribute__((unused)) get_cabac(CABACContext *c, uint8_t *const state)
2466 {
2467 return get_cabac_inline(c, state);
2468 }
2469 static int __attribute__((unused)) get_cabac_bypass(CABACContext *c)
2470 {
2471 int range;
2472 c->low += c->low;
2473 if (!(c->low & ((1 << 16) - 1)))
2474 refill(c);
2475 range = c->range << (16 + 1);
2476 if (c->low < range)
2477 {
2478 return 0;
2479 }
2480 else
2481 {
2482 c->low -= range;
2483 return 1;
2484 }
2485 }
2486 static __attribute__((always_inline)) inline int get_cabac_bypass_sign(CABACContext *c, int val)
2487 {
2488 int range, mask;
2489 c->low += c->low;
2490 if (!(c->low & ((1 << 16) - 1)))
2491 refill(c);
2492 range = c->range << (16 + 1);
2493 c->low -= range;
2494 mask = c->low >> 31;
2495 range &= mask;
2496 c->low += range;
2497 return (val ^ mask) - mask;
2498 }
2499 static int __attribute__((unused)) get_cabac_terminate(CABACContext *c)
2500 {
2501 c->range -= 2;
2502 if (c->low < c->range << (16 + 1))
2503 {
2504 renorm_cabac_decoder_once(c);
2505 return 0;
2506 }
2507 else
2508 {
2509 return c->bytestream - c->bytestream_start;
2510 }
2511 }
2512 static __attribute__((always_inline)) inline __attribute__((const)) uint16_t bswap_16(uint16_t x)
2513 {
2514 __asm__ ("rorw $8, %0": "+r" (x): );
2515 return x;
2516 }
2517 static __attribute__((always_inline)) inline __attribute__((const)) uint32_t bswap_32(uint32_t x)
2518 {
2519 __asm__ ("bswap %0": "+r" (x): );
2520 return x;
2521 }
2522 static inline uint64_t __attribute__((const)) bswap_64(uint64_t x)
2523 {
2524 __asm__ ("bswap %0": "=r" (x): "0" (x));
2525 return x;
2526 }
2527 enum
2528 {
2529 _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
2530 _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
2531 _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
2532 _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
2533 _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
2534 _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
2535 _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
2536 _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
2537 _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
2538 _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
2539 _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
2540 _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
2541 };
2542 extern __const unsigned short int **__ctype_b_loc(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const));
2543 extern __const __int32_t **__ctype_tolower_loc(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const));
2544 extern __const __int32_t **__ctype_toupper_loc(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const));
2545 extern int isalnum(int) __attribute__((__nothrow__, __leaf__));
2546 extern int isalpha(int) __attribute__((__nothrow__, __leaf__));
2547 extern int iscntrl(int) __attribute__((__nothrow__, __leaf__));
2548 extern int isdigit(int) __attribute__((__nothrow__, __leaf__));
2549 extern int islower(int) __attribute__((__nothrow__, __leaf__));
2550 extern int isgraph(int) __attribute__((__nothrow__, __leaf__));
2551 extern int isprint(int) __attribute__((__nothrow__, __leaf__));
2552 extern int ispunct(int) __attribute__((__nothrow__, __leaf__));
2553 extern int isspace(int) __attribute__((__nothrow__, __leaf__));
2554 extern int isupper(int) __attribute__((__nothrow__, __leaf__));
2555 extern int isxdigit(int) __attribute__((__nothrow__, __leaf__));
2556 extern int tolower(int __c) __attribute__((__nothrow__, __leaf__));
2557 extern int toupper(int __c) __attribute__((__nothrow__, __leaf__));
2558 extern int isblank(int) __attribute__((__nothrow__, __leaf__));
2559 extern int isascii(int __c) __attribute__((__nothrow__, __leaf__));
2560 extern int toascii(int __c) __attribute__((__nothrow__, __leaf__));
2561 extern int _toupper(int) __attribute__((__nothrow__, __leaf__));
2562 extern int _tolower(int) __attribute__((__nothrow__, __leaf__));
2563 extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) tolower(int __c)
2564 {
2565 return __c >= - 128 && __c < 256 ? (*__ctype_tolower_loc())[__c] : __c;
2566 }
2567 extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) toupper(int __c)
2568 {
2569 return __c >= - 128 && __c < 256 ? (*__ctype_toupper_loc())[__c] : __c;
2570 }
2571 extern int isalnum_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2572 extern int isalpha_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2573 extern int iscntrl_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2574 extern int isdigit_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2575 extern int islower_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2576 extern int isgraph_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2577 extern int isprint_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2578 extern int ispunct_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2579 extern int isspace_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2580 extern int isupper_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2581 extern int isxdigit_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2582 extern int isblank_l(int, __locale_t) __attribute__((__nothrow__, __leaf__));
2583 extern int __tolower_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__));
2584 extern int tolower_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__));
2585 extern int __toupper_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__));
2586 extern int toupper_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__));
2587 typedef int __gwchar_t;
2588 typedef struct
2589 {
2590 long int quot;
2591 long int rem;
2592 } imaxdiv_t;
2593 extern intmax_t imaxabs(intmax_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2594 extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2595 extern intmax_t strtoimax(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__));
2596 extern uintmax_t strtoumax(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__));
2597 extern intmax_t wcstoimax(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__));
2598 extern uintmax_t wcstoumax(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__));
2599 extern long int __strtol_internal(__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
2600 extern __inline __attribute__((__gnu_inline__)) intmax_t __attribute__((__nothrow__, __leaf__)) strtoimax(__const char *__restrict nptr, char **__restrict endptr, int base)
2601 {
2602 return __strtol_internal(nptr, endptr, base, 0);
2603 }
2604 extern unsigned long int __strtoul_internal(__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
2605 extern __inline __attribute__((__gnu_inline__)) uintmax_t __attribute__((__nothrow__, __leaf__)) strtoumax(__const char *__restrict nptr, char **__restrict endptr, int base)
2606 {
2607 return __strtoul_internal(nptr, endptr, base, 0);
2608 }
2609 extern long int __wcstol_internal(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
2610 extern __inline __attribute__((__gnu_inline__)) intmax_t __attribute__((__nothrow__, __leaf__)) wcstoimax(__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)
2611 {
2612 return __wcstol_internal(nptr, endptr, base, 0);
2613 }
2614 extern unsigned long int __wcstoul_internal(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
2615 extern __inline __attribute__((__gnu_inline__)) uintmax_t __attribute__((__nothrow__, __leaf__)) wcstoumax(__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)
2616 {
2617 return __wcstoul_internal(nptr, endptr, base, 0);
2618 }
2619 typedef float float_t;
2620 typedef double double_t;
2621 extern double acos(double __x) __attribute__((__nothrow__, __leaf__));
2622 extern double __acos(double __x) __attribute__((__nothrow__, __leaf__));
2623 extern double asin(double __x) __attribute__((__nothrow__, __leaf__));
2624 extern double __asin(double __x) __attribute__((__nothrow__, __leaf__));
2625 extern double atan(double __x) __attribute__((__nothrow__, __leaf__));
2626 extern double __atan(double __x) __attribute__((__nothrow__, __leaf__));
2627 extern double atan2(double __y, double __x) __attribute__((__nothrow__, __leaf__));
2628 extern double __atan2(double __y, double __x) __attribute__((__nothrow__, __leaf__));
2629 extern double cos(double __x) __attribute__((__nothrow__, __leaf__));
2630 extern double __cos(double __x) __attribute__((__nothrow__, __leaf__));
2631 extern double sin(double __x) __attribute__((__nothrow__, __leaf__));
2632 extern double __sin(double __x) __attribute__((__nothrow__, __leaf__));
2633 extern double tan(double __x) __attribute__((__nothrow__, __leaf__));
2634 extern double __tan(double __x) __attribute__((__nothrow__, __leaf__));
2635 extern double cosh(double __x) __attribute__((__nothrow__, __leaf__));
2636 extern double __cosh(double __x) __attribute__((__nothrow__, __leaf__));
2637 extern double sinh(double __x) __attribute__((__nothrow__, __leaf__));
2638 extern double __sinh(double __x) __attribute__((__nothrow__, __leaf__));
2639 extern double tanh(double __x) __attribute__((__nothrow__, __leaf__));
2640 extern double __tanh(double __x) __attribute__((__nothrow__, __leaf__));
2641 extern double acosh(double __x) __attribute__((__nothrow__, __leaf__));
2642 extern double __acosh(double __x) __attribute__((__nothrow__, __leaf__));
2643 extern double asinh(double __x) __attribute__((__nothrow__, __leaf__));
2644 extern double __asinh(double __x) __attribute__((__nothrow__, __leaf__));
2645 extern double atanh(double __x) __attribute__((__nothrow__, __leaf__));
2646 extern double __atanh(double __x) __attribute__((__nothrow__, __leaf__));
2647 extern double exp(double __x) __attribute__((__nothrow__, __leaf__));
2648 extern double __exp(double __x) __attribute__((__nothrow__, __leaf__));
2649 extern double frexp(double __x, int *__exponent) __attribute__((__nothrow__, __leaf__));
2650 extern double __frexp(double __x, int *__exponent) __attribute__((__nothrow__, __leaf__));
2651 extern double ldexp(double __x, int __exponent) __attribute__((__nothrow__, __leaf__));
2652 extern double __ldexp(double __x, int __exponent) __attribute__((__nothrow__, __leaf__));
2653 extern double log(double __x) __attribute__((__nothrow__, __leaf__));
2654 extern double __log(double __x) __attribute__((__nothrow__, __leaf__));
2655 extern double log10(double __x) __attribute__((__nothrow__, __leaf__));
2656 extern double __log10(double __x) __attribute__((__nothrow__, __leaf__));
2657 extern double modf(double __x, double *__iptr) __attribute__((__nothrow__, __leaf__));
2658 extern double __modf(double __x, double *__iptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
2659 extern double expm1(double __x) __attribute__((__nothrow__, __leaf__));
2660 extern double __expm1(double __x) __attribute__((__nothrow__, __leaf__));
2661 extern double log1p(double __x) __attribute__((__nothrow__, __leaf__));
2662 extern double __log1p(double __x) __attribute__((__nothrow__, __leaf__));
2663 extern double logb(double __x) __attribute__((__nothrow__, __leaf__));
2664 extern double __logb(double __x) __attribute__((__nothrow__, __leaf__));
2665 extern double exp2(double __x) __attribute__((__nothrow__, __leaf__));
2666 extern double __exp2(double __x) __attribute__((__nothrow__, __leaf__));
2667 extern double log2(double __x) __attribute__((__nothrow__, __leaf__));
2668 extern double __log2(double __x) __attribute__((__nothrow__, __leaf__));
2669 extern double pow(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2670 extern double __pow(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2671 extern double sqrt(double __x) __attribute__((__nothrow__, __leaf__));
2672 extern double __sqrt(double __x) __attribute__((__nothrow__, __leaf__));
2673 extern double hypot(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2674 extern double __hypot(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2675 extern double cbrt(double __x) __attribute__((__nothrow__, __leaf__));
2676 extern double __cbrt(double __x) __attribute__((__nothrow__, __leaf__));
2677 extern double ceil(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2678 extern double __ceil(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2679 extern double fabs(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2680 extern double __fabs(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2681 extern double floor(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2682 extern double __floor(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2683 extern double fmod(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2684 extern double __fmod(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2685 extern int __isinf(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2686 extern int __finite(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2687 extern int isinf(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2688 extern int finite(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2689 extern double drem(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2690 extern double __drem(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2691 extern double significand(double __x) __attribute__((__nothrow__, __leaf__));
2692 extern double __significand(double __x) __attribute__((__nothrow__, __leaf__));
2693 extern double copysign(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2694 extern double __copysign(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2695 extern double nan(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2696 extern double __nan(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2697 extern int __isnan(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2698 extern int isnan(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2699 extern double j0(double) __attribute__((__nothrow__, __leaf__));
2700 extern double __j0(double) __attribute__((__nothrow__, __leaf__));
2701 extern double j1(double) __attribute__((__nothrow__, __leaf__));
2702 extern double __j1(double) __attribute__((__nothrow__, __leaf__));
2703 extern double jn(int, double) __attribute__((__nothrow__, __leaf__));
2704 extern double __jn(int, double) __attribute__((__nothrow__, __leaf__));
2705 extern double y0(double) __attribute__((__nothrow__, __leaf__));
2706 extern double __y0(double) __attribute__((__nothrow__, __leaf__));
2707 extern double y1(double) __attribute__((__nothrow__, __leaf__));
2708 extern double __y1(double) __attribute__((__nothrow__, __leaf__));
2709 extern double yn(int, double) __attribute__((__nothrow__, __leaf__));
2710 extern double __yn(int, double) __attribute__((__nothrow__, __leaf__));
2711 extern double erf(double) __attribute__((__nothrow__, __leaf__));
2712 extern double __erf(double) __attribute__((__nothrow__, __leaf__));
2713 extern double erfc(double) __attribute__((__nothrow__, __leaf__));
2714 extern double __erfc(double) __attribute__((__nothrow__, __leaf__));
2715 extern double lgamma(double) __attribute__((__nothrow__, __leaf__));
2716 extern double __lgamma(double) __attribute__((__nothrow__, __leaf__));
2717 extern double tgamma(double) __attribute__((__nothrow__, __leaf__));
2718 extern double __tgamma(double) __attribute__((__nothrow__, __leaf__));
2719 extern double gamma(double) __attribute__((__nothrow__, __leaf__));
2720 extern double __gamma(double) __attribute__((__nothrow__, __leaf__));
2721 extern double lgamma_r(double, int *__signgamp) __attribute__((__nothrow__, __leaf__));
2722 extern double __lgamma_r(double, int *__signgamp) __attribute__((__nothrow__, __leaf__));
2723 extern double rint(double __x) __attribute__((__nothrow__, __leaf__));
2724 extern double __rint(double __x) __attribute__((__nothrow__, __leaf__));
2725 extern double nextafter(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2726 extern double __nextafter(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2727 extern double nexttoward(double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2728 extern double __nexttoward(double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2729 extern double remainder(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2730 extern double __remainder(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2731 extern double scalbn(double __x, int __n) __attribute__((__nothrow__, __leaf__));
2732 extern double __scalbn(double __x, int __n) __attribute__((__nothrow__, __leaf__));
2733 extern int ilogb(double __x) __attribute__((__nothrow__, __leaf__));
2734 extern int __ilogb(double __x) __attribute__((__nothrow__, __leaf__));
2735 extern double scalbln(double __x, long int __n) __attribute__((__nothrow__, __leaf__));
2736 extern double __scalbln(double __x, long int __n) __attribute__((__nothrow__, __leaf__));
2737 extern double nearbyint(double __x) __attribute__((__nothrow__, __leaf__));
2738 extern double __nearbyint(double __x) __attribute__((__nothrow__, __leaf__));
2739 extern double round(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2740 extern double __round(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2741 extern double trunc(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2742 extern double __trunc(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2743 extern double remquo(double __x, double __y, int *__quo) __attribute__((__nothrow__, __leaf__));
2744 extern double __remquo(double __x, double __y, int *__quo) __attribute__((__nothrow__, __leaf__));
2745 extern long int lrint(double __x) __attribute__((__nothrow__, __leaf__));
2746 extern long int __lrint(double __x) __attribute__((__nothrow__, __leaf__));
2747 extern long long int llrint(double __x) __attribute__((__nothrow__, __leaf__));
2748 extern long long int __llrint(double __x) __attribute__((__nothrow__, __leaf__));
2749 extern long int lround(double __x) __attribute__((__nothrow__, __leaf__));
2750 extern long int __lround(double __x) __attribute__((__nothrow__, __leaf__));
2751 extern long long int llround(double __x) __attribute__((__nothrow__, __leaf__));
2752 extern long long int __llround(double __x) __attribute__((__nothrow__, __leaf__));
2753 extern double fdim(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2754 extern double __fdim(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2755 extern double fmax(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2756 extern double __fmax(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2757 extern double fmin(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2758 extern double __fmin(double __x, double __y) __attribute__((__nothrow__, __leaf__));
2759 extern int __fpclassify(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2760 extern int __signbit(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2761 extern double fma(double __x, double __y, double __z) __attribute__((__nothrow__, __leaf__));
2762 extern double __fma(double __x, double __y, double __z) __attribute__((__nothrow__, __leaf__));
2763 extern double scalb(double __x, double __n) __attribute__((__nothrow__, __leaf__));
2764 extern double __scalb(double __x, double __n) __attribute__((__nothrow__, __leaf__));
2765 extern float acosf(float __x) __attribute__((__nothrow__, __leaf__));
2766 extern float __acosf(float __x) __attribute__((__nothrow__, __leaf__));
2767 extern float asinf(float __x) __attribute__((__nothrow__, __leaf__));
2768 extern float __asinf(float __x) __attribute__((__nothrow__, __leaf__));
2769 extern float atanf(float __x) __attribute__((__nothrow__, __leaf__));
2770 extern float __atanf(float __x) __attribute__((__nothrow__, __leaf__));
2771 extern float atan2f(float __y, float __x) __attribute__((__nothrow__, __leaf__));
2772 extern float __atan2f(float __y, float __x) __attribute__((__nothrow__, __leaf__));
2773 extern float cosf(float __x) __attribute__((__nothrow__, __leaf__));
2774 extern float __cosf(float __x) __attribute__((__nothrow__, __leaf__));
2775 extern float sinf(float __x) __attribute__((__nothrow__, __leaf__));
2776 extern float __sinf(float __x) __attribute__((__nothrow__, __leaf__));
2777 extern float tanf(float __x) __attribute__((__nothrow__, __leaf__));
2778 extern float __tanf(float __x) __attribute__((__nothrow__, __leaf__));
2779 extern float coshf(float __x) __attribute__((__nothrow__, __leaf__));
2780 extern float __coshf(float __x) __attribute__((__nothrow__, __leaf__));
2781 extern float sinhf(float __x) __attribute__((__nothrow__, __leaf__));
2782 extern float __sinhf(float __x) __attribute__((__nothrow__, __leaf__));
2783 extern float tanhf(float __x) __attribute__((__nothrow__, __leaf__));
2784 extern float __tanhf(float __x) __attribute__((__nothrow__, __leaf__));
2785 extern float acoshf(float __x) __attribute__((__nothrow__, __leaf__));
2786 extern float __acoshf(float __x) __attribute__((__nothrow__, __leaf__));
2787 extern float asinhf(float __x) __attribute__((__nothrow__, __leaf__));
2788 extern float __asinhf(float __x) __attribute__((__nothrow__, __leaf__));
2789 extern float atanhf(float __x) __attribute__((__nothrow__, __leaf__));
2790 extern float __atanhf(float __x) __attribute__((__nothrow__, __leaf__));
2791 extern float expf(float __x) __attribute__((__nothrow__, __leaf__));
2792 extern float __expf(float __x) __attribute__((__nothrow__, __leaf__));
2793 extern float frexpf(float __x, int *__exponent) __attribute__((__nothrow__, __leaf__));
2794 extern float __frexpf(float __x, int *__exponent) __attribute__((__nothrow__, __leaf__));
2795 extern float ldexpf(float __x, int __exponent) __attribute__((__nothrow__, __leaf__));
2796 extern float __ldexpf(float __x, int __exponent) __attribute__((__nothrow__, __leaf__));
2797 extern float logf(float __x) __attribute__((__nothrow__, __leaf__));
2798 extern float __logf(float __x) __attribute__((__nothrow__, __leaf__));
2799 extern float log10f(float __x) __attribute__((__nothrow__, __leaf__));
2800 extern float __log10f(float __x) __attribute__((__nothrow__, __leaf__));
2801 extern float modff(float __x, float *__iptr) __attribute__((__nothrow__, __leaf__));
2802 extern float __modff(float __x, float *__iptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
2803 extern float expm1f(float __x) __attribute__((__nothrow__, __leaf__));
2804 extern float __expm1f(float __x) __attribute__((__nothrow__, __leaf__));
2805 extern float log1pf(float __x) __attribute__((__nothrow__, __leaf__));
2806 extern float __log1pf(float __x) __attribute__((__nothrow__, __leaf__));
2807 extern float logbf(float __x) __attribute__((__nothrow__, __leaf__));
2808 extern float __logbf(float __x) __attribute__((__nothrow__, __leaf__));
2809 extern float exp2f(float __x) __attribute__((__nothrow__, __leaf__));
2810 extern float __exp2f(float __x) __attribute__((__nothrow__, __leaf__));
2811 extern float log2f(float __x) __attribute__((__nothrow__, __leaf__));
2812 extern float __log2f(float __x) __attribute__((__nothrow__, __leaf__));
2813 extern float powf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2814 extern float __powf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2815 extern float sqrtf(float __x) __attribute__((__nothrow__, __leaf__));
2816 extern float __sqrtf(float __x) __attribute__((__nothrow__, __leaf__));
2817 extern float hypotf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2818 extern float __hypotf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2819 extern float cbrtf(float __x) __attribute__((__nothrow__, __leaf__));
2820 extern float __cbrtf(float __x) __attribute__((__nothrow__, __leaf__));
2821 extern float ceilf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2822 extern float __ceilf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2823 extern float fabsf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2824 extern float __fabsf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2825 extern float floorf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2826 extern float __floorf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2827 extern float fmodf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2828 extern float __fmodf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2829 extern int __isinff(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2830 extern int __finitef(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2831 extern int isinff(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2832 extern int finitef(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2833 extern float dremf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2834 extern float __dremf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2835 extern float significandf(float __x) __attribute__((__nothrow__, __leaf__));
2836 extern float __significandf(float __x) __attribute__((__nothrow__, __leaf__));
2837 extern float copysignf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2838 extern float __copysignf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2839 extern float nanf(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2840 extern float __nanf(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2841 extern int __isnanf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2842 extern int isnanf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2843 extern float j0f(float) __attribute__((__nothrow__, __leaf__));
2844 extern float __j0f(float) __attribute__((__nothrow__, __leaf__));
2845 extern float j1f(float) __attribute__((__nothrow__, __leaf__));
2846 extern float __j1f(float) __attribute__((__nothrow__, __leaf__));
2847 extern float jnf(int, float) __attribute__((__nothrow__, __leaf__));
2848 extern float __jnf(int, float) __attribute__((__nothrow__, __leaf__));
2849 extern float y0f(float) __attribute__((__nothrow__, __leaf__));
2850 extern float __y0f(float) __attribute__((__nothrow__, __leaf__));
2851 extern float y1f(float) __attribute__((__nothrow__, __leaf__));
2852 extern float __y1f(float) __attribute__((__nothrow__, __leaf__));
2853 extern float ynf(int, float) __attribute__((__nothrow__, __leaf__));
2854 extern float __ynf(int, float) __attribute__((__nothrow__, __leaf__));
2855 extern float erff(float) __attribute__((__nothrow__, __leaf__));
2856 extern float __erff(float) __attribute__((__nothrow__, __leaf__));
2857 extern float erfcf(float) __attribute__((__nothrow__, __leaf__));
2858 extern float __erfcf(float) __attribute__((__nothrow__, __leaf__));
2859 extern float lgammaf(float) __attribute__((__nothrow__, __leaf__));
2860 extern float __lgammaf(float) __attribute__((__nothrow__, __leaf__));
2861 extern float tgammaf(float) __attribute__((__nothrow__, __leaf__));
2862 extern float __tgammaf(float) __attribute__((__nothrow__, __leaf__));
2863 extern float gammaf(float) __attribute__((__nothrow__, __leaf__));
2864 extern float __gammaf(float) __attribute__((__nothrow__, __leaf__));
2865 extern float lgammaf_r(float, int *__signgamp) __attribute__((__nothrow__, __leaf__));
2866 extern float __lgammaf_r(float, int *__signgamp) __attribute__((__nothrow__, __leaf__));
2867 extern float rintf(float __x) __attribute__((__nothrow__, __leaf__));
2868 extern float __rintf(float __x) __attribute__((__nothrow__, __leaf__));
2869 extern float nextafterf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2870 extern float __nextafterf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2871 extern float nexttowardf(float __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2872 extern float __nexttowardf(float __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2873 extern float remainderf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2874 extern float __remainderf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2875 extern float scalbnf(float __x, int __n) __attribute__((__nothrow__, __leaf__));
2876 extern float __scalbnf(float __x, int __n) __attribute__((__nothrow__, __leaf__));
2877 extern int ilogbf(float __x) __attribute__((__nothrow__, __leaf__));
2878 extern int __ilogbf(float __x) __attribute__((__nothrow__, __leaf__));
2879 extern float scalblnf(float __x, long int __n) __attribute__((__nothrow__, __leaf__));
2880 extern float __scalblnf(float __x, long int __n) __attribute__((__nothrow__, __leaf__));
2881 extern float nearbyintf(float __x) __attribute__((__nothrow__, __leaf__));
2882 extern float __nearbyintf(float __x) __attribute__((__nothrow__, __leaf__));
2883 extern float roundf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2884 extern float __roundf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2885 extern float truncf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2886 extern float __truncf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2887 extern float remquof(float __x, float __y, int *__quo) __attribute__((__nothrow__, __leaf__));
2888 extern float __remquof(float __x, float __y, int *__quo) __attribute__((__nothrow__, __leaf__));
2889 extern long int lrintf(float __x) __attribute__((__nothrow__, __leaf__));
2890 extern long int __lrintf(float __x) __attribute__((__nothrow__, __leaf__));
2891 extern long long int llrintf(float __x) __attribute__((__nothrow__, __leaf__));
2892 extern long long int __llrintf(float __x) __attribute__((__nothrow__, __leaf__));
2893 extern long int lroundf(float __x) __attribute__((__nothrow__, __leaf__));
2894 extern long int __lroundf(float __x) __attribute__((__nothrow__, __leaf__));
2895 extern long long int llroundf(float __x) __attribute__((__nothrow__, __leaf__));
2896 extern long long int __llroundf(float __x) __attribute__((__nothrow__, __leaf__));
2897 extern float fdimf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2898 extern float __fdimf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2899 extern float fmaxf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2900 extern float __fmaxf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2901 extern float fminf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2902 extern float __fminf(float __x, float __y) __attribute__((__nothrow__, __leaf__));
2903 extern int __fpclassifyf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2904 extern int __signbitf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2905 extern float fmaf(float __x, float __y, float __z) __attribute__((__nothrow__, __leaf__));
2906 extern float __fmaf(float __x, float __y, float __z) __attribute__((__nothrow__, __leaf__));
2907 extern float scalbf(float __x, float __n) __attribute__((__nothrow__, __leaf__));
2908 extern float __scalbf(float __x, float __n) __attribute__((__nothrow__, __leaf__));
2909 extern long double acosl(long double __x) __attribute__((__nothrow__, __leaf__));
2910 extern long double __acosl(long double __x) __attribute__((__nothrow__, __leaf__));
2911 extern long double asinl(long double __x) __attribute__((__nothrow__, __leaf__));
2912 extern long double __asinl(long double __x) __attribute__((__nothrow__, __leaf__));
2913 extern long double atanl(long double __x) __attribute__((__nothrow__, __leaf__));
2914 extern long double __atanl(long double __x) __attribute__((__nothrow__, __leaf__));
2915 extern long double atan2l(long double __y, long double __x) __attribute__((__nothrow__, __leaf__));
2916 extern long double __atan2l(long double __y, long double __x) __attribute__((__nothrow__, __leaf__));
2917 extern long double cosl(long double __x) __attribute__((__nothrow__, __leaf__));
2918 extern long double __cosl(long double __x) __attribute__((__nothrow__, __leaf__));
2919 extern long double sinl(long double __x) __attribute__((__nothrow__, __leaf__));
2920 extern long double __sinl(long double __x) __attribute__((__nothrow__, __leaf__));
2921 extern long double tanl(long double __x) __attribute__((__nothrow__, __leaf__));
2922 extern long double __tanl(long double __x) __attribute__((__nothrow__, __leaf__));
2923 extern long double coshl(long double __x) __attribute__((__nothrow__, __leaf__));
2924 extern long double __coshl(long double __x) __attribute__((__nothrow__, __leaf__));
2925 extern long double sinhl(long double __x) __attribute__((__nothrow__, __leaf__));
2926 extern long double __sinhl(long double __x) __attribute__((__nothrow__, __leaf__));
2927 extern long double tanhl(long double __x) __attribute__((__nothrow__, __leaf__));
2928 extern long double __tanhl(long double __x) __attribute__((__nothrow__, __leaf__));
2929 extern long double acoshl(long double __x) __attribute__((__nothrow__, __leaf__));
2930 extern long double __acoshl(long double __x) __attribute__((__nothrow__, __leaf__));
2931 extern long double asinhl(long double __x) __attribute__((__nothrow__, __leaf__));
2932 extern long double __asinhl(long double __x) __attribute__((__nothrow__, __leaf__));
2933 extern long double atanhl(long double __x) __attribute__((__nothrow__, __leaf__));
2934 extern long double __atanhl(long double __x) __attribute__((__nothrow__, __leaf__));
2935 extern long double expl(long double __x) __attribute__((__nothrow__, __leaf__));
2936 extern long double __expl(long double __x) __attribute__((__nothrow__, __leaf__));
2937 extern long double frexpl(long double __x, int *__exponent) __attribute__((__nothrow__, __leaf__));
2938 extern long double __frexpl(long double __x, int *__exponent) __attribute__((__nothrow__, __leaf__));
2939 extern long double ldexpl(long double __x, int __exponent) __attribute__((__nothrow__, __leaf__));
2940 extern long double __ldexpl(long double __x, int __exponent) __attribute__((__nothrow__, __leaf__));
2941 extern long double logl(long double __x) __attribute__((__nothrow__, __leaf__));
2942 extern long double __logl(long double __x) __attribute__((__nothrow__, __leaf__));
2943 extern long double log10l(long double __x) __attribute__((__nothrow__, __leaf__));
2944 extern long double __log10l(long double __x) __attribute__((__nothrow__, __leaf__));
2945 extern long double modfl(long double __x, long double *__iptr) __attribute__((__nothrow__, __leaf__));
2946 extern long double __modfl(long double __x, long double *__iptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
2947 extern long double expm1l(long double __x) __attribute__((__nothrow__, __leaf__));
2948 extern long double __expm1l(long double __x) __attribute__((__nothrow__, __leaf__));
2949 extern long double log1pl(long double __x) __attribute__((__nothrow__, __leaf__));
2950 extern long double __log1pl(long double __x) __attribute__((__nothrow__, __leaf__));
2951 extern long double logbl(long double __x) __attribute__((__nothrow__, __leaf__));
2952 extern long double __logbl(long double __x) __attribute__((__nothrow__, __leaf__));
2953 extern long double exp2l(long double __x) __attribute__((__nothrow__, __leaf__));
2954 extern long double __exp2l(long double __x) __attribute__((__nothrow__, __leaf__));
2955 extern long double log2l(long double __x) __attribute__((__nothrow__, __leaf__));
2956 extern long double __log2l(long double __x) __attribute__((__nothrow__, __leaf__));
2957 extern long double powl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2958 extern long double __powl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2959 extern long double sqrtl(long double __x) __attribute__((__nothrow__, __leaf__));
2960 extern long double __sqrtl(long double __x) __attribute__((__nothrow__, __leaf__));
2961 extern long double hypotl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2962 extern long double __hypotl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2963 extern long double cbrtl(long double __x) __attribute__((__nothrow__, __leaf__));
2964 extern long double __cbrtl(long double __x) __attribute__((__nothrow__, __leaf__));
2965 extern long double ceill(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2966 extern long double __ceill(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2967 extern long double fabsl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2968 extern long double __fabsl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2969 extern long double floorl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2970 extern long double __floorl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2971 extern long double fmodl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2972 extern long double __fmodl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2973 extern int __isinfl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2974 extern int __finitel(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2975 extern int isinfl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2976 extern int finitel(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2977 extern long double dreml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2978 extern long double __dreml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
2979 extern long double significandl(long double __x) __attribute__((__nothrow__, __leaf__));
2980 extern long double __significandl(long double __x) __attribute__((__nothrow__, __leaf__));
2981 extern long double copysignl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2982 extern long double __copysignl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2983 extern long double nanl(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2984 extern long double __nanl(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2985 extern int __isnanl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2986 extern int isnanl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
2987 extern long double j0l(long double) __attribute__((__nothrow__, __leaf__));
2988 extern long double __j0l(long double) __attribute__((__nothrow__, __leaf__));
2989 extern long double j1l(long double) __attribute__((__nothrow__, __leaf__));
2990 extern long double __j1l(long double) __attribute__((__nothrow__, __leaf__));
2991 extern long double jnl(int, long double) __attribute__((__nothrow__, __leaf__));
2992 extern long double __jnl(int, long double) __attribute__((__nothrow__, __leaf__));
2993 extern long double y0l(long double) __attribute__((__nothrow__, __leaf__));
2994 extern long double __y0l(long double) __attribute__((__nothrow__, __leaf__));
2995 extern long double y1l(long double) __attribute__((__nothrow__, __leaf__));
2996 extern long double __y1l(long double) __attribute__((__nothrow__, __leaf__));
2997 extern long double ynl(int, long double) __attribute__((__nothrow__, __leaf__));
2998 extern long double __ynl(int, long double) __attribute__((__nothrow__, __leaf__));
2999 extern long double erfl(long double) __attribute__((__nothrow__, __leaf__));
3000 extern long double __erfl(long double) __attribute__((__nothrow__, __leaf__));
3001 extern long double erfcl(long double) __attribute__((__nothrow__, __leaf__));
3002 extern long double __erfcl(long double) __attribute__((__nothrow__, __leaf__));
3003 extern long double lgammal(long double) __attribute__((__nothrow__, __leaf__));
3004 extern long double __lgammal(long double) __attribute__((__nothrow__, __leaf__));
3005 extern long double tgammal(long double) __attribute__((__nothrow__, __leaf__));
3006 extern long double __tgammal(long double) __attribute__((__nothrow__, __leaf__));
3007 extern long double gammal(long double) __attribute__((__nothrow__, __leaf__));
3008 extern long double __gammal(long double) __attribute__((__nothrow__, __leaf__));
3009 extern long double lgammal_r(long double, int *__signgamp) __attribute__((__nothrow__, __leaf__));
3010 extern long double __lgammal_r(long double, int *__signgamp) __attribute__((__nothrow__, __leaf__));
3011 extern long double rintl(long double __x) __attribute__((__nothrow__, __leaf__));
3012 extern long double __rintl(long double __x) __attribute__((__nothrow__, __leaf__));
3013 extern long double nextafterl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3014 extern long double __nextafterl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3015 extern long double nexttowardl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3016 extern long double __nexttowardl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3017 extern long double remainderl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3018 extern long double __remainderl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3019 extern long double scalbnl(long double __x, int __n) __attribute__((__nothrow__, __leaf__));
3020 extern long double __scalbnl(long double __x, int __n) __attribute__((__nothrow__, __leaf__));
3021 extern int ilogbl(long double __x) __attribute__((__nothrow__, __leaf__));
3022 extern int __ilogbl(long double __x) __attribute__((__nothrow__, __leaf__));
3023 extern long double scalblnl(long double __x, long int __n) __attribute__((__nothrow__, __leaf__));
3024 extern long double __scalblnl(long double __x, long int __n) __attribute__((__nothrow__, __leaf__));
3025 extern long double nearbyintl(long double __x) __attribute__((__nothrow__, __leaf__));
3026 extern long double __nearbyintl(long double __x) __attribute__((__nothrow__, __leaf__));
3027 extern long double roundl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3028 extern long double __roundl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3029 extern long double truncl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3030 extern long double __truncl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3031 extern long double remquol(long double __x, long double __y, int *__quo) __attribute__((__nothrow__, __leaf__));
3032 extern long double __remquol(long double __x, long double __y, int *__quo) __attribute__((__nothrow__, __leaf__));
3033 extern long int lrintl(long double __x) __attribute__((__nothrow__, __leaf__));
3034 extern long int __lrintl(long double __x) __attribute__((__nothrow__, __leaf__));
3035 extern long long int llrintl(long double __x) __attribute__((__nothrow__, __leaf__));
3036 extern long long int __llrintl(long double __x) __attribute__((__nothrow__, __leaf__));
3037 extern long int lroundl(long double __x) __attribute__((__nothrow__, __leaf__));
3038 extern long int __lroundl(long double __x) __attribute__((__nothrow__, __leaf__));
3039 extern long long int llroundl(long double __x) __attribute__((__nothrow__, __leaf__));
3040 extern long long int __llroundl(long double __x) __attribute__((__nothrow__, __leaf__));
3041 extern long double fdiml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3042 extern long double __fdiml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3043 extern long double fmaxl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3044 extern long double __fmaxl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3045 extern long double fminl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3046 extern long double __fminl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__));
3047 extern int __fpclassifyl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3048 extern int __signbitl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3049 extern long double fmal(long double __x, long double __y, long double __z) __attribute__((__nothrow__, __leaf__));
3050 extern long double __fmal(long double __x, long double __y, long double __z) __attribute__((__nothrow__, __leaf__));
3051 extern long double scalbl(long double __x, long double __n) __attribute__((__nothrow__, __leaf__));
3052 extern long double __scalbl(long double __x, long double __n) __attribute__((__nothrow__, __leaf__));
3053 extern int signgam;
3054 enum
3055 {
3056 FP_NAN,
3057 FP_INFINITE,
3058 FP_ZERO,
3059 FP_SUBNORMAL,
3060 FP_NORMAL
3061 };
3062 typedef enum
3063 {
3064 _IEEE_ = - 1,
3065 _SVID_,
3066 _XOPEN_,
3067 _POSIX_,
3068 _ISOC_
3069 } _LIB_VERSION_TYPE;
3070 extern _LIB_VERSION_TYPE _LIB_VERSION;
3071 struct exception
3072 {
3073 int type;
3074 char *name;
3075 double arg1;
3076 double arg2;
3077 double retval;
3078 };
3079 extern int matherr(struct exception *__exc);
3080 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) __signbitf(float __x)
3081 {
3082 int __m;
3083 __asm ("pmovmskb %1, %0": "=r" (__m): "x" (__x));
3084 return __m & 0x8;
3085 }
3086 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) __signbit(double __x)
3087 {
3088 int __m;
3089 __asm ("pmovmskb %1, %0": "=r" (__m): "x" (__x));
3090 return __m & 0x80;
3091 }
3092 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) __signbitl(long double __x)
3093 {
3094 __extension__
3095 union
3096 {
3097 long double __l;
3098 int __i[3];
3099 } __u = {__l:__x};
3100 return (__u.__i[2] & 0x8000) != 0;
3101 }
3102 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long int __attribute__((__nothrow__, __leaf__)) lrintf(float __x)
3103 {
3104 long int __res;
3105 __asm ("cvtss2si %1, %0": "=r" (__res): "xm" (__x));
3106 return __res;
3107 }
3108 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long int __attribute__((__nothrow__, __leaf__)) lrint(double __x)
3109 {
3110 long int __res;
3111 __asm ("cvtsd2si %1, %0": "=r" (__res): "xm" (__x));
3112 return __res;
3113 }
3114 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long long int __attribute__((__nothrow__, __leaf__)) llrintf(float __x)
3115 {
3116 long long int __res;
3117 __asm ("cvtss2si %1, %0": "=r" (__res): "xm" (__x));
3118 return __res;
3119 }
3120 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long long int __attribute__((__nothrow__, __leaf__)) llrint(double __x)
3121 {
3122 long long int __res;
3123 __asm ("cvtsd2si %1, %0": "=r" (__res): "xm" (__x));
3124 return __res;
3125 }
3126 union wait
3127 {
3128 int w_status;
3129 struct
3130 {
3131 unsigned int __w_termsig : 7;
3132 unsigned int __w_coredump : 1;
3133 unsigned int __w_retcode : 8;
3134 unsigned int : 16;
3135 } __wait_terminated;
3136 struct
3137 {
3138 unsigned int __w_stopval : 8;
3139 unsigned int __w_stopsig : 8;
3140 unsigned int : 16;
3141 } __wait_stopped;
3142 };
3143 typedef union
3144 {
3145 union wait *__uptr;
3146 int *__iptr;
3147 } __WAIT_STATUS __attribute__((__transparent_union__));
3148 typedef struct
3149 {
3150 int quot;
3151 int rem;
3152 } div_t;
3153 typedef struct
3154 {
3155 long int quot;
3156 long int rem;
3157 } ldiv_t;
3158 __extension__
3159 typedef struct
3160 {
3161 long long int quot;
3162 long long int rem;
3163 } lldiv_t;
3164 extern size_t __ctype_get_mb_cur_max(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3165 extern double atof(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3166 extern int atoi(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3167 extern long int atol(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3168 __extension__
3169 extern long long int atoll(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3170 extern double strtod(__const char *__restrict __nptr, char **__restrict __endptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3171 extern float strtof(__const char *__restrict __nptr, char **__restrict __endptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3172 extern long double strtold(__const char *__restrict __nptr, char **__restrict __endptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3173 extern long int strtol(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3174 extern unsigned long int strtoul(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3175 __extension__
3176 extern long long int strtoq(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3177 __extension__
3178 extern unsigned long long int strtouq(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3179 __extension__
3180 extern long long int strtoll(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3181 __extension__
3182 extern unsigned long long int strtoull(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3183 extern __inline __attribute__((__gnu_inline__)) double __attribute__((__nothrow__, __leaf__)) atof(__const char *__nptr)
3184 {
3185 return strtod(__nptr, (char **) ((void *) 0));
3186 }
3187 extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) atoi(__const char *__nptr)
3188 {
3189 return (int) strtol(__nptr, (char **) ((void *) 0), 10);
3190 }
3191 extern __inline __attribute__((__gnu_inline__)) long int __attribute__((__nothrow__, __leaf__)) atol(__const char *__nptr)
3192 {
3193 return strtol(__nptr, (char **) ((void *) 0), 10);
3194 }
3195 __extension__
3196 extern __inline __attribute__((__gnu_inline__)) long long int __attribute__((__nothrow__, __leaf__)) atoll(__const char *__nptr)
3197 {
3198 return strtoll(__nptr, (char **) ((void *) 0), 10);
3199 }
3200 extern char *l64a(long int __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3201 extern long int a64l(__const char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3202 typedef __u_char u_char;
3203 typedef __u_short u_short;
3204 typedef __u_int u_int;
3205 typedef __u_long u_long;
3206 typedef __quad_t quad_t;
3207 typedef __u_quad_t u_quad_t;
3208 typedef __fsid_t fsid_t;
3209 typedef __loff_t loff_t;
3210 typedef __ino_t ino_t;
3211 typedef __dev_t dev_t;
3212 typedef __mode_t mode_t;
3213 typedef __nlink_t nlink_t;
3214 typedef __id_t id_t;
3215 typedef __daddr_t daddr_t;
3216 typedef __caddr_t caddr_t;
3217 typedef __key_t key_t;
3218 typedef unsigned long int ulong;
3219 typedef unsigned short int ushort;
3220 typedef unsigned int uint;
3221 typedef unsigned int u_int8_t __attribute__((__mode__(__QI__)));
3222 typedef unsigned int u_int16_t __attribute__((__mode__(__HI__)));
3223 typedef unsigned int u_int32_t __attribute__((__mode__(__SI__)));
3224 typedef unsigned int u_int64_t __attribute__((__mode__(__DI__)));
3225 typedef int register_t __attribute__((__mode__(__word__)));
3226 typedef int __sig_atomic_t;
3227 typedef struct
3228 {
3229 unsigned long int __val[(1024 / (8 * sizeof(unsigned long int)))];
3230 } __sigset_t;
3231 typedef __sigset_t sigset_t;
3232 struct timeval
3233 {
3234 __time_t tv_sec;
3235 __suseconds_t tv_usec;
3236 };
3237 typedef __suseconds_t suseconds_t;
3238 typedef long int __fd_mask;
3239 typedef struct
3240 {
3241 __fd_mask __fds_bits[1024 / (8 * (int) sizeof(__fd_mask))];
3242 } fd_set;
3243 typedef __fd_mask fd_mask;
3244 extern int select(int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout);
3245 extern int pselect(int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask);
3246 extern unsigned long int __fdelt_chk(unsigned long int __d);
3247 extern unsigned long int __fdelt_warn(unsigned long int __d) __attribute__((__warning__("bit outside of fd_set selected")));
3248 __extension__
3249 extern unsigned int gnu_dev_major(unsigned long long int __dev) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3250 __extension__
3251 extern unsigned int gnu_dev_minor(unsigned long long int __dev) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3252 __extension__
3253 extern unsigned long long int gnu_dev_makedev(unsigned int __major, unsigned int __minor) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3254 __extension__
3255 extern __inline __attribute__((__gnu_inline__)) __attribute__((__const__)) unsigned int __attribute__((__nothrow__, __leaf__)) gnu_dev_major(unsigned long long int __dev)
3256 {
3257 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
3258 }
3259 __extension__
3260 extern __inline __attribute__((__gnu_inline__)) __attribute__((__const__)) unsigned int __attribute__((__nothrow__, __leaf__)) gnu_dev_minor(unsigned long long int __dev)
3261 {
3262 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
3263 }
3264 __extension__
3265 extern __inline __attribute__((__gnu_inline__)) __attribute__((__const__)) unsigned long long int __attribute__((__nothrow__, __leaf__)) gnu_dev_makedev(unsigned int __major, unsigned int __minor)
3266 {
3267 return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32));
3268 }
3269 typedef __blksize_t blksize_t;
3270 typedef __blkcnt_t blkcnt_t;
3271 typedef __fsblkcnt_t fsblkcnt_t;
3272 typedef __fsfilcnt_t fsfilcnt_t;
3273 extern long int random(void) __attribute__((__nothrow__, __leaf__));
3274 extern void srandom(unsigned int __seed) __attribute__((__nothrow__, __leaf__));
3275 extern char *initstate(unsigned int __seed, char *__statebuf, size_t __statelen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3276 extern char *setstate(char *__statebuf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3277 struct random_data
3278 {
3279 int32_t *fptr;
3280 int32_t *rptr;
3281 int32_t *state;
3282 int rand_type;
3283 int rand_deg;
3284 int rand_sep;
3285 int32_t *end_ptr;
3286 };
3287 extern int random_r(struct random_data *__restrict __buf, int32_t *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3288 extern int srandom_r(unsigned int __seed, struct random_data *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3289 extern int initstate_r(unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 4)));
3290 extern int setstate_r(char *__restrict __statebuf, struct random_data *__restrict __buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3291 extern int rand(void) __attribute__((__nothrow__, __leaf__));
3292 extern void srand(unsigned int __seed) __attribute__((__nothrow__, __leaf__));
3293 extern int rand_r(unsigned int *__seed) __attribute__((__nothrow__, __leaf__));
3294 extern double drand48(void) __attribute__((__nothrow__, __leaf__));
3295 extern double erand48(unsigned short int __xsubi[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3296 extern long int lrand48(void) __attribute__((__nothrow__, __leaf__));
3297 extern long int nrand48(unsigned short int __xsubi[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3298 extern long int mrand48(void) __attribute__((__nothrow__, __leaf__));
3299 extern long int jrand48(unsigned short int __xsubi[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3300 extern void srand48(long int __seedval) __attribute__((__nothrow__, __leaf__));
3301 extern unsigned short int *seed48(unsigned short int __seed16v[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3302 extern void lcong48(unsigned short int __param[7]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3303 struct drand48_data
3304 {
3305 unsigned short int __x[3];
3306 unsigned short int __old_x[3];
3307 unsigned short int __c;
3308 unsigned short int __init;
3309 unsigned long long int __a;
3310 };
3311 extern int drand48_r(struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3312 extern int erand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3313 extern int lrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3314 extern int nrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3315 extern int mrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3316 extern int jrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3317 extern int srand48_r(long int __seedval, struct drand48_data *__buffer) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3318 extern int seed48_r(unsigned short int __seed16v[3], struct drand48_data *__buffer) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3319 extern int lcong48_r(unsigned short int __param[7], struct drand48_data *__buffer) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3320 extern void *malloc(size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
3321 extern void *calloc(size_t __nmemb, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
3322 extern void *realloc(void *__ptr, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3323 extern void free(void *__ptr) __attribute__((__nothrow__, __leaf__));
3324 extern void cfree(void *__ptr) __attribute__((__nothrow__, __leaf__));
3325 extern void *alloca(size_t __size) __attribute__((__nothrow__, __leaf__));
3326 extern void *valloc(size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__));
3327 extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3328 extern void abort(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
3329 extern int atexit(void (*__func)(void)) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3330 extern int on_exit(void (*__func)(int __status, void *__arg), void *__arg) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3331 extern void exit(int __status) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
3332 extern void _Exit(int __status) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__));
3333 extern char *getenv(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3334 extern char *__secure_getenv(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3335 extern int putenv(char *__string) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3336 extern int setenv(__const char *__name, __const char *__value, int __replace) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3337 extern int unsetenv(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3338 extern int clearenv(void) __attribute__((__nothrow__, __leaf__));
3339 extern char *mktemp(char *__template) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3340 extern int mkstemp(char *__template) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3341 extern int mkstemps(char *__template, int __suffixlen) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3342 extern char *mkdtemp(char *__template) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3343 extern int system(__const char *__command) __attribute__((__warn_unused_result__));
3344 extern char *realpath(__const char *__restrict __name, char *__restrict __resolved) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3345 typedef int (*__compar_fn_t)(__const void *, __const void *);
3346 extern void *bsearch(__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__((__nonnull__(1, 2, 5))) __attribute__((__warn_unused_result__));
3347 extern void qsort(void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__((__nonnull__(1, 4)));
3348 extern int abs(int __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__));
3349 extern long int labs(long int __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__));
3350 __extension__
3351 extern long long int llabs(long long int __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__));
3352 extern div_t div(int __numer, int __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__));
3353 extern ldiv_t ldiv(long int __numer, long int __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__));
3354 __extension__
3355 extern lldiv_t lldiv(long long int __numer, long long int __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__));
3356 extern char *ecvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__));
3357 extern char *fcvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__));
3358 extern char *gcvt(double __value, int __ndigit, char *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3))) __attribute__((__warn_unused_result__));
3359 extern char *qecvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__));
3360 extern char *qfcvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__));
3361 extern char *qgcvt(long double __value, int __ndigit, char *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3))) __attribute__((__warn_unused_result__));
3362 extern int ecvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5)));
3363 extern int fcvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5)));
3364 extern int qecvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5)));
3365 extern int qfcvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5)));
3366 extern int mblen(__const char *__s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3367 extern int mbtowc(wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3368 extern int wctomb(char *__s, wchar_t __wchar) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3369 extern size_t mbstowcs(wchar_t *__restrict __pwcs, __const char *__restrict __s, size_t __n) __attribute__((__nothrow__, __leaf__));
3370 extern size_t wcstombs(char *__restrict __s, __const wchar_t *__restrict __pwcs, size_t __n) __attribute__((__nothrow__, __leaf__));
3371 extern int rpmatch(__const char *__response) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__));
3372 extern int getsubopt(char **__restrict __optionp, char *__const *__restrict __tokens, char **__restrict __valuep) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2, 3))) __attribute__((__warn_unused_result__));
3373 extern int getloadavg(double __loadavg[], int __nelem) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3374 extern char *__realpath_chk(__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3375 extern char *__realpath_alias(__const char *__restrict __name, char *__restrict __resolved) __asm__ ("""realpath") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3376 extern char *__realpath_chk_warn(__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __asm__ ("""__realpath_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)) __attribute__((__warning__("second argument of realpath must be either NULL or at ""least PATH_MAX bytes long buffer")));
3377 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *__attribute__((__nothrow__, __leaf__)) realpath(__const char *__restrict __name, char *__restrict __resolved)
3378 {
3379 if (__builtin_object_size(__resolved, 2 > 1) != (size_t) - 1)
3380 {
3381 if (__builtin_object_size(__resolved, 2 > 1) < 4096)
3382 return __realpath_chk_warn(__name, __resolved, __builtin_object_size(__resolved, 2 > 1));
3383 return __realpath_chk(__name, __resolved, __builtin_object_size(__resolved, 2 > 1));
3384 }
3385 return __realpath_alias(__name, __resolved);
3386 }
3387 extern int __ptsname_r_chk(int __fd, char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3388 extern int __ptsname_r_alias(int __fd, char *__buf, size_t __buflen) __asm__ ("""ptsname_r") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3389 extern int __ptsname_r_chk_warn(int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__ptsname_r_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warning__("ptsname_r called with buflen bigger than ""size of buf")));
3390 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) ptsname_r(int __fd, char *__buf, size_t __buflen)
3391 {
3392 if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1)
3393 {
3394 if (!__builtin_constant_p(__buflen))
3395 return __ptsname_r_chk(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1));
3396 if (__buflen > __builtin_object_size(__buf, 2 > 1))
3397 return __ptsname_r_chk_warn(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1));
3398 }
3399 return __ptsname_r_alias(__fd, __buf, __buflen);
3400 }
3401 extern int __wctomb_chk(char *__s, wchar_t __wchar, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3402 extern int __wctomb_alias(char *__s, wchar_t __wchar) __asm__ ("""wctomb") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__));
3403 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) int __attribute__((__nothrow__, __leaf__)) wctomb(char *__s, wchar_t __wchar)
3404 {
3405 if (__builtin_object_size(__s, 2 > 1) != (size_t) - 1 && 16 > __builtin_object_size(__s, 2 > 1))
3406 return __wctomb_chk(__s, __wchar, __builtin_object_size(__s, 2 > 1));
3407 return __wctomb_alias(__s, __wchar);
3408 }
3409 extern size_t __mbstowcs_chk(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) __attribute__((__nothrow__, __leaf__));
3410 extern size_t __mbstowcs_alias(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) __asm__ ("""mbstowcs") __attribute__((__nothrow__, __leaf__));
3411 extern size_t __mbstowcs_chk_warn(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("""__mbstowcs_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warning__("mbstowcs called with dst buffer smaller than len ""* sizeof (wchar_t)")));
3412 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) size_t __attribute__((__nothrow__, __leaf__)) mbstowcs(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len)
3413 {
3414 if (__builtin_object_size(__dst, 2 > 1) != (size_t) - 1)
3415 {
3416 if (!__builtin_constant_p(__len))
3417 return __mbstowcs_chk(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1) / sizeof(wchar_t));
3418 if (__len > __builtin_object_size(__dst, 2 > 1) / sizeof(wchar_t))
3419 return __mbstowcs_chk_warn(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1) / sizeof(wchar_t));
3420 }
3421 return __mbstowcs_alias(__dst, __src, __len);
3422 }
3423 extern size_t __wcstombs_chk(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __attribute__((__nothrow__, __leaf__));
3424 extern size_t __wcstombs_alias(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) __asm__ ("""wcstombs") __attribute__((__nothrow__, __leaf__));
3425 extern size_t __wcstombs_chk_warn(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("""__wcstombs_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warning__("wcstombs called with dst buffer smaller than len")));
3426 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) size_t __attribute__((__nothrow__, __leaf__)) wcstombs(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len)
3427 {
3428 if (__builtin_object_size(__dst, 2 > 1) != (size_t) - 1)
3429 {
3430 if (!__builtin_constant_p(__len))
3431 return __wcstombs_chk(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1));
3432 if (__len > __builtin_object_size(__dst, 2 > 1))
3433 return __wcstombs_chk_warn(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1));
3434 }
3435 return __wcstombs_alias(__dst, __src, __len);
3436 }
3437 extern void *memcpy(void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3438 extern void *memmove(void *__dest, __const void *__src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3439 extern void *memccpy(void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3440 extern void *memset(void *__s, int __c, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3441 extern int memcmp(__const void *__s1, __const void *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3442 extern void *memchr(__const void *__s, int __c, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3443 extern char *strcpy(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3444 extern char *strncpy(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3445 extern char *strcat(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3446 extern char *strncat(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3447 extern int strcmp(__const char *__s1, __const char *__s2) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3448 extern int strncmp(__const char *__s1, __const char *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3449 extern int strcoll(__const char *__s1, __const char *__s2) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3450 extern size_t strxfrm(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3451 extern int strcoll_l(__const char *__s1, __const char *__s2, __locale_t __l) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2, 3)));
3452 extern size_t strxfrm_l(char *__dest, __const char *__src, size_t __n, __locale_t __l) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 4)));
3453 extern char *strdup(__const char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__nonnull__(1)));
3454 extern char *strndup(__const char *__string, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__nonnull__(1)));
3455 extern char *strchr(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3456 extern char *strrchr(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3457 extern size_t strcspn(__const char *__s, __const char *__reject) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3458 extern size_t strspn(__const char *__s, __const char *__accept) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3459 extern char *strpbrk(__const char *__s, __const char *__accept) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3460 extern char *strstr(__const char *__haystack, __const char *__needle) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3461 extern char *strtok(char *__restrict __s, __const char *__restrict __delim) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3462 extern char *__strtok_r(char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3)));
3463 extern char *strtok_r(char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3)));
3464 extern size_t strlen(__const char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3465 extern size_t strnlen(__const char *__string, size_t __maxlen) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3466 extern char *strerror(int __errnum) __attribute__((__nothrow__, __leaf__));
3467 extern int strerror_r(int __errnum, char *__buf, size_t __buflen) __asm__ ("""__xpg_strerror_r") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2)));
3468 extern char *strerror_l(int __errnum, __locale_t __l) __attribute__((__nothrow__, __leaf__));
3469 extern void __bzero(void *__s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3470 extern void bcopy(__const void *__src, void *__dest, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3471 extern void bzero(void *__s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1)));
3472 extern int bcmp(__const void *__s1, __const void *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3473 extern char *index(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3474 extern char *rindex(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1)));
3475 extern int ffs(int __i) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__));
3476 extern int strcasecmp(__const char *__s1, __const char *__s2) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3477 extern int strncasecmp(__const char *__s1, __const char *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2)));
3478 extern char *strsep(char **__restrict __stringp, __const char *__restrict __delim) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3479 extern char *strsignal(int __sig) __attribute__((__nothrow__, __leaf__));
3480 extern char *__stpcpy(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3481 extern char *stpcpy(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3482 extern char *__stpncpy(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3483 extern char *stpncpy(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2)));
3484 extern void *__rawmemchr(const void *__s, int __c);
3485 extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c1(__const char *__s, int __reject);
3486 extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c1(__const char *__s, int __reject)
3487 {
3488 register size_t __result = 0;
3489 while (__s[__result] != '\0' && __s[__result] != __reject)
3490 ++__result;
3491 return __result;
3492 }
3493 extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c2(__const char *__s, int __reject1, int __reject2);
3494 extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c2(__const char *__s, int __reject1, int __reject2)
3495 {
3496 register size_t __result = 0;
3497 while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2)
3498 ++__result;
3499 return __result;
3500 }
3501 extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c3(__const char *__s, int __reject1, int __reject2, int __reject3);
3502 extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c3(__const char *__s, int __reject1, int __reject2, int __reject3)
3503 {
3504 register size_t __result = 0;
3505 while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3)
3506 ++__result;
3507 return __result;
3508 }
3509 extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c1(__const char *__s, int __accept);
3510 extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c1(__const char *__s, int __accept)
3511 {
3512 register size_t __result = 0;
3513 while (__s[__result] == __accept)
3514 ++__result;
3515 return __result;
3516 }
3517 extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c2(__const char *__s, int __accept1, int __accept2);
3518 extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c2(__const char *__s, int __accept1, int __accept2)
3519 {
3520 register size_t __result = 0;
3521 while (__s[__result] == __accept1 || __s[__result] == __accept2)
3522 ++__result;
3523 return __result;
3524 }
3525 extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c3(__const char *__s, int __accept1, int __accept2, int __accept3);
3526 extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c3(__const char *__s, int __accept1, int __accept2, int __accept3)
3527 {
3528 register size_t __result = 0;
3529 while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3)
3530 ++__result;
3531 return __result;
3532 }
3533 extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c2(__const char *__s, int __accept1, int __accept2);
3534 extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c2(__const char *__s, int __accept1, int __accept2)
3535 {
3536 while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
3537 ++__s;
3538 return *__s == '\0' ? ((void *) 0) : (char *) (size_t) __s;
3539 }
3540 extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c3(__const char *__s, int __accept1, int __accept2, int __accept3);
3541 extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c3(__const char *__s, int __accept1, int __accept2, int __accept3)
3542 {
3543 while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3)
3544 ++__s;
3545 return *__s == '\0' ? ((void *) 0) : (char *) (size_t) __s;
3546 }
3547 extern __inline __attribute__((__gnu_inline__)) char *__strtok_r_1c(char *__s, char __sep, char **__nextp);
3548 extern __inline __attribute__((__gnu_inline__)) char *__strtok_r_1c(char *__s, char __sep, char **__nextp)
3549 {
3550 char *__result;
3551 if (__s == ((void *) 0))
3552 __s = *__nextp;
3553 while (*__s == __sep)
3554 ++__s;
3555 __result = ((void *) 0);
3556 if (*__s != '\0')
3557 {
3558 __result = __s++;
3559 while (*__s != '\0')
3560 if (*__s++ == __sep)
3561 { 341 {
3562 __s[- 1] = '\0'; 342 ((uint8_t *)dst)[0] = ((const uint8_t *)src)[1] << 8 | ((const uint8_t *)src)[0];
3563 break; 343 ((uint8_t *)dst)[1] = (((const uint8_t *)src)[1] << 8 | ((const uint8_t *)src)[0]) >> 8;
3564 } 344 }
3565 } 345 }
3566 *__nextp = __s;
3567 return __result;
3568 }
3569 extern char *__strsep_g(char **__stringp, __const char *__delim);
3570 extern __inline __attribute__((__gnu_inline__)) char *__strsep_1c(char **__s, char __reject);
3571 extern __inline __attribute__((__gnu_inline__)) char *__strsep_1c(char **__s, char __reject)
3572 {
3573 register char *__retval = *__s;
3574 if (__retval != ((void *) 0) && (*__s = (__extension__ (__builtin_constant_p(__reject) && !__builtin_constant_p(__retval) && (__reject) == '\0' ? (char *) __rawmemchr(__retval, __reject) : __builtin_strchr(__retval, __reject)))) != ((void *) 0))
3575 *(*__s)++ = '\0';
3576 return __retval;
3577 }
3578 extern __inline __attribute__((__gnu_inline__)) char *__strsep_2c(char **__s, char __reject1, char __reject2);
3579 extern __inline __attribute__((__gnu_inline__)) char *__strsep_2c(char **__s, char __reject1, char __reject2)
3580 {
3581 register char *__retval = *__s;
3582 if (__retval != ((void *) 0))
3583 {
3584 register char *__cp = __retval;
3585 while (1)
3586 {
3587 if (*__cp == '\0')
3588 {
3589 __cp = ((void *) 0);
3590 break;
3591 }
3592 if (*__cp == __reject1 || *__cp == __reject2)
3593 {
3594 *__cp++ = '\0';
3595 break;
3596 }
3597 ++__cp;
3598 }
3599 *__s = __cp;
3600 }
3601 return __retval;
3602 }
3603 extern __inline __attribute__((__gnu_inline__)) char *__strsep_3c(char **__s, char __reject1, char __reject2, char __reject3);
3604 extern __inline __attribute__((__gnu_inline__)) char *__strsep_3c(char **__s, char __reject1, char __reject2, char __reject3)
3605 {
3606 register char *__retval = *__s;
3607 if (__retval != ((void *) 0))
3608 {
3609 register char *__cp = __retval;
3610 while (1)
3611 {
3612 if (*__cp == '\0')
3613 {
3614 __cp = ((void *) 0);
3615 break;
3616 }
3617 if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
3618 {
3619 *__cp++ = '\0';
3620 break;
3621 }
3622 ++__cp;
3623 }
3624 *__s = __cp;
3625 }
3626 return __retval;
3627 }
3628 extern char *__strdup(__const char *__string) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__));
3629 extern char *__strndup(__const char *__string, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__));
3630 extern void __warn_memset_zero_len(void) __attribute__((__warning__("memset used with constant zero length parameter; this could be due to transposed parameters")));
3631 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void *__attribute__((__nothrow__, __leaf__)) memcpy(void *__restrict __dest, __const void *__restrict __src, size_t __len)
3632 {
3633 return __builtin___memcpy_chk(__dest, __src, __len, __builtin_object_size(__dest, 0));
3634 }
3635 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void *__attribute__((__nothrow__, __leaf__)) memmove(void *__dest, __const void *__src, size_t __len)
3636 {
3637 return __builtin___memmove_chk(__dest, __src, __len, __builtin_object_size(__dest, 0));
3638 }
3639 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void *__attribute__((__nothrow__, __leaf__)) memset(void *__dest, int __ch, size_t __len)
3640 {
3641 if (__builtin_constant_p(__len) && __len == 0 && (!__builtin_constant_p(__ch) || __ch != 0))
3642 {
3643 __warn_memset_zero_len();
3644 return __dest;
3645 }
3646 return __builtin___memset_chk(__dest, __ch, __len, __builtin_object_size(__dest, 0));
3647 }
3648 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void __attribute__((__nothrow__, __leaf__)) bcopy(__const void *__src, void *__dest, size_t __len)
3649 {
3650 (void) __builtin___memmove_chk(__dest, __src, __len, __builtin_object_size(__dest, 0));
3651 }
3652 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void __attribute__((__nothrow__, __leaf__)) bzero(void *__dest, size_t __len)
3653 {
3654 (void) __builtin___memset_chk(__dest, '\0', __len, __builtin_object_size(__dest, 0));
3655 }
3656 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strcpy(char *__restrict __dest, __const char *__restrict __src)
3657 {
3658 return __builtin___strcpy_chk(__dest, __src, __builtin_object_size(__dest, 2 > 1));
3659 }
3660 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strncpy(char *__restrict __dest, __const char *__restrict __src, size_t __len)
3661 {
3662 return __builtin___strncpy_chk(__dest, __src, __len, __builtin_object_size(__dest, 2 > 1));
3663 }
3664 extern char *__stpncpy_chk(char *__dest, __const char *__src, size_t __n, size_t __destlen) __attribute__((__nothrow__, __leaf__));
3665 extern char *__stpncpy_alias(char *__dest, __const char *__src, size_t __n) __asm__ ("""stpncpy") __attribute__((__nothrow__, __leaf__));
3666 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) stpncpy(char *__dest, __const char *__src, size_t __n)
3667 {
3668 if (__builtin_object_size(__dest, 2 > 1) != (size_t) - 1 && (!__builtin_constant_p(__n) || __n <= __builtin_object_size(__dest, 2 > 1)))
3669 return __stpncpy_chk(__dest, __src, __n, __builtin_object_size(__dest, 2 > 1));
3670 return __stpncpy_alias(__dest, __src, __n);
3671 }
3672 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strcat(char *__restrict __dest, __const char *__restrict __src)
3673 {
3674 return __builtin___strcat_chk(__dest, __src, __builtin_object_size(__dest, 2 > 1));
3675 }
3676 extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strncat(char *__restrict __dest, __const char *__restrict __src, size_t __len)
3677 {
3678 return __builtin___strncat_chk(__dest, __src, __len, __builtin_object_size(__dest, 2 > 1));
3679 }
3680 extern const uint8_t ff_log2_tab[256];
3681 static inline __attribute__((const)) int av_log2_c(unsigned int v)
3682 {
3683 int n = 0;
3684 if (v & 0xffff0000)
3685 {
3686 v >>= 16;
3687 n += 16;
3688 }
3689 if (v & 0xff00)
3690 {
3691 v >>= 8;
3692 n += 8;
3693 }
3694 n += ff_log2_tab[v];
3695 return n;
3696 }
3697 static inline __attribute__((const)) int av_log2_16bit_c(unsigned int v)
3698 {
3699 int n = 0;
3700 if (v & 0xff00)
3701 {
3702 v >>= 8;
3703 n += 8;
3704 }
3705 n += ff_log2_tab[v];
3706 return n;
3707 }
3708 static inline __attribute__((const)) int av_clip(int a, int amin, int amax)
3709 {
3710 if (a < amin)
3711 return amin;
3712 else
3713 if (a > amax)
3714 return amax;
3715 else
3716 return a;
3717 }
3718 static inline __attribute__((const)) uint8_t av_clip_uint8(int a)
3719 {
3720 if (a & (~0xFF))
3721 return (- a) >> 31;
3722 else
3723 return a;
3724 }
3725 static inline __attribute__((const)) uint16_t av_clip_uint16(int a)
3726 {
3727 if (a & (~0xFFFF))
3728 return (- a) >> 31;
3729 else
3730 return a;
3731 }
3732 static inline __attribute__((const)) int16_t av_clip_int16(int a)
3733 {
3734 if ((a + 0x8000) & ~0xFFFF)
3735 return (a >> 31) ^ 0x7FFF;
3736 else
3737 return a;
3738 }
3739 static inline __attribute__((const)) int32_t av_clipl_int32(int64_t a)
3740 {
3741 if ((a + 0x80000000u) & ~0xFFFFFFFFUL)
3742 return (a >> 63) ^ 0x7FFFFFFF;
3743 else
3744 return a;
3745 }
3746 static inline __attribute__((const)) float av_clipf(float a, float amin, float amax)
3747 {
3748 if (a < amin)
3749 return amin;
3750 else
3751 if (a > amax)
3752 return amax;
3753 else
3754 return a;
3755 }
3756 static inline __attribute__((const)) int av_ceil_log2(int x)
3757 {
3758 return av_log2_c((x - 1) << 1);
3759 }
3760 typedef union
3761 {
3762 uint64_t u64;
3763 uint32_t u32[2];
3764 uint16_t u16[4];
3765 uint8_t u8[8];
3766 double f64;
3767 float f32[2];
3768 } __attribute__((__may_alias__)) av_alias64;
3769 typedef union
3770 {
3771 uint32_t u32;
3772 uint16_t u16[2];
3773 uint8_t u8[4];
3774 float f32;
3775 } __attribute__((__may_alias__)) av_alias32;
3776 typedef union
3777 {
3778 uint16_t u16;
3779 uint8_t u8[2];
3780 } __attribute__((__may_alias__)) av_alias16;
3781 static __attribute__((always_inline)) inline void AV_COPY64(void *d, const void *s)
3782 {
3783 __asm__ ("movq %1, %%mm0 \n\t""movq %%mm0, %0 \n\t": "=m" (*(uint64_t *) d): "m" (*(const uint64_t *) s): "mm0");
3784 }
3785 static __attribute__((always_inline)) inline void AV_SWAP64(void *a, void *b)
3786 {
3787 __asm__ ("movq %1, %%mm0 \n\t""movq %0, %%mm1 \n\t""movq %%mm0, %0 \n\t""movq %%mm1, %1 \n\t": "+m" (*(uint64_t *) a), "+m" (*(uint64_t *) b): : "mm0", "mm1");
3788 }
3789 static __attribute__((always_inline)) inline void AV_ZERO64(void *d)
3790 {
3791 __asm__ ("pxor %%mm0, %%mm0 \n\t""movq %%mm0, %0 \n\t": "=m" (*(uint64_t *) d): : "mm0");
3792 }
3793 static __attribute__((always_inline)) inline void AV_COPY128(void *d, const void *s)
3794 {
3795 struct v
3796 {
3797 uint64_t v[2];
3798 };
3799 __asm__ ("movaps %1, %%xmm0 \n\t""movaps %%xmm0, %0 \n\t": "=m" (*(struct v *) d): "m" (*(const struct v *) s): "xmm0");
3800 }
3801 static __attribute__((always_inline)) inline void AV_ZERO128(void *d)
3802 {
3803 struct v
3804 {
3805 uint64_t v[2];
3806 };
3807 __asm__ ("pxor %%xmm0, %%xmm0 \n\t""movdqa %%xmm0, %0 \n\t": "=m" (*(struct v *) d): : "xmm0");
3808 }
3809 void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride);
3810 void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride);
3811 void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
3812 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
3813 void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block);
3814 void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block);
3815 void ff_h264_idct_add16_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]);
3816 void ff_h264_idct_add16intra_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]);
3817 void ff_h264_idct8_add4_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]);
3818 void ff_h264_idct_add8_c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]);
3819 void h264_luma_dc_dequant_idct_c(DCTELEM *block, int qmul);
3820 void chroma_dc_dequant_idct_c(DCTELEM *block, int qmul);
3821 void ff_vector_fmul_window_c(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len);
3822 void ff_float_to_int16_c(int16_t *dst, const float *src, long len);
3823 void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels);
3824 extern const uint8_t ff_alternate_horizontal_scan[64];
3825 extern const uint8_t ff_alternate_vertical_scan[64];
3826 extern const uint8_t ff_zigzag_direct[64];
3827 extern const uint8_t ff_zigzag248_direct[64];
3828 extern uint32_t ff_squareTbl[512];
3829 extern uint8_t ff_cropTbl[256 + 2 * 1024];
3830 void ff_vp3_idct_c(DCTELEM *block);
3831 void ff_vp3_idct_put_c(uint8_t *dest, int line_size, DCTELEM *block);
3832 void ff_vp3_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block);
3833 void ff_vp3_idct_dc_add_c(uint8_t *dest, int line_size, const DCTELEM *block);
3834 void ff_vp3_v_loop_filter_c(uint8_t *src, int stride, int *bounding_values);
3835 void ff_vp3_h_loop_filter_c(uint8_t *src, int stride, int *bounding_values);
3836 void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, const int16_t *h_weights, const int16_t *v_weights);
3837 void ff_bink_idct_c(DCTELEM *block);
3838 void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block);
3839 void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
3840 void ff_put_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride);
3841 void ff_avg_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride);
3842 void ff_put_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride);
3843 void ff_avg_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride);
3844 void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
3845 void ff_avg_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd);
3846 void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
3847 void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
3848 void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
3849 void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
3850 void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
3851 void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
3852 typedef void (*op_pixels_func)(uint8_t *block, const uint8_t *pixels, int line_size, int h);
3853 typedef void (*tpel_mc_func)(uint8_t *block, const uint8_t *pixels, int line_size, int w, int h);
3854 typedef void (*qpel_mc_func)(uint8_t *dst, uint8_t *src, int stride);
3855 typedef void (*h264_chroma_mc_func)(uint8_t *dst, uint8_t *src, int srcStride, int h, int x, int y);
3856 typedef void (*op_fill_func)(uint8_t *block, uint8_t value, int line_size, int h);
3857 void ff_put_qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride);
3858 void ff_put_no_rnd_qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride);
3859 void ff_avg_qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride);
3860 void ff_put_qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride);
3861 void ff_put_no_rnd_qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride);
3862 void ff_avg_qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride);
3863 void ff_put_qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride);
3864 void ff_put_no_rnd_qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride);
3865 void ff_avg_qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride);
3866 void ff_put_qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride);
3867 void ff_put_no_rnd_qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride);
3868 void ff_avg_qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride);
3869 void ff_put_qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride);
3870 void ff_put_no_rnd_qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride);
3871 void ff_avg_qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride);
3872 void ff_put_qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride);
3873 void ff_put_no_rnd_qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride);
3874 void ff_avg_qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride);
3875 void ff_put_qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride);
3876 void ff_put_no_rnd_qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride);
3877 void ff_avg_qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride);
3878 void ff_put_qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride);
3879 void ff_put_no_rnd_qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride);
3880 void ff_avg_qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride);
3881 void ff_put_qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride);
3882 void ff_put_no_rnd_qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride);
3883 void ff_avg_qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride);
3884 void ff_put_qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride);
3885 void ff_put_no_rnd_qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride);
3886 void ff_avg_qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride);
3887 void ff_put_qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride);
3888 void ff_put_no_rnd_qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride);
3889 void ff_avg_qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride);
3890 void ff_put_qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride);
3891 void ff_put_no_rnd_qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride);
3892 void ff_avg_qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride);
3893 typedef int (*me_cmp_func)(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h);
3894 typedef struct ScanTable
3895 {
3896 const uint8_t *scantable;
3897 uint8_t permutated[64];
3898 uint8_t raster_end[64];
3899 } ScanTable;
3900 void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
3901 void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, int src_x, int src_y, int w, int h);
3902 typedef struct DSPContext
3903 {
3904 void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size);
3905 void (*diff_pixels)(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
3906 void (*put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
3907 void (*put_signed_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
3908 void (*put_pixels_nonclamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
3909 void (*add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
3910 void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size);
3911 void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size);
3912 void (*clear_block)(DCTELEM *block);
3913 void (*clear_blocks)(DCTELEM *blocks);
3914 op_pixels_func put_pixels_tab[4][4];
3915 op_pixels_func avg_pixels_tab[4][4];
3916 op_pixels_func put_no_rnd_pixels_tab[4][4];
3917 op_pixels_func avg_no_rnd_pixels_tab[4][4];
3918 void (*put_no_rnd_pixels_l2[2])(uint8_t *block, const uint8_t *a, const uint8_t *b, int line_size, int h);
3919 qpel_mc_func put_qpel_pixels_tab[2][16];
3920 qpel_mc_func avg_qpel_pixels_tab[2][16];
3921 qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
3922 qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16];
3923 qpel_mc_func put_mspel_pixels_tab[8];
3924 h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
3925 h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
3926 h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
3927 h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3];
3928 qpel_mc_func put_h264_qpel_pixels_tab[4][16];
3929 qpel_mc_func avg_h264_qpel_pixels_tab[4][16];
3930 qpel_mc_func put_2tap_qpel_pixels_tab[4][16];
3931 qpel_mc_func avg_2tap_qpel_pixels_tab[4][16];
3932 void (*fdct)(DCTELEM *block);
3933 void (*fdct248)(DCTELEM *block);
3934 void (*idct)(DCTELEM *block);
3935 void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block);
3936 void (*idct_add)(uint8_t *dest, int line_size, DCTELEM *block);
3937 void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w);
3938 void (*prefetch)(void *mem, int stride, int h);
3939 } DSPContext;
3940 void dsputil_static_init(void);
3941 void dsputil_init(DSPContext *p);
3942 int ff_check_alignment(void);
3943 void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
3944 void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type);
3945 static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
3946 {
3947 return (a | b) - (((a ^ b) & ~((0x01) * 0x01010101UL)) >> 1);
3948 }
3949 static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
3950 {
3951 return (a & b) + (((a ^ b) & ~((0x01) * 0x01010101UL)) >> 1);
3952 }
3953 int mm_support(void);
3954 extern int mm_flags;
3955 void dsputil_init_arm(DSPContext *c);
3956 void dsputil_init_mmx(DSPContext *c);
3957 void dsputil_init_ppc(DSPContext *c);
3958 void ff_dsputil_init_dwt(DSPContext *c);
3959 static inline void emms(void)
3960 {
3961 __asm__ volatile("emms;": : : "memory");
3962 }
3963 static inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
3964 {
3965 int i;
3966 for (i = 0;
3967 i < h;
3968 i++)
3969 {
3970 do
3971 {
3972 ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0]));
3973 ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8;
3974 }
3975 while (0); 346 while (0);
3976 dst += dstStride; 347 dst += dstStride;
3977 src += srcStride; 348 src += srcStride;
3978 } 349 }
3979 } 350 }
3980 static inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) 351 }
3981 { 352 static __inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
3982 int i; 353 {
3983 for (i = 0; 354 int i;
3984 i < h; 355 for (i = 0; i < h; i++)
3985 i++) 356 {
3986 { 357 {
3987 do 358 do
3988 { 359 {
3989 ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])); 360 {
3990 ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8; 361 ((uint8_t *)dst)[0] = ((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0];
3991 ((uint8_t *) (dst))[2] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 16; 362 ((uint8_t *)dst)[1] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 8;
3992 ((uint8_t *) (dst))[3] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 24; 363 ((uint8_t *)dst)[2] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 16;
3993 } 364 ((uint8_t *)dst)[3] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 24;
365 }
366 }
3994 while (0); 367 while (0);
3995 dst += dstStride; 368 dst += dstStride;
3996 src += srcStride; 369 src += srcStride;
3997 } 370 }
3998 } 371 }
3999 static inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) 372 }
4000 { 373 static __inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
4001 int i; 374 {
4002 for (i = 0; 375 int i;
4003 i < h; 376 for (i = 0; i < h; i++)
4004 i++) 377 {
4005 { 378 {
4006 do 379 do
4007 { 380 {
4008 ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])); 381 {
4009 ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8; 382 ((uint8_t *)dst)[0] = ((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0];
4010 ((uint8_t *) (dst))[2] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 16; 383 ((uint8_t *)dst)[1] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 8;
4011 ((uint8_t *) (dst))[3] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 24; 384 ((uint8_t *)dst)[2] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 16;
4012 } 385 ((uint8_t *)dst)[3] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 24;
386 }
387 }
4013 while (0); 388 while (0);
4014 do 389 do
4015 { 390 {
4016 ((uint8_t *) (dst + 4))[0] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])); 391 {
4017 ((uint8_t *) (dst + 4))[1] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 8; 392 ((uint8_t *)(dst + 4))[0] = ((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0];
4018 ((uint8_t *) (dst + 4))[2] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 16; 393 ((uint8_t *)(dst + 4))[1] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 8;
4019 ((uint8_t *) (dst + 4))[3] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 24; 394 ((uint8_t *)(dst + 4))[2] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 16;
4020 } 395 ((uint8_t *)(dst + 4))[3] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 24;
396 }
397 }
4021 while (0); 398 while (0);
4022 dst += dstStride; 399 dst += dstStride;
4023 src += srcStride; 400 src += srcStride;
4024 } 401 }
4025 } 402 }
4026 static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) 403 }
4027 { 404 static __inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
4028 int i; 405 {
4029 for (i = 0; 406 int i;
4030 i < h; 407 for (i = 0; i < h; i++)
4031 i++) 408 {
4032 { 409 {
4033 do 410 do
4034 { 411 {
4035 ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])); 412 {
4036 ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8; 413 ((uint8_t *)dst)[0] = ((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0];
4037 ((uint8_t *) (dst))[2] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 16; 414 ((uint8_t *)dst)[1] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 8;
4038 ((uint8_t *) (dst))[3] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 24; 415 ((uint8_t *)dst)[2] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 16;
4039 } 416 ((uint8_t *)dst)[3] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 24;
417 }
418 }
4040 while (0); 419 while (0);
4041 do 420 do
4042 { 421 {
4043 ((uint8_t *) (dst + 4))[0] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])); 422 {
4044 ((uint8_t *) (dst + 4))[1] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 8; 423 ((uint8_t *)(dst + 4))[0] = ((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0];
4045 ((uint8_t *) (dst + 4))[2] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 16; 424 ((uint8_t *)(dst + 4))[1] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 8;
4046 ((uint8_t *) (dst + 4))[3] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 24; 425 ((uint8_t *)(dst + 4))[2] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 16;
4047 } 426 ((uint8_t *)(dst + 4))[3] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 24;
427 }
428 }
4048 while (0); 429 while (0);
4049 dst[8] = src[8]; 430 dst[8] = src[8];
4050 dst += dstStride; 431 dst += dstStride;
4051 src += srcStride; 432 src += srcStride;
4052 } 433 }
4053 } 434 }
4054 static inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) 435 }
4055 { 436 static __inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
4056 int i; 437 {
4057 for (i = 0; 438 int i;
4058 i < h; 439 for (i = 0; i < h; i++)
4059 i++) 440 {
4060 { 441 {
4061 do 442 do
4062 { 443 {
4063 ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])); 444 {
4064 ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8; 445 ((uint8_t *)dst)[0] = ((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0];
4065 ((uint8_t *) (dst))[2] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 16; 446 ((uint8_t *)dst)[1] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 8;
4066 ((uint8_t *) (dst))[3] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 24; 447 ((uint8_t *)dst)[2] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 16;
4067 } 448 ((uint8_t *)dst)[3] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 24;
449 }
450 }
4068 while (0); 451 while (0);
4069 do 452 do
4070 { 453 {
4071 ((uint8_t *) (dst + 4))[0] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])); 454 {
4072 ((uint8_t *) (dst + 4))[1] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 8; 455 ((uint8_t *)(dst + 4))[0] = ((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0];
4073 ((uint8_t *) (dst + 4))[2] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 16; 456 ((uint8_t *)(dst + 4))[1] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 8;
4074 ((uint8_t *) (dst + 4))[3] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 24; 457 ((uint8_t *)(dst + 4))[2] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 16;
4075 } 458 ((uint8_t *)(dst + 4))[3] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 24;
459 }
460 }
4076 while (0); 461 while (0);
4077 do 462 do
4078 { 463 {
4079 ((uint8_t *) (dst + 8))[0] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])); 464 {
4080 ((uint8_t *) (dst + 8))[1] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])) >> 8; 465 ((uint8_t *)(dst + 8))[0] = ((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0];
4081 ((uint8_t *) (dst + 8))[2] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])) >> 16; 466 ((uint8_t *)(dst + 8))[1] = (((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0]) >> 8;
4082 ((uint8_t *) (dst + 8))[3] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])) >> 24; 467 ((uint8_t *)(dst + 8))[2] = (((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0]) >> 16;
4083 } 468 ((uint8_t *)(dst + 8))[3] = (((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0]) >> 24;
469 }
470 }
4084 while (0); 471 while (0);
4085 do 472 do
4086 { 473 {
4087 ((uint8_t *) (dst + 12))[0] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])); 474 {
4088 ((uint8_t *) (dst + 12))[1] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])) >> 8; 475 ((uint8_t *)(dst + 12))[0] = ((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0];
4089 ((uint8_t *) (dst + 12))[2] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])) >> 16; 476 ((uint8_t *)(dst + 12))[1] = (((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0]) >> 8;
4090 ((uint8_t *) (dst + 12))[3] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])) >> 24; 477 ((uint8_t *)(dst + 12))[2] = (((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0]) >> 16;
4091 } 478 ((uint8_t *)(dst + 12))[3] = (((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0]) >> 24;
479 }
480 }
4092 while (0); 481 while (0);
4093 dst += dstStride; 482 dst += dstStride;
4094 src += srcStride; 483 src += srcStride;
4095 } 484 }
4096 } 485 }
4097 static inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) 486 }
4098 { 487 static __inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
4099 int i; 488 {
4100 for (i = 0; 489 int i;
4101 i < h; 490 for (i = 0; i < h; i++)
4102 i++) 491 {
4103 { 492 {
4104 do 493 do
4105 { 494 {
4106 ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])); 495 {
4107 ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8; 496 ((uint8_t *)dst)[0] = ((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0];
4108 ((uint8_t *) (dst))[2] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 16; 497 ((uint8_t *)dst)[1] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 8;
4109 ((uint8_t *) (dst))[3] = (((((const uint8_t *) (src))[3] << 24) | (((const uint8_t *) (src))[2] << 16) | (((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 24; 498 ((uint8_t *)dst)[2] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 16;
4110 } 499 ((uint8_t *)dst)[3] = (((((const uint8_t *)src)[3] << 24 | ((const uint8_t *)src)[2] << 16) | ((const uint8_t *)src)[1] << 8) | ((const uint8_t *)src)[0]) >> 24;
500 }
501 }
4111 while (0); 502 while (0);
4112 do 503 do
4113 { 504 {
4114 ((uint8_t *) (dst + 4))[0] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])); 505 {
4115 ((uint8_t *) (dst + 4))[1] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 8; 506 ((uint8_t *)(dst + 4))[0] = ((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0];
4116 ((uint8_t *) (dst + 4))[2] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 16; 507 ((uint8_t *)(dst + 4))[1] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 8;
4117 ((uint8_t *) (dst + 4))[3] = (((((const uint8_t *) (src + 4))[3] << 24) | (((const uint8_t *) (src + 4))[2] << 16) | (((const uint8_t *) (src + 4))[1] << 8) | ((const uint8_t *) (src + 4))[0])) >> 24; 508 ((uint8_t *)(dst + 4))[2] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 16;
4118 } 509 ((uint8_t *)(dst + 4))[3] = (((((const uint8_t *)(src + 4))[3] << 24 | ((const uint8_t *)(src + 4))[2] << 16) | ((const uint8_t *)(src + 4))[1] << 8) | ((const uint8_t *)(src + 4))[0]) >> 24;
510 }
511 }
4119 while (0); 512 while (0);
4120 do 513 do
4121 { 514 {
4122 ((uint8_t *) (dst + 8))[0] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])); 515 {
4123 ((uint8_t *) (dst + 8))[1] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])) >> 8; 516 ((uint8_t *)(dst + 8))[0] = ((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0];
4124 ((uint8_t *) (dst + 8))[2] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])) >> 16; 517 ((uint8_t *)(dst + 8))[1] = (((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0]) >> 8;
4125 ((uint8_t *) (dst + 8))[3] = (((((const uint8_t *) (src + 8))[3] << 24) | (((const uint8_t *) (src + 8))[2] << 16) | (((const uint8_t *) (src + 8))[1] << 8) | ((const uint8_t *) (src + 8))[0])) >> 24; 518 ((uint8_t *)(dst + 8))[2] = (((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0]) >> 16;
4126 } 519 ((uint8_t *)(dst + 8))[3] = (((((const uint8_t *)(src + 8))[3] << 24 | ((const uint8_t *)(src + 8))[2] << 16) | ((const uint8_t *)(src + 8))[1] << 8) | ((const uint8_t *)(src + 8))[0]) >> 24;
520 }
521 }
4127 while (0); 522 while (0);
4128 do 523 do
4129 { 524 {
4130 ((uint8_t *) (dst + 12))[0] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])); 525 {
4131 ((uint8_t *) (dst + 12))[1] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])) >> 8; 526 ((uint8_t *)(dst + 12))[0] = ((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0];
4132 ((uint8_t *) (dst + 12))[2] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])) >> 16; 527 ((uint8_t *)(dst + 12))[1] = (((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0]) >> 8;
4133 ((uint8_t *) (dst + 12))[3] = (((((const uint8_t *) (src + 12))[3] << 24) | (((const uint8_t *) (src + 12))[2] << 16) | (((const uint8_t *) (src + 12))[1] << 8) | ((const uint8_t *) (src + 12))[0])) >> 24; 528 ((uint8_t *)(dst + 12))[2] = (((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0]) >> 16;
4134 } 529 ((uint8_t *)(dst + 12))[3] = (((((const uint8_t *)(src + 12))[3] << 24 | ((const uint8_t *)(src + 12))[2] << 16) | ((const uint8_t *)(src + 12))[1] << 8) | ((const uint8_t *)(src + 12))[0]) >> 24;
530 }
531 }
4135 while (0); 532 while (0);
4136 dst[16] = src[16]; 533 dst[16] = src[16];
4137 dst += dstStride; 534 dst += dstStride;
4138 src += srcStride; 535 src += srcStride;
4139 } 536 }
4140 } 537 }
4141 typedef void (*h264_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int offset); 538 }
4142 typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset); 539 static __inline uint64_t read_time(void)
4143 typedef struct H264DSPContext 540 {
4144 { 541 uint32_t a;
4145 h264_weight_func weight_h264_pixels_tab[10]; 542 uint32_t d;
4146 h264_biweight_func biweight_h264_pixels_tab[10]; 543 __asm__ volatile("rdtsc" : "=a"(a), "=d"(d) : );
4147 void (*h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); 544 return ((uint64_t)d << 32) + a;
4148 void (*h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); 545 }
4149 void (*h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta); 546 typedef signed char int8_t;
4150 void (*h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta); 547 static __inline int32_t NEG_SSR32(int32_t a, int8_t s)
4151 void (*h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); 548 {
4152 void (*h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); 549 __asm__ ("sarl %1, %0\n\t" : "+r"(a) : "ic"((uint8_t) -s));
4153 void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta); 550 return a;
4154 void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta); 551 }
4155 void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field); 552 static __inline uint32_t NEG_USR32(uint32_t a, int8_t s)
4156 void (*h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride); 553 {
4157 void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride); 554 __asm__ ("shrl %1, %0\n\t" : "+r"(a) : "ic"((uint8_t) -s));
4158 void (*h264_idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride); 555 return a;
4159 void (*h264_idct8_dc_add)(uint8_t *dst, DCTELEM *block, int stride); 556 }
4160 void (*h264_dct)(DCTELEM block[4][4]); 557 static __inline __attribute__((always_inline)) int MULH(int a, int b)
4161 void (*h264_idct_add16)(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); 558 {
4162 void (*h264_idct8_add4)(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); 559 return (int64_t)a * (int64_t)b >> 32;
4163 void (*h264_idct_add8)(uint8_t **dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); 560 }
4164 void (*h264_idct_add16intra)(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); 561 static __inline __attribute__((always_inline)) unsigned int UMULH(unsigned int a, unsigned int b)
4165 qpel_mc_func (*qpel_put)[16]; 562 {
4166 qpel_mc_func (*qpel_avg)[16]; 563 return (uint64_t)a * (uint64_t)b >> 32;
4167 } H264DSPContext; 564 }
4168 void ff_h264dsp_init(H264DSPContext *c); 565 static __inline __attribute__((const)) int mid_pred(int a, int b, int c)
4169 void ff_h264dsp_init_arm(H264DSPContext *c); 566 {
4170 void ff_h264dsp_init_ppc(H264DSPContext *c); 567 if (a > b)
4171 void ff_h264dsp_init_x86(H264DSPContext *c); 568 {
4172 typedef struct H264PredContext 569 {
4173 {
4174 void (*pred4x4[9 + 3 + 3])(uint8_t *src, uint8_t *topright, int stride);
4175 void (*pred8x8l[9 + 3])(uint8_t *src, int topleft, int topright, int stride);
4176 void (*pred8x8[4 + 3 + 4])(uint8_t *src, int stride);
4177 void (*pred16x16[4 + 3])(uint8_t *src, int stride);
4178 void (*pred4x4_add[2])(uint8_t *pix, const DCTELEM *block, int stride);
4179 void (*pred8x8l_add[2])(uint8_t *pix, const DCTELEM *block, int stride);
4180 void (*pred8x8_add[3])(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride);
4181 void (*pred16x16_add[3])(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride);
4182 } H264PredContext;
4183 void ff_h264_pred_init(H264PredContext *h);
4184 void ff_h264_pred_init_arm(H264PredContext *h);
4185 typedef struct
4186 {
4187 const char *class_name;
4188 const char *(*item_name)(void *ctx);
4189 const struct AVOption *option;
4190 int version;
4191 } AVClass;
4192 void av_log(int level, const char *fmt, ...);
4193 void av_vlog(int level, const char *fmt, va_list);
4194 int av_log_get_level(void);
4195 void av_log_set_level(int);
4196 void av_log_set_callback(void (*)(int, const char *, va_list));
4197 void av_log_default_callback(int level, const char *fmt, va_list vl);
4198 static inline uint64_t read_time(void)
4199 {
4200 uint32_t a, d;
4201 __asm__ volatile("rdtsc": "=a" (a), "=d" (d): );
4202 return ((uint64_t) d << 32) + a;
4203 }
4204 static inline int32_t NEG_SSR32(int32_t a, int8_t s)
4205 {
4206 __asm__ ("sarl %1, %0\n\t": "+r" (a): "ic" ((uint8_t) (- s)));
4207 return a;
4208 }
4209 static inline uint32_t NEG_USR32(uint32_t a, int8_t s)
4210 {
4211 __asm__ ("shrl %1, %0\n\t": "+r" (a): "ic" ((uint8_t) (- s)));
4212 return a;
4213 }
4214 static __attribute__((always_inline)) inline int MULH(int a, int b)
4215 {
4216 return ((int64_t) (a) * (int64_t) (b)) >> 32;
4217 }
4218 static __attribute__((always_inline)) inline unsigned UMULH(unsigned a, unsigned b)
4219 {
4220 return ((uint64_t) (a) * (uint64_t) (b)) >> 32;
4221 }
4222 static inline __attribute__((const)) int mid_pred(int a, int b, int c)
4223 {
4224 if (a > b)
4225 {
4226 if (c > b) 570 if (c > b)
4227 { 571 {
4228 if (c > a) 572 {
4229 b = a; 573 if (c > a)
4230 else 574 {
4231 b = c; 575 b = a;
4232 } 576 }
4233 } 577 else
4234 else 578 {
4235 { 579 b = c;
580 }
581 }
582 }
583 }
584 }
585 else
586 {
587 {
4236 if (b > c) 588 if (b > c)
4237 { 589 {
4238 if (c > a) 590 {
4239 b = c; 591 if (c > a)
4240 else 592 {
4241 b = a; 593 b = c;
4242 } 594 }
4243 } 595 else
4244 return b; 596 {
4245 } 597 b = a;
4246 static inline __attribute__((const)) int sign_extend(int val, unsigned bits) 598 }
4247 { 599 }
4248 return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); 600 }
4249 } 601 }
4250 static inline __attribute__((const)) unsigned zero_extend(unsigned val, unsigned bits) 602 }
4251 { 603 return b;
4252 return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); 604 }
4253 } 605 static __inline __attribute__((const)) int sign_extend(int val, unsigned int bits)
4254 typedef struct GetBitContext 606 {
4255 { 607 return val << (8 * sizeof(int) - bits) >> (8 * sizeof(int) - bits);
4256 uint8_t *rbsp; 608 }
4257 unsigned int rbsp_size; 609 static __inline __attribute__((const)) unsigned int zero_extend(unsigned int val, unsigned int bits)
4258 uint8_t *raw; 610 {
4259 const uint8_t *buffer, *buffer_end; 611 return val << (8 * sizeof(int) - bits) >> (8 * sizeof(int) - bits);
4260 unsigned int alloc_size; 612 }
4261 unsigned int buf_size; 613 struct GetBitContext;
4262 uint32_t *buffer_ptr; 614 typedef struct GetBitContext GetBitContext;
4263 uint32_t cache0; 615 struct GetBitContext
4264 uint32_t cache1; 616 {
4265 int bit_count; 617 uint8_t *rbsp;
4266 int size_in_bits; 618 unsigned int rbsp_size;
4267 } GetBitContext; 619 uint8_t *raw;
4268 static inline int get_bits_count(const GetBitContext *s) 620 const uint8_t *buffer;
4269 { 621 const uint8_t *buffer_end;
4270 return ((uint8_t *) s->buffer_ptr - s->buffer) * 8 - 32 + s->bit_count; 622 unsigned int alloc_size;
4271 } 623 unsigned int buf_size;
4272 static inline void skip_bits_long(GetBitContext *s, int n) 624 uint32_t *buffer_ptr;
4273 { 625 uint32_t cache0;
4274 int re_bit_count = (s)->bit_count; 626 uint32_t cache1;
4275 uint32_t re_cache0 = (s)->cache0; 627 int bit_count;
4276 uint32_t re_cache1 = (s)->cache1; 628 int size_in_bits;
4277 uint32_t *re_buffer_ptr = (s)->buffer_ptr; 629 };
4278 re_bit_count += n; 630 static __inline int get_bits_count(const GetBitContext *s)
4279 re_buffer_ptr += re_bit_count >> 5; 631 {
4280 re_bit_count &= 31; 632 return ((uint8_t *)(*s).buffer_ptr - (*s).buffer) * 8 - 32 + (*s).bit_count;
4281 re_cache0 = bswap_32(re_buffer_ptr[- 1]) << re_bit_count; 633 }
4282 re_cache1 = 0; 634 static __inline void skip_bits_long(GetBitContext *s, int n)
4283 if (re_bit_count > 0) 635 {
4284 { 636 int re_bit_count = (*s).bit_count;
637 uint32_t re_cache0 = (*s).cache0;
638 uint32_t re_cache1 = (*s).cache1;
639 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
640 re_bit_count += n;
641 re_buffer_ptr += re_bit_count >> 5;
642 re_bit_count &= 31;
643 re_cache0 = bswap_32(re_buffer_ptr[ -1]) << re_bit_count;
644 re_cache1 = 0;
645 if (re_bit_count > 0)
646 {
647 {
4285 const uint32_t next = bswap_32(*re_buffer_ptr); 648 const uint32_t next = bswap_32(*re_buffer_ptr);
4286 re_cache0 |= NEG_USR32(next, re_bit_count); 649 re_cache0 |= NEG_USR32(next, re_bit_count);
4287 re_cache1 |= next << re_bit_count; 650 re_cache1 |= next << re_bit_count;
4288 re_buffer_ptr++; 651 re_buffer_ptr++;
4289 re_bit_count -= 32; 652 re_bit_count -= 32;
4290 } 653 }
4291 (s)->bit_count = re_bit_count; 654 }
4292 (s)->cache0 = re_cache0; 655 (*s).bit_count = re_bit_count;
4293 (s)->cache1 = re_cache1; 656 (*s).cache0 = re_cache0;
4294 (s)->buffer_ptr = re_buffer_ptr; 657 (*s).cache1 = re_cache1;
4295 } 658 (*s).buffer_ptr = re_buffer_ptr;
4296 static inline int get_xbits(GetBitContext *s, int n) 659 }
4297 { 660 static __inline int get_xbits(GetBitContext *s, int n)
4298 register int sign; 661 {
4299 register int32_t cache; 662 register int32_t cache;
4300 int re_bit_count = (s)->bit_count; 663 register int sign;
4301 uint32_t re_cache0 = (s)->cache0; 664 int re_bit_count = (*s).bit_count;
4302 uint32_t re_cache1 = (s)->cache1; 665 uint32_t re_cache0 = (*s).cache0;
4303 uint32_t *re_buffer_ptr = (s)->buffer_ptr; 666 uint32_t re_cache1 = (*s).cache1;
4304 if (re_bit_count > 0) 667 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
4305 { 668 if (re_bit_count > 0)
669 {
670 {
4306 const uint32_t next = bswap_32(*re_buffer_ptr); 671 const uint32_t next = bswap_32(*re_buffer_ptr);
4307 re_cache0 |= NEG_USR32(next, re_bit_count); 672 re_cache0 |= NEG_USR32(next, re_bit_count);
4308 re_cache1 |= next << re_bit_count; 673 re_cache1 |= next << re_bit_count;
4309 re_buffer_ptr++; 674 re_buffer_ptr++;
4310 re_bit_count -= 32; 675 re_bit_count -= 32;
4311 } 676 }
4312 cache = (re_cache0); 677 }
4313 sign = (~cache) >> 31; 678 cache = re_cache0;
4314 { 679 sign = ~cache >> 31;
4315 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); 680 {
4316 re_bit_count += (n); 681 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
4317 } 682 re_bit_count += n;
4318 (s)->bit_count = re_bit_count; 683 }
4319 (s)->cache0 = re_cache0; 684 (*s).bit_count = re_bit_count;
4320 (s)->cache1 = re_cache1; 685 (*s).cache0 = re_cache0;
4321 (s)->buffer_ptr = re_buffer_ptr; 686 (*s).cache1 = re_cache1;
4322 return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; 687 (*s).buffer_ptr = re_buffer_ptr;
4323 } 688 return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
4324 static inline int get_sbits(GetBitContext *s, int n) 689 }
4325 { 690 static __inline int get_sbits(GetBitContext *s, int n)
4326 register int tmp; 691 {
4327 int re_bit_count = (s)->bit_count; 692 register int tmp;
4328 uint32_t re_cache0 = (s)->cache0; 693 int re_bit_count = (*s).bit_count;
4329 uint32_t re_cache1 = (s)->cache1; 694 uint32_t re_cache0 = (*s).cache0;
4330 uint32_t *re_buffer_ptr = (s)->buffer_ptr; 695 uint32_t re_cache1 = (*s).cache1;
4331 if (re_bit_count > 0) 696 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
4332 { 697 if (re_bit_count > 0)
698 {
699 {
4333 const uint32_t next = bswap_32(*re_buffer_ptr); 700 const uint32_t next = bswap_32(*re_buffer_ptr);
4334 re_cache0 |= NEG_USR32(next, re_bit_count); 701 re_cache0 |= NEG_USR32(next, re_bit_count);
4335 re_cache1 |= next << re_bit_count; 702 re_cache1 |= next << re_bit_count;
4336 re_buffer_ptr++; 703 re_buffer_ptr++;
4337 re_bit_count -= 32; 704 re_bit_count -= 32;
4338 } 705 }
4339 tmp = NEG_SSR32(re_cache0, n); 706 }
4340 { 707 tmp = NEG_SSR32(re_cache0, n);
4341 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); 708 {
4342 re_bit_count += (n); 709 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
4343 } 710 re_bit_count += n;
4344 (s)->bit_count = re_bit_count; 711 }
4345 (s)->cache0 = re_cache0; 712 (*s).bit_count = re_bit_count;
4346 (s)->cache1 = re_cache1; 713 (*s).cache0 = re_cache0;
4347 (s)->buffer_ptr = re_buffer_ptr; 714 (*s).cache1 = re_cache1;
4348 return tmp; 715 (*s).buffer_ptr = re_buffer_ptr;
4349 } 716 return tmp;
4350 static inline unsigned int get_bits(GetBitContext *s, int n) 717 }
4351 { 718 static __inline unsigned int get_bits(GetBitContext *s, int n)
4352 register int tmp; 719 {
4353 int re_bit_count = (s)->bit_count; 720 register int tmp;
4354 uint32_t re_cache0 = (s)->cache0; 721 int re_bit_count = (*s).bit_count;
4355 uint32_t re_cache1 = (s)->cache1; 722 uint32_t re_cache0 = (*s).cache0;
4356 uint32_t *re_buffer_ptr = (s)->buffer_ptr; 723 uint32_t re_cache1 = (*s).cache1;
4357 if (re_bit_count > 0) 724 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
4358 { 725 if (re_bit_count > 0)
726 {
727 {
4359 const uint32_t next = bswap_32(*re_buffer_ptr); 728 const uint32_t next = bswap_32(*re_buffer_ptr);
4360 re_cache0 |= NEG_USR32(next, re_bit_count); 729 re_cache0 |= NEG_USR32(next, re_bit_count);
4361 re_cache1 |= next << re_bit_count; 730 re_cache1 |= next << re_bit_count;
4362 re_buffer_ptr++; 731 re_buffer_ptr++;
4363 re_bit_count -= 32; 732 re_bit_count -= 32;
4364 } 733 }
4365 tmp = NEG_USR32(re_cache0, n); 734 }
4366 { 735 tmp = NEG_USR32(re_cache0, n);
4367 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); 736 {
4368 re_bit_count += (n); 737 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
4369 } 738 re_bit_count += n;
4370 (s)->bit_count = re_bit_count; 739 }
4371 (s)->cache0 = re_cache0; 740 (*s).bit_count = re_bit_count;
4372 (s)->cache1 = re_cache1; 741 (*s).cache0 = re_cache0;
4373 (s)->buffer_ptr = re_buffer_ptr; 742 (*s).cache1 = re_cache1;
4374 return tmp; 743 (*s).buffer_ptr = re_buffer_ptr;
4375 } 744 return tmp;
4376 static inline unsigned int show_bits(GetBitContext *s, int n) 745 }
4377 { 746 static __inline unsigned int show_bits(GetBitContext *s, int n)
4378 register int tmp; 747 {
4379 int re_bit_count = (s)->bit_count; 748 register int tmp;
4380 uint32_t re_cache0 = (s)->cache0; 749 int re_bit_count = (*s).bit_count;
4381 uint32_t re_cache1 = (s)->cache1; 750 uint32_t re_cache0 = (*s).cache0;
4382 uint32_t *re_buffer_ptr = (s)->buffer_ptr; 751 uint32_t re_cache1 = (*s).cache1;
4383 if (re_bit_count > 0) 752 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
4384 { 753 if (re_bit_count > 0)
754 {
755 {
4385 const uint32_t next = bswap_32(*re_buffer_ptr); 756 const uint32_t next = bswap_32(*re_buffer_ptr);
4386 re_cache0 |= NEG_USR32(next, re_bit_count); 757 re_cache0 |= NEG_USR32(next, re_bit_count);
4387 re_cache1 |= next << re_bit_count; 758 re_cache1 |= next << re_bit_count;
4388 re_buffer_ptr++; 759 re_buffer_ptr++;
4389 re_bit_count -= 32; 760 re_bit_count -= 32;
4390 } 761 }
4391 tmp = NEG_USR32(re_cache0, n); 762 }
4392 return tmp; 763 tmp = NEG_USR32(re_cache0, n);
4393 } 764 return tmp;
4394 static inline void skip_bits(GetBitContext *s, int n) 765 }
4395 { 766 static __inline void skip_bits(GetBitContext *s, int n)
4396 int re_bit_count = (s)->bit_count; 767 {
4397 uint32_t re_cache0 = (s)->cache0; 768 int re_bit_count = (*s).bit_count;
4398 uint32_t re_cache1 = (s)->cache1; 769 uint32_t re_cache0 = (*s).cache0;
4399 uint32_t *re_buffer_ptr = (s)->buffer_ptr; 770 uint32_t re_cache1 = (*s).cache1;
4400 if (re_bit_count > 0) 771 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
4401 { 772 if (re_bit_count > 0)
773 {
774 {
4402 const uint32_t next = bswap_32(*re_buffer_ptr); 775 const uint32_t next = bswap_32(*re_buffer_ptr);
4403 re_cache0 |= NEG_USR32(next, re_bit_count); 776 re_cache0 |= NEG_USR32(next, re_bit_count);
4404 re_cache1 |= next << re_bit_count; 777 re_cache1 |= next << re_bit_count;
4405 re_buffer_ptr++; 778 re_buffer_ptr++;
4406 re_bit_count -= 32; 779 re_bit_count -= 32;
4407 } 780 }
4408 { 781 }
4409 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); 782 {
4410 re_bit_count += (n); 783 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
4411 } 784 re_bit_count += n;
4412 (s)->bit_count = re_bit_count; 785 }
4413 (s)->cache0 = re_cache0; 786 (*s).bit_count = re_bit_count;
4414 (s)->cache1 = re_cache1; 787 (*s).cache0 = re_cache0;
4415 (s)->buffer_ptr = re_buffer_ptr; 788 (*s).cache1 = re_cache1;
4416 } 789 (*s).buffer_ptr = re_buffer_ptr;
4417 static inline unsigned int get_bits1(GetBitContext *s) 790 }
4418 { 791 static __inline unsigned int get_bits1(GetBitContext *s)
4419 return get_bits(s, 1); 792 {
4420 } 793 return get_bits(s, 1);
4421 static inline unsigned int show_bits1(GetBitContext *s) 794 }
4422 { 795 static __inline unsigned int show_bits1(GetBitContext *s)
4423 return show_bits(s, 1); 796 {
4424 } 797 return show_bits(s, 1);
4425 static inline void skip_bits1(GetBitContext *s) 798 }
4426 { 799 static __inline void skip_bits1(GetBitContext *s)
4427 skip_bits(s, 1); 800 {
4428 } 801 skip_bits(s, 1);
4429 static inline unsigned int get_bits_long(GetBitContext *s, int n) 802 }
4430 { 803 static __inline unsigned int get_bits_long(GetBitContext *s, int n)
4431 if (n <= 32) 804 {
4432 return get_bits(s, n); 805 if (n <= 32)
4433 else 806 {
4434 { 807 return get_bits(s, n);
808 }
809 else
810 {
811 {
4435 int ret = get_bits(s, 16) << (n - 16); 812 int ret = get_bits(s, 16) << (n - 16);
4436 return ret | get_bits(s, n - 16); 813 return ret | get_bits(s, n - 16);
4437 } 814 }
4438 } 815 }
4439 static inline int get_sbits_long(GetBitContext *s, int n) 816 }
4440 { 817 static __inline int get_sbits_long(GetBitContext *s, int n)
4441 return sign_extend(get_bits_long(s, n), n); 818 {
4442 } 819 return sign_extend(get_bits_long(s, n), n);
4443 static inline unsigned int show_bits_long(GetBitContext *s, int n) 820 }
4444 { 821 static __inline unsigned int show_bits_long(GetBitContext *s, int n)
4445 if (n <= 32) 822 {
4446 return show_bits(s, n); 823 if (n <= 32)
4447 else 824 {
4448 { 825 return show_bits(s, n);
826 }
827 else
828 {
829 {
4449 GetBitContext gb = *s; 830 GetBitContext gb = *s;
4450 return get_bits_long(&gb, n); 831 return get_bits_long(&gb, n);
4451 } 832 }
4452 } 833 }
4453 static inline int check_marker(GetBitContext *s, const char *msg) 834 }
4454 { 835 void av_log(int level, const char *fmt, ...);
4455 int bit = get_bits1(s); 836 static __inline int check_marker(GetBitContext *s, const char *msg)
4456 if (!bit) 837 {
4457 av_log(32, "Marker bit missing %s\n", msg); 838 int bit = get_bits1(s);
4458 return bit; 839 if (!bit)
4459 } 840 {
4460 static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size) 841 av_log(32, "Marker bit missing %s\n", msg);
4461 { 842 }
4462 int buffer_size = (bit_size + 7) >> 3; 843 return bit;
4463 if (buffer_size < 0 || bit_size < 0) 844 }
4464 { 845 typedef long int __intptr_t;
846 typedef __intptr_t intptr_t;
847 static __inline void init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
848 {
849 int buffer_size = (bit_size + 7) >> 3;
850 if (buffer_size < 0 || bit_size < 0)
851 {
852 {
4465 buffer_size = bit_size = 0; 853 buffer_size = bit_size = 0;
4466 buffer = ((void *) 0); 854 buffer = (void *)0;
4467 } 855 }
4468 s->buffer = buffer; 856 }
4469 s->size_in_bits = bit_size; 857 (*s).buffer = buffer;
4470 s->buffer_end = buffer + buffer_size; 858 (*s).size_in_bits = bit_size;
4471 s->buffer_ptr = (uint32_t *) ((intptr_t) buffer & (~3)); 859 (*s).buffer_end = buffer + buffer_size;
4472 s->bit_count = 32 + 8 * ((intptr_t) buffer & 3); 860 (*s).buffer_ptr = (uint32_t *)((intptr_t)buffer & ~3);
4473 skip_bits_long(s, 0); 861 (*s).bit_count = 32 + 8 * ((intptr_t)buffer & 3);
4474 } 862 skip_bits_long(s, 0);
4475 static inline void align_get_bits(GetBitContext *s) 863 }
4476 { 864 static __inline void align_get_bits(GetBitContext *s)
4477 int n = (- get_bits_count(s)) & 7; 865 {
4478 if (n) 866 int n = -get_bits_count(s) & 7;
4479 skip_bits(s, n); 867 if (n)
4480 } 868 {
4481 static inline int get_bits_left(GetBitContext *gb) 869 skip_bits(s, n);
4482 { 870 }
4483 return gb->size_in_bits - get_bits_count(gb); 871 }
4484 } 872 static __inline int get_bits_left(GetBitContext *gb)
4485 enum 873 {
4486 { 874 return (*gb).size_in_bits - get_bits_count(gb);
4487 PARSE = 0, 875 }
4488 ENTROPY, 876 struct H264Slice;
4489 REORDER, 877 typedef struct H264Slice H264Slice;
4490 REORDER2, 878 struct PPS
4491 MBDEC, 879 {
4492 OUTPUT, 880 unsigned int sps_id;
4493 STAGES 881 int cabac;
4494 }; 882 int pic_order_present;
4495 enum 883 int slice_group_count;
4496 { 884 int mb_slice_group_map_type;
4497 TOTAL = 0, 885 unsigned int ref_count[2];
4498 FRONT, 886 int weighted_pred;
4499 ED, 887 int weighted_bipred_idc;
4500 REC, 888 int init_qp;
4501 PROFILE_STAGES 889 int init_qs;
4502 }; 890 int chroma_qp_index_offset[2];
4503 typedef struct ParserContext 891 int deblocking_filter_parameters_present;
4504 { 892 int constrained_intra_pred;
4505 int ifile; 893 int redundant_pic_cnt_present;
4506 int ofile; 894 int transform_8x8_mode;
4507 int buffer_size; 895 uint8_t scaling_matrix4[6][16];
4508 int eof_reached; 896 uint8_t scaling_matrix8[2][64];
4509 uint8_t *data; 897 uint8_t chroma_qp_table[2][64];
4510 int size; 898 int chroma_qp_diff;
4511 uint8_t *cur_ptr; 899 };
4512 int cur_len; 900 typedef struct PPS PPS;
4513 int64_t frame_offset; 901 struct PictureInfo;
4514 int64_t cur_offset; 902 typedef struct PictureInfo PictureInfo;
4515 int64_t next_frame_offset; 903 struct DecodedPicture;
4516 int pict_type; 904 typedef struct DecodedPicture DecodedPicture;
4517 int repeat_pict; 905 struct H264Slice
4518 int key_frame; 906 {
4519 int64_t pos; 907 PPS pps;
4520 int64_t last_pos; 908 PictureInfo *current_picture_info;
4521 int final_frame; 909 DecodedPicture *curr_pic;
4522 uint8_t overread[5]; 910 int slice_num;
4523 int overread_cnt; 911 int release_ref_cpn[66];
4524 int index; 912 int release_cnt;
4525 int last_index; 913 int qp_thresh;
4526 int frame_start_found; 914 int use_weight;
4527 uint32_t state; 915 int use_weight_chroma;
4528 } ParserContext; 916 int luma_log2_weight_denom;
4529 typedef struct NalContext 917 int chroma_log2_weight_denom;
4530 { 918 int16_t luma_weight[16][2][2];
4531 SPS *sps_buffers[32]; 919 int16_t chroma_weight[16][2][2][2];
4532 PPS *pps_buffers[256]; 920 int16_t implicit_weight[16][16][2];
4533 SPS sps; 921 int ref_list_cpn[2][16];
4534 PictureInfo picture[16 + 1]; 922 PictureInfo *ref_list[2][16];
4535 PictureInfo *release_ref[66]; 923 DecodedPicture *dp_ref_list[2][16];
4536 PictureInfo *short_ref[32]; 924 int ref_count[2];
4537 PictureInfo *long_ref[32]; 925 int slice_type;
4538 int long_ref_count; 926 int slice_type_nos;
4539 int short_ref_count; 927 int slice_alpha_c0_offset;
4540 uint32_t coded_pic_num; 928 int slice_beta_offset;
4541 int poc_lsb; 929 int direct_8x8_inference_flag;
4542 int poc_msb; 930 uint8_t list_count;
4543 uint32_t poc_offset; 931 uint32_t coded_pic_num;
4544 int delta_poc; 932 int poc;
4545 int frame_num; 933 int key_frame;
4546 int prev_poc_msb; 934 int mmco_reset;
4547 int prev_poc_lsb; 935 int ip_id;
4548 int frame_num_offset; 936 int transform_bypass;
4549 int prev_frame_num_offset; 937 int direct_spatial_mv_pred;
4550 int prev_frame_num; 938 int map_col_to_list0[2][16];
4551 int max_pic_num; 939 int dist_scale_factor[16];
4552 int redundant_pic_count; 940 int cabac_init_idc;
4553 int outputed_poc; 941 int nal_ref_idc;
4554 int ip_id; 942 int nal_unit_type;
4555 int b4_stride; 943 int ref2frm[2][64];
4556 int mb_stride; 944 int qscale;
4557 int mb_width; 945 };
4558 int mb_height; 946 static __inline int get_chroma_qp(H264Slice *s, int t, int qscale)
4559 int width; 947 {
4560 int height; 948 return (*s).pps.chroma_qp_table[t][qscale];
4561 int has_b_frames; 949 }
4562 SEI_PicStructType sei_pic_struct; 950 struct H264Context;
4563 int sei_ct_type; 951 typedef struct H264Context H264Context;
4564 int sei_dpb_output_delay; 952 struct ParserContext;
4565 int sei_cpb_removal_delay; 953 typedef struct ParserContext ParserContext;
4566 int sei_recovery_frame_cnt; 954 struct NalContext;
4567 int sei_buffering_period_present; 955 typedef struct NalContext NalContext;
4568 int initial_cpb_removal_delay[32]; 956 struct mcc_struct_anon_54;
4569 } NalContext; 957 typedef struct mcc_struct_anon_54 SliceBufferEntry;
4570 typedef struct EntropyContext 958 struct H264Mb;
4571 { 959 typedef struct H264Mb H264Mb;
4572 CABACContext c; 960 struct mcc_struct_anon_54
4573 H264Mb *m; 961 {
4574 int top_cbp; 962 H264Slice slice;
4575 int left_cbp; 963 H264Mb *mbs;
4576 int neighbor_transform_size; 964 DecodedPicture *dp;
4577 uint32_t top_type; 965 GetBitContext gb;
4578 uint32_t left_type; 966 int lines_taken;
4579 uint32_t topright_type; 967 int lines_total;
4580 uint32_t topleft_type; 968 int state;
4581 int curr_qscale; 969 int initialized;
4582 int chroma_qp[2]; 970 };
4583 int last_qscale_diff; 971 void init_sb_entry(H264Context *h, SliceBufferEntry *sbe);
4584 uint32_t dequant4_buffer[6][52][16]; 972 struct __pthread_internal_list;
4585 uint32_t dequant8_buffer[2][52][64]; 973 struct __pthread_internal_list
4586 uint32_t (*dequant4_coeff[6])[16]; 974 {
4587 uint32_t (*dequant8_coeff[2])[64]; 975 struct __pthread_internal_list *__prev;
4588 uint8_t (*non_zero_count_top)[8]; 976 struct __pthread_internal_list *__next;
4589 uint8_t (*non_zero_count)[8]; 977 };
4590 uint8_t (*non_zero_count_row[2])[8]; 978 typedef struct __pthread_internal_list __pthread_list_t;
4591 uint8_t __attribute__((aligned(8))) non_zero_count_left[8]; 979 struct __pthread_mutex_s
4592 uint8_t (*mvd_top[2])[2]; 980 {
4593 uint8_t (*mvd[2])[2]; 981 int __lock;
4594 uint8_t (*mvd_table[2][2])[2]; 982 unsigned int __count;
4595 uint8_t *direct_top; 983 int __owner;
4596 uint8_t *direct; 984 unsigned int __nusers;
4597 uint8_t *direct_table[2]; 985 int __kind;
4598 uint8_t *chroma_pred_mode_top; 986 int __spins;
4599 uint8_t *chroma_pred_mode; 987 __pthread_list_t __list;
4600 uint8_t *chroma_pred_mode_table[2]; 988 };
4601 uint16_t *cbp_top; 989 union mcc_union_anon_26
4602 uint16_t *cbp; 990 {
4603 uint16_t *cbp_table[2]; 991 struct __pthread_mutex_s __data;
4604 int8_t *qscale_top; 992 char __size[40];
4605 int8_t *qscale; 993 long int __align;
4606 int8_t *qscale_table[2]; 994 };
4607 int8_t *ref_index_top[2]; 995 typedef union mcc_union_anon_26 pthread_mutex_t;
4608 int8_t *ref_index[2]; 996 struct mcc_struct_anon_29
4609 int8_t *ref_index_table[2][2]; 997 {
4610 uint32_t *mb_type_top; 998 int __lock;
4611 uint32_t *mb_type; 999 unsigned int __futex;
4612 uint32_t *mb_type_table[2]; 1000 __extension__ unsigned long long int __total_seq;
4613 int b_stride; 1001 __extension__ unsigned long long int __wakeup_seq;
4614 int mb_stride; 1002 __extension__ unsigned long long int __woken_seq;
4615 int mb_width; 1003 void *__mutex;
4616 int mb_height; 1004 unsigned int __nwaiters;
4617 uint8_t *zigzag_scan; 1005 unsigned int __broadcast_seq;
4618 uint8_t *zigzag_scan8x8; 1006 };
4619 uint8_t direct_cache[5 * 8]; 1007 union mcc_union_anon_28
4620 int8_t __attribute__((aligned(8))) intra4x4_pred_mode_cache[5 * 8]; 1008 {
4621 int16_t __attribute__((aligned(16))) mv_cache[2][5 * 8][2]; 1009 struct mcc_struct_anon_29 __data;
4622 int8_t __attribute__((aligned(8))) ref_cache[2][5 * 8]; 1010 char __size[48];
4623 uint8_t __attribute__((aligned(8))) non_zero_count_cache[6 * 8]; 1011 __extension__ long long int __align;
4624 uint8_t __attribute__((aligned(16))) mvd_cache[2][5 * 8][2]; 1012 };
4625 } EntropyContext; 1013 typedef union mcc_union_anon_28 pthread_cond_t;
4626 typedef struct H264Slice 1014 struct mcc_struct_anon_56
4627 { 1015 {
4628 PPS pps; 1016 pthread_mutex_t lock;
4629 PictureInfo *current_picture_info; 1017 pthread_cond_t cond;
4630 DecodedPicture *curr_pic; 1018 SliceBufferEntry **queue;
4631 int slice_num; 1019 int size;
4632 int release_ref_cpn[66]; 1020 int cnt;
4633 int release_cnt; 1021 int fi;
4634 int qp_thresh; 1022 int fo;
4635 int use_weight; 1023 };
4636 int use_weight_chroma; 1024 typedef struct mcc_struct_anon_56 SliceBufferQueue;
4637 int luma_log2_weight_denom; 1025 struct RingLineEntry;
4638 int chroma_log2_weight_denom; 1026 typedef struct RingLineEntry RingLineEntry;
4639 int16_t luma_weight[16][2][2]; 1027 struct mcc_struct_anon_57
4640 int16_t chroma_weight[16][2][2][2]; 1028 {
4641 int16_t implicit_weight[16][16][2]; 1029 pthread_mutex_t wslock;
4642 int ref_list_cpn[2][16]; 1030 pthread_cond_t wscond;
4643 PictureInfo *ref_list[2][16]; 1031 pthread_mutex_t swlock;
4644 DecodedPicture *dp_ref_list[2][16]; 1032 pthread_cond_t swcond;
4645 int ref_count[2]; 1033 RingLineEntry **queue;
4646 int slice_type; 1034 int size;
4647 int slice_type_nos; 1035 int ready;
4648 int slice_alpha_c0_offset; 1036 int free;
4649 int slice_beta_offset; 1037 int fi;
4650 int direct_8x8_inference_flag; 1038 int fo;
4651 uint8_t list_count; 1039 };
4652 uint32_t coded_pic_num; 1040 typedef struct mcc_struct_anon_57 RingLineQueue;
4653 int poc; 1041 union mcc_union_anon_25
4654 int key_frame; 1042 {
4655 int mmco_reset; 1043 char __size[56];
4656 int ip_id; 1044 long int __align;
4657 int transform_bypass; 1045 };
4658 int direct_spatial_mv_pred; 1046 typedef union mcc_union_anon_25 pthread_attr_t;
4659 int map_col_to_list0[2][16]; 1047 typedef unsigned long int pthread_t;
4660 int dist_scale_factor[16]; 1048 struct SuperMBContext;
4661 int cabac_init_idc; 1049 typedef struct SuperMBContext SuperMBContext;
4662 int nal_ref_idc; 1050 typedef long int __time_t;
4663 int nal_unit_type; 1051 struct timespec
4664 int ref2frm[2][64]; 1052 {
4665 int qscale; 1053 __time_t tv_sec;
4666 } H264Slice; 1054 long int tv_nsec;
4667 typedef struct 1055 };
4668 { 1056 struct H264Context
4669 H264Slice slice; 1057 {
4670 H264Mb *mbs; 1058 SliceBufferQueue sb_q[6];
4671 DecodedPicture *dp; 1059 RingLineQueue rl_q;
4672 GetBitContext gb; 1060 pthread_mutex_t lock[6];
4673 int lines_taken; 1061 pthread_cond_t cond[6];
4674 int lines_total; 1062 pthread_mutex_t task_lock;
4675 int state; 1063 pthread_cond_t task_cond;
4676 int initialized; 1064 pthread_attr_t ed_rec_attr[80];
4677 } SliceBufferEntry; 1065 pthread_t ed_rec_thr[80];
4678 typedef struct RingLineEntry 1066 int init_threads;
4679 { 1067 pthread_mutex_t ilock;
4680 union 1068 pthread_cond_t icond;
4681 { 1069 const char *file_name;
4682 volatile int32_t __attribute__((aligned(64))) mb_cnt; 1070 int profile;
4683 int32_t __attribute__((aligned(64))) pad[16]; 1071 int start;
4684 }; 1072 int touch_start;
4685 SliceBufferEntry *sbe; 1073 int setaff;
4686 int id; 1074 int touch_done;
4687 int line; 1075 int rl_side_touch;
4688 TopBorder *top; 1076 int statmbd;
4689 struct RingLineEntry *prev_line; 1077 pthread_mutex_t slock;
4690 } RingLineEntry; 1078 pthread_cond_t scond;
4691 typedef struct SuperMBTask 1079 pthread_mutex_t tlock;
4692 { 1080 pthread_cond_t tcond;
4693 int smb_x; 1081 pthread_mutex_t tdlock;
4694 int smb_y; 1082 pthread_cond_t tdcond;
4695 } SuperMBTask; 1083 int ed_ppe_threads;
4696 typedef struct SuperMBContext 1084 int threads;
4697 { 1085 int smt;
4698 int nsmb_width; 1086 int acdpb_cnt;
4699 int nsmb_height; 1087 int reldpb_cnt;
4700 int nsmb_3dheight; 1088 int sb_size;
4701 int smb_width; 1089 SliceBufferEntry *sb;
4702 int smb_height; 1090 int free_sb_cnt;
4703 int refcount; 1091 int slice_bufs;
4704 int index; 1092 int max_dpb_cnt;
4705 SuperMBTask *smbs[2]; 1093 DecodedPicture *dpb;
4706 } SuperMBContext; 1094 int free_dpb_cnt;
4707 typedef struct MBRecState 1095 int ifile;
4708 { 1096 int ofile;
4709 int8_t *ref_index_top[2]; 1097 int frame_width;
4710 int8_t *ref_index[2]; 1098 int frame_height;
4711 int16_t (*motion_val_top[2])[2]; 1099 int num_frames;
4712 int16_t (*motion_val[2])[2]; 1100 int width;
4713 uint32_t *mb_type_top; 1101 int height;
4714 uint32_t *mb_type; 1102 int mb_width;
4715 int8_t *list1_ref_index[2]; 1103 int mb_height;
4716 int16_t (*list1_motion_val[2])[2]; 1104 int mb_stride;
4717 uint32_t *list1_mb_type; 1105 int b4_stride;
4718 int8_t *intra4x4_pred_mode_top; 1106 int b_stride;
4719 int8_t *intra4x4_pred_mode; 1107 int smb_height;
4720 int8_t *non_zero_count_top; 1108 int smb_width;
4721 int8_t *non_zero_count; 1109 pthread_mutex_t smb_lock;
4722 unsigned int topleft_samples_available; 1110 pthread_cond_t sdl_cond;
4723 unsigned int topright_samples_available; 1111 pthread_mutex_t sdl_lock;
4724 unsigned int top_samples_available; 1112 SuperMBContext *smbc;
4725 unsigned int left_samples_available; 1113 int wave_order;
4726 int top_type; 1114 int static_3d;
4727 int left_type; 1115 int pipe_bufs;
4728 int8_t __attribute__((aligned(8))) intra4x4_pred_mode_cache[5 * 8]; 1116 uint8_t zigzag_scan[16];
4729 int16_t __attribute__((aligned(16))) mv_cache[2][5 * 8][2]; 1117 uint8_t zigzag_scan8x8[64];
4730 int8_t __attribute__((aligned(8))) ref_cache[2][5 * 8]; 1118 int verbose;
4731 uint8_t __attribute__((aligned(8))) non_zero_count_cache[6 * 8]; 1119 int no_mbd;
4732 uint8_t __attribute__((aligned(16))) mvd_cache[2][5 * 8][2]; 1120 int display;
4733 int16_t __attribute__((aligned(8))) bS[2][4][4]; 1121 int fullscreen;
4734 uint8_t edges[2]; 1122 int quit;
4735 } MBRecState; 1123 struct timespec start_time[4];
4736 typedef struct MBRecContext 1124 struct timespec end_time[4];
4737 { 1125 double last_time[4];
4738 DSPContext dsp; 1126 double total_time[4];
4739 H264DSPContext hdsp; 1127 };
4740 H264PredContext hpc;
4741 MBRecState *mrs;
4742 RingLineEntry *rle;
4743 uint8_t *scratchpad_y;
4744 uint8_t *scratchpad_cb;
4745 uint8_t *scratchpad_cr;
4746 int linesize;
4747 int uvlinesize;
4748 int mb_width;
4749 int mb_height;
4750 int mb_stride;
4751 int b_stride;
4752 int width;
4753 int height;
4754 int block_offset[16 + 8];
4755 } MBRecContext;
4756 typedef struct OutputContext
4757 {
4758 int bit_buffer_size;
4759 uint8_t *bit_buffer;
4760 uint64_t video_size;
4761 int frame_number;
4762 DecodedPicture *delayed_pic[33];
4763 int dp_cnt;
4764 } OutputContext;
4765 typedef struct
4766 {
4767 pthread_mutex_t lock;
4768 pthread_cond_t cond;
4769 SliceBufferEntry **queue;
4770 int size;
4771 int cnt;
4772 int fi;
4773 int fo;
4774 } SliceBufferQueue;
4775 typedef struct
4776 {
4777 pthread_mutex_t wslock;
4778 pthread_cond_t wscond;
4779 pthread_mutex_t swlock;
4780 pthread_cond_t swcond;
4781 RingLineEntry **queue;
4782 int size;
4783 int ready;
4784 int free;
4785 int fi;
4786 int fo;
4787 } RingLineQueue;
4788 typedef struct H264Context
4789 {
4790 SliceBufferQueue sb_q[STAGES];
4791 RingLineQueue rl_q;
4792 pthread_mutex_t lock[STAGES];
4793 pthread_cond_t cond[STAGES];
4794 pthread_mutex_t task_lock;
4795 pthread_cond_t task_cond;
4796 pthread_attr_t ed_rec_attr[80];
4797 pthread_t ed_rec_thr[80];
4798 int init_threads;
4799 pthread_mutex_t ilock;
4800 pthread_cond_t icond;
4801 const char *file_name;
4802 int profile;
4803 int start;
4804 int touch_start;
4805 int setaff;
4806 int touch_done;
4807 int rl_side_touch;
4808 int statmbd;
4809 pthread_mutex_t slock;
4810 pthread_cond_t scond;
4811 pthread_mutex_t tlock;
4812 pthread_cond_t tcond;
4813 pthread_mutex_t tdlock;
4814 pthread_cond_t tdcond;
4815 int ed_ppe_threads;
4816 int threads;
4817 int smt;
4818 int acdpb_cnt;
4819 int reldpb_cnt;
4820 int sb_size;
4821 SliceBufferEntry *sb;
4822 int free_sb_cnt;
4823 int slice_bufs;
4824 int max_dpb_cnt;
4825 DecodedPicture *dpb;
4826 int free_dpb_cnt;
4827 int ifile;
4828 int ofile;
4829 int frame_width;
4830 int frame_height;
4831 int num_frames;
4832 int width;
4833 int height;
4834 int mb_width;
4835 int mb_height;
4836 int mb_stride;
4837 int b4_stride;
4838 int b_stride;
4839 int smb_height;
4840 int smb_width;
4841 pthread_mutex_t smb_lock;
4842 pthread_cond_t sdl_cond;
4843 pthread_mutex_t sdl_lock;
4844 SuperMBContext *smbc;
4845 int wave_order;
4846 int static_3d;
4847 int pipe_bufs;
4848 uint8_t zigzag_scan[16];
4849 uint8_t zigzag_scan8x8[64];
4850 int verbose;
4851 int no_mbd;
4852 int display;
4853 int fullscreen;
4854 int quit;
4855 struct timespec start_time[PROFILE_STAGES];
4856 struct timespec end_time[PROFILE_STAGES];
4857 double last_time[PROFILE_STAGES];
4858 double total_time[PROFILE_STAGES];
4859 } H264Context;
4860 void av_read_frame_internal(ParserContext *pc, GetBitContext *gb); 1128 void av_read_frame_internal(ParserContext *pc, GetBitContext *gb);
4861 ParserContext *get_parse_context(int ifile);
4862 void free_parse_context(ParserContext *pc);
4863 int decode_nal_units(NalContext *n, H264Slice *s, GetBitContext *gb); 1129 int decode_nal_units(NalContext *n, H264Slice *s, GetBitContext *gb);
4864 NalContext *get_nal_context(int width, int height); 1130 static void parse_task(H264Context *h, ParserContext *pc, NalContext *nc, SliceBufferEntry *sbe)
4865 void free_nal_context(NalContext *nc); 1131 {
4866 int ff_h264_decode_mb_cabac(EntropyContext *ec, H264Slice *s, CABACContext *c); 1132 H264Slice *s;
1133 if (!(*sbe).initialized)
1134 {
1135 {
1136 init_sb_entry(h, sbe);
1137 (*sbe).lines_total = (*h).mb_height;
1138 }
1139 }
1140 av_read_frame_internal(pc, &(*sbe).gb);
1141 s = &(*sbe).slice;
1142 decode_nal_units(nc, s, &(*sbe).gb);
1143 }
1144 struct EntropyContext;
1145 typedef struct EntropyContext EntropyContext;
1146 struct EntropyContext
1147 {
1148 CABACContext c;
1149 H264Mb *m;
1150 int top_cbp;
1151 int left_cbp;
1152 int neighbor_transform_size;
1153 uint32_t top_type;
1154 uint32_t left_type;
1155 uint32_t topright_type;
1156 uint32_t topleft_type;
1157 int curr_qscale;
1158 int chroma_qp[2];
1159 int last_qscale_diff;
1160 uint32_t dequant4_buffer[6][52][16];
1161 uint32_t dequant8_buffer[2][52][64];
1162 uint32_t (*dequant4_coeff[6])[16];
1163 uint32_t (*dequant8_coeff[2])[64];
1164 uint8_t (*non_zero_count_top)[8];
1165 uint8_t (*non_zero_count)[8];
1166 uint8_t (*non_zero_count_row[2])[8];
1167 __attribute__((aligned(8))) uint8_t non_zero_count_left[8];
1168 uint8_t (*mvd_top[2])[2];
1169 uint8_t (*mvd[2])[2];
1170 uint8_t (*mvd_table[2][2])[2];
1171 uint8_t *direct_top;
1172 uint8_t *direct;
1173 uint8_t *direct_table[2];
1174 uint8_t *chroma_pred_mode_top;
1175 uint8_t *chroma_pred_mode;
1176 uint8_t *chroma_pred_mode_table[2];
1177 uint16_t *cbp_top;
1178 uint16_t *cbp;
1179 uint16_t *cbp_table[2];
1180 int8_t *qscale_top;
1181 int8_t *qscale;
1182 int8_t *qscale_table[2];
1183 int8_t *ref_index_top[2];
1184 int8_t *ref_index[2];
1185 int8_t *ref_index_table[2][2];
1186 uint32_t *mb_type_top;
1187 uint32_t *mb_type;
1188 uint32_t *mb_type_table[2];
1189 int b_stride;
1190 int mb_stride;
1191 int mb_width;
1192 int mb_height;
1193 uint8_t *zigzag_scan;
1194 uint8_t *zigzag_scan8x8;
1195 uint8_t direct_cache[40];
1196 __attribute__((aligned(8))) int8_t intra4x4_pred_mode_cache[40];
1197 __attribute__((aligned(16))) int16_t mv_cache[2][40][2];
1198 __attribute__((aligned(8))) int8_t ref_cache[2][40];
1199 __attribute__((aligned(8))) uint8_t non_zero_count_cache[48];
1200 __attribute__((aligned(16))) uint8_t mvd_cache[2][40][2];
1201 };
1202 void init_dequant_tables(H264Slice *s, EntropyContext *ec);
1203 void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
4867 void ff_h264_init_cabac_states(EntropyContext *ec, H264Slice *s, CABACContext *c); 1204 void ff_h264_init_cabac_states(EntropyContext *ec, H264Slice *s, CABACContext *c);
4868 int init_entropy_buf(EntropyContext *ec, H264Slice *s, int line); 1205 int init_entropy_buf(EntropyContext *ec, H264Slice *s, int line);
4869 EntropyContext *get_entropy_context(H264Context *h); 1206 struct H264Mb
4870 void init_dequant_tables(H264Slice *s, EntropyContext *ec); 1207 {
4871 void free_entropy_context(EntropyContext *ec); 1208 int16_t mb_x;
4872 MBRecContext *get_mbrec_context(H264Context *h); 1209 int16_t mb_y;
4873 void free_mbrec_context(MBRecContext *d); 1210 int32_t mb_type;
1211 uint16_t cbp;
1212 int8_t qscale_mb_xy;
1213 int8_t qscale_left_mb_xy;
1214 int8_t qscale_top_mb_xy;
1215 __attribute__((aligned(8))) uint16_t sub_mb_type[4];
1216 __attribute__((aligned(8))) uint8_t non_zero_count[24];
1217 __attribute__((aligned(16))) int16_t mb[384];
1218 union
1219 {
1220 struct
1221 {
1222 __attribute__((aligned(8))) int8_t ref_index[2][4];
1223 __attribute__((aligned(16))) int16_t mvd[2][16][2];
1224 };
1225 struct
1226 {
1227 __attribute__((aligned(8))) int8_t intra4x4_pred_mode[16];
1228 int8_t chroma_pred_mode;
1229 int8_t intra16x16_pred_mode;
1230 };
1231 };
1232 __attribute__((aligned(8))) uint8_t top_border[32];
1233 __attribute__((aligned(8))) uint8_t top_border_next[8];
1234 __attribute__((aligned(8))) uint8_t left_border[35];
1235 int8_t intra4x4_pred_mode_left[4];
1236 };
1237 int ff_h264_decode_mb_cabac(EntropyContext *ec, H264Slice *s, CABACContext *c);
1238 static void decode_slice_entropy_task(H264Context *h, EntropyContext *ec, SliceBufferEntry *sbe)
1239 {
1240 int j;
1241 int i;
1242 H264Slice *s = &(*sbe).slice;
1243 GetBitContext *gb = &(*sbe).gb;
1244 H264Mb *mbs = (*sbe).mbs;
1245 CABACContext *c = &(*ec).c;
1246 if (!(*s).pps.cabac)
1247 {
1248 {
1249 av_log(16, "Only cabac encoded streams are supported\n");
1250 return ;
1251 }
1252 }
1253 init_dequant_tables(s, ec);
1254 (*ec).curr_qscale = (*s).qscale;
1255 (*ec).last_qscale_diff = 0;
1256 (*ec).chroma_qp[0] = get_chroma_qp((H264Slice *)s, 0, (*s).qscale);
1257 (*ec).chroma_qp[1] = get_chroma_qp((H264Slice *)s, 1, (*s).qscale);
1258 align_get_bits(gb);
1259 ff_init_cabac_decoder(c, (*gb).buffer + get_bits_count(gb) / 8, (get_bits_left(gb) + 7) / 8);
1260 ff_h264_init_cabac_states(ec, s, c);
1261 for (j = 0; j < (*ec).mb_height; j++)
1262 {
1263 {
1264 init_entropy_buf(ec, s, j);
1265 for (i = 0; i < (*ec).mb_width; i++)
1266 {
1267 {
1268 int ret;
1269 int eos;
1270 H264Mb *m = &mbs[i + j * (*ec).mb_width];
1271 (*m).mb_x = i;
1272 (*m).mb_y = j;
1273 (*ec).m = m;
1274 ret = ff_h264_decode_mb_cabac(ec, s, c);
1275 eos = get_cabac_terminate(c);
1276 (void)eos;
1277 if (ret < 0 || (*c).bytestream > (*c).bytestream_end + 2)
1278 {
1279 {
1280 av_log(16, "error while decoding MB %d %d, bytestream (%td)\n", (*m).mb_x, (*m).mb_y, (*c).bytestream_end - (*c).bytestream);
1281 return ;
1282 }
1283 }
1284 }
1285 }
1286 }
1287 }
1288 }
1289 struct MBRecContext;
1290 typedef struct MBRecContext MBRecContext;
1291 struct SuperMBTask;
1292 typedef struct SuperMBTask SuperMBTask;
1293 struct SuperMBContext
1294 {
1295 int nsmb_width;
1296 int nsmb_height;
1297 int nsmb_3dheight;
1298 int smb_width;
1299 int smb_height;
1300 int refcount;
1301 int index;
1302 SuperMBTask *smbs[2];
1303 };
1304 struct MBRecState;
1305 typedef struct MBRecState MBRecState;
1306 void init_mbrec_context(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, int line);
1307 struct MBRecState
1308 {
1309 int8_t *ref_index_top[2];
1310 int8_t *ref_index[2];
1311 int16_t (*motion_val_top[2])[2];
1312 int16_t (*motion_val[2])[2];
1313 uint32_t *mb_type_top;
1314 uint32_t *mb_type;
1315 int8_t *list1_ref_index[2];
1316 int16_t (*list1_motion_val[2])[2];
1317 uint32_t *list1_mb_type;
1318 int8_t *intra4x4_pred_mode_top;
1319 int8_t *intra4x4_pred_mode;
1320 int8_t *non_zero_count_top;
1321 int8_t *non_zero_count;
1322 unsigned int topleft_samples_available;
1323 unsigned int topright_samples_available;
1324 unsigned int top_samples_available;
1325 unsigned int left_samples_available;
1326 int top_type;
1327 int left_type;
1328 __attribute__((aligned(8))) int8_t intra4x4_pred_mode_cache[40];
1329 __attribute__((aligned(16))) int16_t mv_cache[2][40][2];
1330 __attribute__((aligned(8))) int8_t ref_cache[2][40];
1331 __attribute__((aligned(8))) uint8_t non_zero_count_cache[48];
1332 __attribute__((aligned(16))) uint8_t mvd_cache[2][40][2];
1333 __attribute__((aligned(8))) int16_t bS[2][4][4];
1334 uint8_t edges[2];
1335 };
1336 typedef short int DCTELEM;
1337 typedef void (*op_pixels_func)(uint8_t *, const uint8_t *, int, int);
1338 typedef void (*qpel_mc_func)(uint8_t *, uint8_t *, int);
1339 typedef void (*h264_chroma_mc_func)(uint8_t *, uint8_t *, int, int, int, int);
1340 struct DSPContext
1341 {
1342 void (*get_pixels)(DCTELEM *, const uint8_t *, int);
1343 void (*diff_pixels)(DCTELEM *, const uint8_t *, const uint8_t *, int);
1344 void (*put_pixels_clamped)(const DCTELEM *, uint8_t *, int);
1345 void (*put_signed_pixels_clamped)(const DCTELEM *, uint8_t *, int);
1346 void (*put_pixels_nonclamped)(const DCTELEM *, uint8_t *, int);
1347 void (*add_pixels_clamped)(const DCTELEM *, uint8_t *, int);
1348 void (*add_pixels8)(uint8_t *, DCTELEM *, int);
1349 void (*add_pixels4)(uint8_t *, DCTELEM *, int);
1350 void (*clear_block)(DCTELEM *);
1351 void (*clear_blocks)(DCTELEM *);
1352 void (*put_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int);
1353 void (*avg_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int);
1354 void (*put_no_rnd_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int);
1355 void (*avg_no_rnd_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int);
1356 void (*put_no_rnd_pixels_l2[2])(uint8_t *, const uint8_t *, const uint8_t *, int, int);
1357 void (*put_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int);
1358 void (*avg_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int);
1359 void (*put_no_rnd_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int);
1360 void (*avg_no_rnd_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int);
1361 void (*put_mspel_pixels_tab[8])(uint8_t *, uint8_t *, int);
1362 void (*put_h264_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int);
1363 void (*avg_h264_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int);
1364 void (*put_no_rnd_vc1_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int);
1365 void (*avg_no_rnd_vc1_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int);
1366 void (*put_h264_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int);
1367 void (*avg_h264_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int);
1368 void (*put_2tap_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int);
1369 void (*avg_2tap_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int);
1370 void (*fdct)(DCTELEM *);
1371 void (*fdct248)(DCTELEM *);
1372 void (*idct)(DCTELEM *);
1373 void (*idct_put)(uint8_t *, int, DCTELEM *);
1374 void (*idct_add)(uint8_t *, int, DCTELEM *);
1375 void (*draw_edges)(uint8_t *, int, int, int, int);
1376 void (*prefetch)(void *, int, int);
1377 };
1378 typedef struct DSPContext DSPContext;
1379 typedef void (*h264_weight_func)(uint8_t *, int, int, int, int);
1380 typedef void (*h264_biweight_func)(uint8_t *, uint8_t *, int, int, int, int, int);
1381 struct H264DSPContext
1382 {
1383 void (*weight_h264_pixels_tab[10])(uint8_t *, int, int, int, int);
1384 void (*biweight_h264_pixels_tab[10])(uint8_t *, uint8_t *, int, int, int, int, int);
1385 void (*h264_v_loop_filter_luma)(uint8_t *, int, int, int, int8_t *);
1386 void (*h264_h_loop_filter_luma)(uint8_t *, int, int, int, int8_t *);
1387 void (*h264_v_loop_filter_luma_intra)(uint8_t *, int, int, int);
1388 void (*h264_h_loop_filter_luma_intra)(uint8_t *, int, int, int);
1389 void (*h264_v_loop_filter_chroma)(uint8_t *, int, int, int, int8_t *);
1390 void (*h264_h_loop_filter_chroma)(uint8_t *, int, int, int, int8_t *);
1391 void (*h264_v_loop_filter_chroma_intra)(uint8_t *, int, int, int);
1392 void (*h264_h_loop_filter_chroma_intra)(uint8_t *, int, int, int);
1393 void (*h264_loop_filter_strength)(int16_t [2][4][4], uint8_t [40], int8_t [2][40], int16_t [2][40][2], int, int, int, int, int, int);
1394 void (*h264_idct_add)(uint8_t *, DCTELEM *, int);
1395 void (*h264_idct8_add)(uint8_t *, DCTELEM *, int);
1396 void (*h264_idct_dc_add)(uint8_t *, DCTELEM *, int);
1397 void (*h264_idct8_dc_add)(uint8_t *, DCTELEM *, int);
1398 void (*h264_dct)(DCTELEM [4][4]);
1399 void (*h264_idct_add16)(uint8_t *, const int *, DCTELEM *, int, const uint8_t [48]);
1400 void (*h264_idct8_add4)(uint8_t *, const int *, DCTELEM *, int, const uint8_t [48]);
1401 void (*h264_idct_add8)(uint8_t **, const int *, DCTELEM *, int, const uint8_t [48]);
1402 void (*h264_idct_add16intra)(uint8_t *, const int *, DCTELEM *, int, const uint8_t [48]);
1403 void (*(*qpel_put)[16])(uint8_t *, uint8_t *, int);
1404 void (*(*qpel_avg)[16])(uint8_t *, uint8_t *, int);
1405 };
1406 typedef struct H264DSPContext H264DSPContext;
1407 struct H264PredContext
1408 {
1409 void (*pred4x4[15])(uint8_t *, uint8_t *, int);
1410 void (*pred8x8l[12])(uint8_t *, int, int, int);
1411 void (*pred8x8[11])(uint8_t *, int);
1412 void (*pred16x16[7])(uint8_t *, int);
1413 void (*pred4x4_add[2])(uint8_t *, const DCTELEM *, int);
1414 void (*pred8x8l_add[2])(uint8_t *, const DCTELEM *, int);
1415 void (*pred8x8_add[3])(uint8_t *, const int *, const DCTELEM *, int);
1416 void (*pred16x16_add[3])(uint8_t *, const int *, const DCTELEM *, int);
1417 };
1418 typedef struct H264PredContext H264PredContext;
1419 struct MBRecContext
1420 {
1421 DSPContext dsp;
1422 H264DSPContext hdsp;
1423 H264PredContext hpc;
1424 MBRecState *mrs;
1425 RingLineEntry *rle;
1426 uint8_t *scratchpad_y;
1427 uint8_t *scratchpad_cb;
1428 uint8_t *scratchpad_cr;
1429 int linesize;
1430 int uvlinesize;
1431 int mb_width;
1432 int mb_height;
1433 int mb_stride;
1434 int b_stride;
1435 int width;
1436 int height;
1437 int block_offset[24];
1438 };
4874 void h264_decode_mb_internal(MBRecContext *d, MBRecState *mrs, H264Slice *s, H264Mb *m); 1439 void h264_decode_mb_internal(MBRecContext *d, MBRecState *mrs, H264Slice *s, H264Mb *m);
4875 void init_mbrec_context(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, int line); 1440 static void decode_super_mb_block(MBRecContext *d, H264Slice *s, SuperMBContext *smbc, H264Mb *mbs, int smb_x, int smb_y)
4876 void ff_h264_pred_direct_motion_rec(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, int *mb_type); 1441 {
4877 int pred_motion_mb_rec(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, H264Mb *m); 1442 MBRecState mrs;
4878 void start_timer(H264Context *h, int stage); 1443 for (int k = 0, i = smb_y; i < smb_y + (*smbc).smb_height; (i++, k++))
4879 void stop_timer(H264Context *h, int stage); 1444 {
4880 void init_sb_entry(H264Context *h, SliceBufferEntry *sbe); 1445 {
4881 void free_sb_entry(SliceBufferEntry *sb); 1446 init_mbrec_context(d, &mrs, s, i);
4882 SliceBufferEntry *get_sb_entry(H264Context *h); 1447 for (int j = smb_x - k; j < smb_x - k + (*smbc).smb_width; j++)
4883 void release_sb_entry(H264Context *h, SliceBufferEntry *sb); 1448 {
4884 DecodedPicture *get_dpb_entry(H264Context *h, H264Slice *s); 1449 {
4885 void release_dpb_entry(H264Context *h, DecodedPicture *pic, int mode); 1450 if ((i < (*d).mb_height && j >= 0) && j < (*d).mb_width)
1451 {
1452 {
1453 h264_decode_mb_internal(d, &mrs, s, &mbs[i * (*d).mb_width + j]);
1454 }
1455 }
1456 }
1457 }
1458 }
1459 }
1460 }
1461 struct SuperMBTask
1462 {
1463 int smb_x;
1464 int smb_y;
1465 };
1466 static void decode_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *m)
1467 {
1468 H264Slice *s = &(*sbe).slice;
1469 H264Mb *mbs = (*sbe).mbs;
1470 decode_super_mb_block(d, s, smbc, mbs, (*m).smb_x, (*m).smb_y);
1471 }
4886 void draw_edges(MBRecContext *d, H264Slice *s, int line); 1472 void draw_edges(MBRecContext *d, H264Slice *s, int line);
4887 int ff_init_slice(NalContext *n, H264Slice *s); 1473 static void draw_edges_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *sm, int line)
4888 void free_picture(PictureInfo *pic); 1474 {
4889 void free_dp(DecodedPicture *pic); 1475 H264Slice *s = &(*sbe).slice;
4890 void av_start_timer(); 1476 for (int i = line * (*smbc).smb_height; i < (line + 1) * (*smbc).smb_height && i < (*d).mb_height; i++)
4891 int copyEDtoH264Slice(H264Slice *ms, H264Slice *es); 1477 {
4892 void print_report(int frame_number, uint64_t video_size, int is_last_report, int verbose); 1478 draw_edges(d, s, i);
4893 int ff_alloc_picture_info(NalContext *n, H264Slice *s, PictureInfo *pic); 1479 }
4894 DecodedPicture *output_frame(H264Context *h, OutputContext *oc, DecodedPicture *pic, int fd, int frame_width, int frame_height); 1480 }
4895 OutputContext *get_output_context(H264Context *h); 1481 SuperMBContext *acquire_smbc(H264Context *h);
4896 void free_output_context(OutputContext *oc); 1482 enum mcc_enum_anon_8
4897 void freeSuperMBContext(SuperMBContext *smbc); 1483 {
4898 SuperMBContext *getSuperMBContext(H264Context *h, int smb_width, int smb_height); 1484 NANOS_OK = 0,
1485 NANOS_UNKNOWN_ERR = 1,
1486 NANOS_UNIMPLEMENTED = 2,
1487 NANOS_ENOMEM = 3,
1488 NANOS_INVALID_PARAM = 4
1489 };
1490 typedef enum mcc_enum_anon_8 nanos_err_t;
1491 extern nanos_err_t nanos_in_final(_Bool *result);
1492 struct mcc_struct_anon_20
1493 {
1494 void (*outline)(void *);
1495 };
1496 typedef struct mcc_struct_anon_20 nanos_smp_args_t;
1497 struct nanos_args_0_t
1498 {
1499 MBRecContext *d;
1500 SliceBufferEntry *sbe;
1501 SuperMBContext *smbc;
1502 SuperMBTask *ml;
1503 SuperMBTask *mur;
1504 SuperMBTask *m;
1505 };
1506 static void smp_ol_decode_super_mb_task_1(struct nanos_args_0_t *const args);
1507 struct mcc_struct_anon_16
1508 {
1509 _Bool mandatory_creation:1;
1510 _Bool tied:1;
1511 _Bool clear_chunk:1;
1512 _Bool reserved0:1;
1513 _Bool reserved1:1;
1514 _Bool reserved2:1;
1515 _Bool reserved3:1;
1516 _Bool reserved4:1;
1517 };
1518 typedef struct mcc_struct_anon_16 nanos_wd_props_t;
1519 typedef unsigned long int size_t;
1520 struct nanos_const_wd_definition_tag
1521 {
1522 nanos_wd_props_t props;
1523 size_t data_alignment;
1524 size_t num_copies;
1525 size_t num_devices;
1526 size_t num_dimensions;
1527 const char *description;
1528 };
1529 typedef struct nanos_const_wd_definition_tag nanos_const_wd_definition_t;
1530 struct mcc_struct_anon_19
1531 {
1532 void *(*factory)(void *);
1533 void *arg;
1534 };
1535 typedef struct mcc_struct_anon_19 nanos_device_t;
1536 struct nanos_const_wd_definition_1
1537 {
1538 nanos_const_wd_definition_t base;
1539 nanos_device_t devices[1];
1540 };
1541 extern void *nanos_smp_factory(void *args);
1542 struct mcc_struct_anon_17
1543 {
1544 _Bool is_final:1;
1545 _Bool reserved1:1;
1546 _Bool reserved2:1;
1547 _Bool reserved3:1;
1548 _Bool reserved4:1;
1549 _Bool reserved5:1;
1550 _Bool reserved6:1;
1551 _Bool reserved7:1;
1552 };
1553 typedef struct mcc_struct_anon_17 nanos_wd_dyn_flags_t;
1554 typedef void *nanos_thread_t;
1555 struct mcc_struct_anon_18
1556 {
1557 nanos_wd_dyn_flags_t flags;
1558 void *tie_to;
1559 unsigned int priority;
1560 };
1561 typedef struct mcc_struct_anon_18 nanos_wd_dyn_props_t;
1562 typedef void *nanos_wd_t;
1563 struct mcc_struct_anon_9;
1564 typedef struct mcc_struct_anon_9 nanos_copy_data_internal_t;
1565 typedef nanos_copy_data_internal_t nanos_copy_data_t;
1566 struct mcc_struct_anon_5;
1567 typedef struct mcc_struct_anon_5 nanos_region_dimension_internal_t;
1568 typedef void *nanos_wg_t;
1569 extern nanos_err_t nanos_create_wd_compact(void **wd, nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void **data, void *wg, nanos_copy_data_t **copies, nanos_region_dimension_internal_t **dimensions);
1570 extern void *nanos_current_wd(void);
1571 extern void nanos_handle_error(nanos_err_t err);
1572 struct mcc_struct_anon_5
1573 {
1574 size_t size;
1575 size_t lower_bound;
1576 size_t accessed_length;
1577 };
1578 typedef nanos_region_dimension_internal_t nanos_region_dimension_t;
1579 struct mcc_struct_anon_6
1580 {
1581 _Bool input:1;
1582 _Bool output:1;
1583 _Bool can_rename:1;
1584 _Bool concurrent:1;
1585 _Bool commutative:1;
1586 };
1587 typedef struct mcc_struct_anon_6 nanos_access_type_internal_t;
1588 typedef long int ptrdiff_t;
1589 struct mcc_struct_anon_7
1590 {
1591 void *address;
1592 nanos_access_type_internal_t flags;
1593 short int dimension_count;
1594 const nanos_region_dimension_internal_t *dimensions;
1595 ptrdiff_t offset;
1596 };
1597 typedef struct mcc_struct_anon_7 nanos_data_access_internal_t;
1598 typedef nanos_data_access_internal_t nanos_data_access_t;
1599 typedef void *nanos_team_t;
1600 extern nanos_err_t nanos_submit(void *wd, size_t num_data_accesses, nanos_data_access_t *data_accesses, void *team);
1601 typedef void (*nanos_translate_args_t)(void *, void *);
1602 extern nanos_err_t nanos_create_wd_and_run_compact(nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void *data, size_t num_data_accesses, nanos_data_access_t *data_accesses, nanos_copy_data_t *copies, nanos_region_dimension_internal_t *dimensions, void (*translate_args)(void *, void *));
1603 struct nanos_args_1_t
1604 {
1605 MBRecContext *d;
1606 SliceBufferEntry *sbe;
1607 SuperMBContext *smbc;
1608 SuperMBTask *sm;
1609 int line;
1610 };
1611 static void smp_ol_draw_edges_task_3(struct nanos_args_1_t *const args);
1612 extern nanos_err_t nanos_wait_on(size_t num_data_accesses, nanos_data_access_t *data_accesses);
4899 void release_smbc(H264Context *h, SuperMBContext *smbc); 1613 void release_smbc(H264Context *h, SuperMBContext *smbc);
4900 SuperMBContext *acquire_smbc(H264Context *h); 1614 static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe)
4901 static inline int get_chroma_qp(H264Slice *s, int t, int qscale) 1615 {
4902 { 1616 int j;
4903 return s->pps.chroma_qp_table[t][qscale]; 1617 int i;
4904 } 1618 SuperMBTask *sml;
4905 static void parse_task(H264Context *h, ParserContext *pc, NalContext *nc, SliceBufferEntry *sbe) 1619 SuperMBTask *smur;
4906 { 1620 SuperMBContext *smbc = acquire_smbc(h);
4907 H264Slice *s; 1621 int smb_height = (*smbc).nsmb_height;
4908 if (!sbe->initialized) 1622 int smb_width = (*smbc).nsmb_width;
4909 { 1623 SuperMBTask *smbs = (*smbc).smbs[0];
4910 init_sb_entry(h, sbe); 1624 SuperMBTask *sm = (void *)0;
4911 sbe->lines_total = h->mb_height; 1625 for (j = 0; j < smb_height; j++)
4912 } 1626 {
4913 av_read_frame_internal(pc, &sbe->gb); 1627 {
4914 s = &sbe->slice; 1628 nanos_err_t mcc_err_in_final_1;
4915 decode_nal_units(nc, s, &sbe->gb); 1629 _Bool mcc_is_in_final_1;
4916 } 1630 for (i = 0; i < smb_width; i++)
4917 static void decode_slice_entropy_task(H264Context *h, EntropyContext *ec, SliceBufferEntry *sbe) 1631 {
4918 { 1632 {
4919 int i, j; 1633 nanos_err_t mcc_err_in_final_0;
4920 H264Slice *s = &sbe->slice; 1634 _Bool mcc_is_in_final_0;
4921 GetBitContext *gb = &sbe->gb; 1635 sm = smbs + j * smb_width + i;
4922 H264Mb *mbs = sbe->mbs; 1636 sml = sm - (i > 0 ? 1 : 0);
4923 CABACContext *c = &ec->c; 1637 smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0);
4924 if (!s->pps.cabac) 1638 mcc_err_in_final_0 = nanos_in_final(&mcc_is_in_final_0);
4925 { 1639 {
4926 av_log(16, "Only cabac encoded streams are supported\n"); 1640 MBRecContext *mcc_arg_0 = d;
4927 return; 1641 SliceBufferEntry *mcc_arg_1 = sbe;
4928 } 1642 SuperMBContext *mcc_arg_2 = smbc;
4929 init_dequant_tables(s, ec); 1643 SuperMBTask *mcc_arg_3 = sml;
4930 ec->curr_qscale = s->qscale; 1644 SuperMBTask *mcc_arg_4 = smur;
4931 ec->last_qscale_diff = 0; 1645 SuperMBTask *mcc_arg_5 = sm;
4932 ec->chroma_qp[0] = get_chroma_qp((H264Slice *) s, 0, s->qscale); 1646 if (mcc_is_in_final_0)
4933 ec->chroma_qp[1] = get_chroma_qp((H264Slice *) s, 1, s->qscale); 1647 {
4934 align_get_bits(gb); 1648 decode_super_mb_task(d, sbe, smbc, sml, smur, sm);
4935 ff_init_cabac_decoder(c, gb->buffer + get_bits_count(gb) / 8, (get_bits_left(gb) + 7) / 8); 1649 }
4936 ff_h264_init_cabac_states(ec, s, c); 1650 else
4937 for (j = 0; 1651 {
4938 j < ec->mb_height; 1652 {
4939 j++) 1653 nanos_wd_dyn_props_t nanos_wd_dyn_props;
4940 { 1654 struct nanos_args_0_t *ol_args;
4941 init_entropy_buf(ec, s, j); 1655 nanos_err_t err;
4942 for (i = 0; 1656 struct nanos_args_0_t imm_args;
4943 i < ec->mb_width; 1657 static nanos_smp_args_t smp_ol_decode_super_mb_task_1_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_0_t *))&smp_ol_decode_super_mb_task_1 };
4944 i++) 1658 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_0_t), 0, 1, 0, "decode_super_mb_task" }, { { &nanos_smp_factory, &smp_ol_decode_super_mb_task_1_args } } };
1659 nanos_wd_dyn_props.tie_to = 0;
1660 nanos_wd_dyn_props.priority = 0;
1661 nanos_wd_dyn_props.flags.is_final = 0;
1662 ol_args = (struct nanos_args_0_t *)0;
1663 void *nanos_wd_ = (void *)0;
1664 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_0_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
1665 if (err != NANOS_OK)
1666 {
1667 nanos_handle_error(err);
1668 }
1669 /* Check pendant writes on subexpressions */
1670 /* End check pendant writes on subexpressions */
1671 if (nanos_wd_ != (void *)0)
1672 {
1673 {
1674 (*ol_args).d = mcc_arg_0;
1675 (*ol_args).sbe = mcc_arg_1;
1676 (*ol_args).smbc = mcc_arg_2;
1677 (*ol_args).ml = mcc_arg_3;
1678 (*ol_args).mur = mcc_arg_4;
1679 (*ol_args).m = mcc_arg_5;
1680 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
1681 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
1682 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1683 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1684 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1685 nanos_data_access_t dependences[5] = { { (void *)mcc_arg_0, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_1, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_3, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_4, { 1, 0, 0, 0, 0 }, 1, dimensions_3, 0 }, { (void *)mcc_arg_5, { 1, 1, 0, 0, 0 }, 1, dimensions_4, 0 } };
1686 ;
1687 err = nanos_submit(nanos_wd_, 5, dependences, (void *)0);
1688 if (err != NANOS_OK)
1689 {
1690 nanos_handle_error(err);
1691 }
1692 }
1693 }
1694 else
1695 {
1696 {
1697 imm_args.d = mcc_arg_0;
1698 imm_args.sbe = mcc_arg_1;
1699 imm_args.smbc = mcc_arg_2;
1700 imm_args.ml = mcc_arg_3;
1701 imm_args.mur = mcc_arg_4;
1702 imm_args.m = mcc_arg_5;
1703 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
1704 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
1705 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1706 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1707 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1708 nanos_data_access_t dependences[5] = { { (void *)mcc_arg_0, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_1, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_3, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_4, { 1, 0, 0, 0, 0 }, 1, dimensions_3, 0 }, { (void *)mcc_arg_5, { 1, 1, 0, 0, 0 }, 1, dimensions_4, 0 } };
1709 ;
1710 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_0_t), &imm_args, 5, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
1711 if (err != NANOS_OK)
1712 {
1713 nanos_handle_error(err);
1714 }
1715 }
1716 }
1717 }
1718 }
1719 }
1720 }
1721 }
1722 mcc_err_in_final_1 = nanos_in_final(&mcc_is_in_final_1);
4945 { 1723 {
4946 int eos, ret; 1724 MBRecContext *mcc_arg_6 = d;
4947 H264Mb *m = &mbs[i + j * ec->mb_width]; 1725 SliceBufferEntry *mcc_arg_7 = sbe;
4948 m->mb_x = i; 1726 SuperMBContext *mcc_arg_8 = smbc;
4949 m->mb_y = j; 1727 SuperMBTask *mcc_arg_9 = sm;
4950 ec->m = m; 1728 int mcc_arg_10 = j;
4951 ret = ff_h264_decode_mb_cabac(ec, s, c); 1729 if (mcc_is_in_final_1)
4952 eos = get_cabac_terminate(c);
4953 (void) eos;
4954 if (ret < 0 || c->bytestream > c->bytestream_end + 2)
4955 { 1730 {
4956 av_log(16, "error while decoding MB %d %d, bytestream (%td)\n", m->mb_x, m->mb_y, c->bytestream_end - c->bytestream); 1731 draw_edges_task(d, sbe, smbc, sm, j);
4957 return; 1732 }
1733 else
1734 {
1735 {
1736 nanos_wd_dyn_props_t nanos_wd_dyn_props;
1737 struct nanos_args_1_t *ol_args;
1738 nanos_err_t err;
1739 struct nanos_args_1_t imm_args;
1740 static nanos_smp_args_t smp_ol_draw_edges_task_3_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_1_t *))&smp_ol_draw_edges_task_3 };
1741 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_1_t), 0, 1, 0, "draw_edges_task" }, { { &nanos_smp_factory, &smp_ol_draw_edges_task_3_args } } };
1742 nanos_wd_dyn_props.tie_to = 0;
1743 nanos_wd_dyn_props.priority = 0;
1744 nanos_wd_dyn_props.flags.is_final = 0;
1745 ol_args = (struct nanos_args_1_t *)0;
1746 void *nanos_wd_ = (void *)0;
1747 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_1_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
1748 if (err != NANOS_OK)
1749 {
1750 nanos_handle_error(err);
1751 }
1752 /* Check pendant writes on subexpressions */
1753 /* End check pendant writes on subexpressions */
1754 if (nanos_wd_ != (void *)0)
1755 {
1756 {
1757 (*ol_args).d = mcc_arg_6;
1758 (*ol_args).sbe = mcc_arg_7;
1759 (*ol_args).smbc = mcc_arg_8;
1760 (*ol_args).sm = mcc_arg_9;
1761 (*ol_args).line = mcc_arg_10;
1762 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
1763 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
1764 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1765 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_6, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_7, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_9, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
1766 ;
1767 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
1768 if (err != NANOS_OK)
1769 {
1770 nanos_handle_error(err);
1771 }
1772 }
1773 }
1774 else
1775 {
1776 {
1777 imm_args.d = mcc_arg_6;
1778 imm_args.sbe = mcc_arg_7;
1779 imm_args.smbc = mcc_arg_8;
1780 imm_args.sm = mcc_arg_9;
1781 imm_args.line = mcc_arg_10;
1782 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
1783 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
1784 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1785 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_6, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_7, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_9, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
1786 ;
1787 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_1_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
1788 if (err != NANOS_OK)
1789 {
1790 nanos_handle_error(err);
1791 }
1792 }
1793 }
1794 }
4958 } 1795 }
4959 } 1796 }
4960 } 1797 }
4961 } 1798 }
4962 static void decode_super_mb_block(MBRecContext *d, H264Slice *s, SuperMBContext *smbc, H264Mb *mbs, int smb_x, int smb_y) 1799 {
4963 { 1800 nanos_region_dimension_t dimensions_0[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
4964 MBRecState mrs; 1801 nanos_data_access_t dependences[1] = { { (void *)sm, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } };
4965 for (int k = 0, i = smb_y; 1802 ;
4966 i < smb_y + smbc->smb_height; 1803 nanos_err_t err = nanos_wait_on(1, dependences);
4967 i++ , k++) 1804 if (err != NANOS_OK)
4968 { 1805 {
4969 init_mbrec_context(d, &mrs, s, i); 1806 nanos_handle_error(err);
4970 for (int j = smb_x - k; 1807 }
4971 j < smb_x - k + smbc->smb_width; 1808 }
4972 j++) 1809 release_smbc(h, smbc);
1810 }
1811 struct DecodedPicture
1812 {
1813 int16_t (*motion_val[2])[2];
1814 int16_t (*motion_val_base[2])[2];
1815 int8_t *ref_index[2];
1816 uint32_t *mb_type;
1817 uint32_t *mb_type_base;
1818 int8_t *intra4x4_pred_mode;
1819 int8_t *non_zero_count;
1820 uint8_t *data[3];
1821 int linesize[3];
1822 uint8_t *base[3];
1823 int cpn;
1824 int poc;
1825 int reference;
1826 int key_frame;
1827 int mmco_reset;
1828 };
1829 struct nanos_lock_t;
1830 typedef struct nanos_lock_t nanos_lock_t;
1831 extern nanos_err_t nanos_set_lock(nanos_lock_t *lock);
1832 enum mcc_enum_anon_7
1833 {
1834 NANOS_LOCK_FREE = 0,
1835 NANOS_LOCK_BUSY = 1
1836 };
1837 typedef enum mcc_enum_anon_7 nanos_lock_state_t;
1838 struct nanos_lock_t
1839 {
1840 volatile nanos_lock_state_t state_;
1841 };
1842 __attribute__((weak)) nanos_lock_t nanos_critical_lock_dpb = { NANOS_LOCK_FREE };
1843 DecodedPicture *get_dpb_entry(H264Context *h, H264Slice *s);
1844 extern nanos_err_t nanos_unset_lock(nanos_lock_t *lock);
1845 void release_dpb_entry(H264Context *h, DecodedPicture *pic, int mode);
1846 static void decode_slice_mb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe)
1847 {
1848 H264Slice *s = &(*sbe).slice;
1849 for (int i = 0; i < 2; i++)
1850 {
1851 {
1852 for (int j = 0; j < (*s).ref_count[i]; j++)
1853 {
1854 {
1855 int k;
1856 if ((*s).ref_list_cpn[i][j] == -1)
1857 {
1858 continue;
1859 }
1860 for (k = 0; k < (*h).max_dpb_cnt; k++)
1861 {
1862 {
1863 if ((*h).dpb[k].reference >= 2 && (*h).dpb[k].cpn == (*s).ref_list_cpn[i][j])
1864 {
1865 {
1866 (*s).dp_ref_list[i][j] = &(*h).dpb[k];
1867 break;
1868 }
1869 }
1870 }
1871 }
1872 }
1873 }
1874 }
1875 }
1876 {
1877 nanos_err_t err;
1878 err = nanos_set_lock(&nanos_critical_lock_dpb);
1879 if (err != NANOS_OK)
1880 {
1881 nanos_handle_error(err);
1882 }
1883 get_dpb_entry(h, s);
1884 err = nanos_unset_lock(&nanos_critical_lock_dpb);
1885 if (err != NANOS_OK)
1886 {
1887 nanos_handle_error(err);
1888 }
1889 }
1890 if (!(*h).no_mbd)
1891 {
1892 {
1893 decode_mb_in_slice(h, d, sbe);
1894 }
1895 }
1896 for (int i = 0; i < (*s).release_cnt; i++)
1897 {
1898 {
1899 for (int j = 0; j < (*h).max_dpb_cnt; j++)
1900 {
1901 {
1902 if ((*h).dpb[j].cpn == (*s).release_ref_cpn[i])
1903 {
1904 {
1905 {
1906 nanos_err_t err;
1907 err = nanos_set_lock(&nanos_critical_lock_dpb);
1908 if (err != NANOS_OK)
1909 {
1910 nanos_handle_error(err);
1911 }
1912 release_dpb_entry(h, &(*h).dpb[j], 2);
1913 err = nanos_unset_lock(&nanos_critical_lock_dpb);
1914 if (err != NANOS_OK)
1915 {
1916 nanos_handle_error(err);
1917 }
1918 }
1919 break;
1920 }
1921 }
1922 }
1923 }
1924 }
1925 }
1926 (*s).release_cnt = 0;
1927 }
1928 static void decode_3dwave_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *mprev, SuperMBTask *m)
1929 {
1930 H264Slice *s = &(*sbe).slice;
1931 H264Mb *mbs = (*sbe).mbs;
1932 decode_super_mb_block(d, s, smbc, mbs, (*m).smb_x, (*m).smb_y);
1933 }
1934 static void init_ref_list_and_get_dpb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe, int *init)
1935 {
1936 H264Slice *s = &(*sbe).slice;
1937 for (int i = 0; i < 2; i++)
1938 {
1939 {
1940 for (int j = 0; j < (*s).ref_count[i]; j++)
1941 {
1942 {
1943 int k;
1944 if ((*s).ref_list_cpn[i][j] == -1)
1945 {
1946 continue;
1947 }
1948 for (k = 0; k < (*h).max_dpb_cnt; k++)
1949 {
1950 {
1951 if ((*h).dpb[k].reference >= 2 && (*h).dpb[k].cpn == (*s).ref_list_cpn[i][j])
1952 {
1953 {
1954 (*s).dp_ref_list[i][j] = &(*h).dpb[k];
1955 break;
1956 }
1957 }
1958 }
1959 }
1960 }
1961 }
1962 }
1963 }
1964 {
1965 nanos_err_t err;
1966 err = nanos_set_lock(&nanos_critical_lock_dpb);
1967 if (err != NANOS_OK)
1968 {
1969 nanos_handle_error(err);
1970 }
1971 get_dpb_entry(h, s);
1972 err = nanos_unset_lock(&nanos_critical_lock_dpb);
1973 if (err != NANOS_OK)
1974 {
1975 nanos_handle_error(err);
1976 }
1977 }
1978 }
1979 struct nanos_args_2_t
1980 {
1981 MBRecContext *d;
1982 SliceBufferEntry *sbe;
1983 SuperMBContext *smbc;
1984 SuperMBTask *ml;
1985 SuperMBTask *mur;
1986 SuperMBTask *mprev;
1987 SuperMBTask *m;
1988 };
1989 static void smp_ol_decode_3dwave_super_mb_task_5(struct nanos_args_2_t *const args);
1990 struct nanos_args_3_t
1991 {
1992 MBRecContext *d;
1993 SliceBufferEntry *sbe;
1994 SuperMBContext *smbc;
1995 SuperMBTask *sm;
1996 int line;
1997 };
1998 static void smp_ol_draw_edges_task_7(struct nanos_args_3_t *const args);
1999 struct nanos_args_4_t
2000 {
2001 MBRecContext *d;
2002 SliceBufferEntry *sbe;
2003 SuperMBContext *smbc;
2004 SuperMBTask *ml;
2005 SuperMBTask *mur;
2006 SuperMBTask *m;
2007 };
2008 static void smp_ol_decode_super_mb_task_9(struct nanos_args_4_t *const args);
2009 struct nanos_args_5_t
2010 {
2011 MBRecContext *d;
2012 SliceBufferEntry *sbe;
2013 SuperMBContext *smbc;
2014 SuperMBTask *sm;
2015 int line;
2016 };
2017 static void smp_ol_draw_edges_task_11(struct nanos_args_5_t *const args);
2018 static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc)
2019 {
2020 int j;
2021 int i;
2022 SuperMBTask *sml;
2023 SuperMBTask *smur;
2024 SuperMBTask *smprev;
2025 int smb_3d_height = (*smbc).nsmb_3dheight;
2026 int smb_height = (*smbc).nsmb_height;
2027 int smb_width = (*smbc).nsmb_width;
2028 int smb_diff_prev = smb_height - smb_3d_height;
2029 SuperMBTask *sm = (void *)0;
2030 SuperMBTask *smbs = (*smbc).smbs[(*smbc).index++];
2031 (*smbc).index %= 2;
2032 SuperMBTask *smbs_prev = (*smbc).smbs[(*smbc).index];
2033 for (j = 0; j < smb_3d_height; j++)
2034 {
2035 {
2036 nanos_err_t mcc_err_in_final_3;
2037 _Bool mcc_is_in_final_3;
2038 for (i = 0; i < smb_width; i++)
2039 {
2040 {
2041 nanos_err_t mcc_err_in_final_2;
2042 _Bool mcc_is_in_final_2;
2043 sm = smbs + j * smb_width + i;
2044 sml = sm - (i > 0 ? 1 : 0);
2045 smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0);
2046 smprev = smbs_prev + (j + smb_diff_prev + 1) * smb_width - 1;
2047 mcc_err_in_final_2 = nanos_in_final(&mcc_is_in_final_2);
2048 {
2049 MBRecContext *mcc_arg_11 = d;
2050 SliceBufferEntry *mcc_arg_12 = sbe;
2051 SuperMBContext *mcc_arg_13 = smbc;
2052 SuperMBTask *mcc_arg_14 = sml;
2053 SuperMBTask *mcc_arg_15 = smur;
2054 SuperMBTask *mcc_arg_16 = smprev;
2055 SuperMBTask *mcc_arg_17 = sm;
2056 if (mcc_is_in_final_2)
2057 {
2058 decode_3dwave_super_mb_task(d, sbe, smbc, sml, smur, smprev, sm);
2059 }
2060 else
2061 {
2062 {
2063 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2064 struct nanos_args_2_t *ol_args;
2065 nanos_err_t err;
2066 struct nanos_args_2_t imm_args;
2067 static nanos_smp_args_t smp_ol_decode_3dwave_super_mb_task_5_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_2_t *))&smp_ol_decode_3dwave_super_mb_task_5 };
2068 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_2_t), 0, 1, 0, "decode_3dwave_super_mb_task" }, { { &nanos_smp_factory, &smp_ol_decode_3dwave_super_mb_task_5_args } } };
2069 nanos_wd_dyn_props.tie_to = 0;
2070 nanos_wd_dyn_props.priority = 0;
2071 nanos_wd_dyn_props.flags.is_final = 0;
2072 ol_args = (struct nanos_args_2_t *)0;
2073 void *nanos_wd_ = (void *)0;
2074 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_2_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
2075 if (err != NANOS_OK)
2076 {
2077 nanos_handle_error(err);
2078 }
2079 /* Check pendant writes on subexpressions */
2080 /* End check pendant writes on subexpressions */
2081 if (nanos_wd_ != (void *)0)
2082 {
2083 {
2084 (*ol_args).d = mcc_arg_11;
2085 (*ol_args).sbe = mcc_arg_12;
2086 (*ol_args).smbc = mcc_arg_13;
2087 (*ol_args).ml = mcc_arg_14;
2088 (*ol_args).mur = mcc_arg_15;
2089 (*ol_args).mprev = mcc_arg_16;
2090 (*ol_args).m = mcc_arg_17;
2091 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2092 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2093 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2094 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2095 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2096 nanos_region_dimension_t dimensions_5[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2097 nanos_data_access_t dependences[6] = { { (void *)mcc_arg_11, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_12, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_14, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_15, { 1, 0, 0, 0, 0 }, 1, dimensions_3, 0 }, { (void *)mcc_arg_16, { 1, 0, 0, 0, 0 }, 1, dimensions_4, 0 }, { (void *)mcc_arg_17, { 1, 1, 0, 0, 0 }, 1, dimensions_5, 0 } };
2098 ;
2099 err = nanos_submit(nanos_wd_, 6, dependences, (void *)0);
2100 if (err != NANOS_OK)
2101 {
2102 nanos_handle_error(err);
2103 }
2104 }
2105 }
2106 else
2107 {
2108 {
2109 imm_args.d = mcc_arg_11;
2110 imm_args.sbe = mcc_arg_12;
2111 imm_args.smbc = mcc_arg_13;
2112 imm_args.ml = mcc_arg_14;
2113 imm_args.mur = mcc_arg_15;
2114 imm_args.mprev = mcc_arg_16;
2115 imm_args.m = mcc_arg_17;
2116 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2117 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2118 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2119 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2120 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2121 nanos_region_dimension_t dimensions_5[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2122 nanos_data_access_t dependences[6] = { { (void *)mcc_arg_11, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_12, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_14, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_15, { 1, 0, 0, 0, 0 }, 1, dimensions_3, 0 }, { (void *)mcc_arg_16, { 1, 0, 0, 0, 0 }, 1, dimensions_4, 0 }, { (void *)mcc_arg_17, { 1, 1, 0, 0, 0 }, 1, dimensions_5, 0 } };
2123 ;
2124 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_2_t), &imm_args, 6, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
2125 if (err != NANOS_OK)
2126 {
2127 nanos_handle_error(err);
2128 }
2129 }
2130 }
2131 }
2132 }
2133 }
2134 }
2135 }
2136 mcc_err_in_final_3 = nanos_in_final(&mcc_is_in_final_3);
4973 { 2137 {
4974 if (i < d->mb_height && j >= 0 && j < d->mb_width) 2138 MBRecContext *mcc_arg_18 = d;
2139 SliceBufferEntry *mcc_arg_19 = sbe;
2140 SuperMBContext *mcc_arg_20 = smbc;
2141 SuperMBTask *mcc_arg_21 = sm;
2142 int mcc_arg_22 = j;
2143 if (mcc_is_in_final_3)
4975 { 2144 {
4976 h264_decode_mb_internal(d, &mrs, s, &mbs[i * d->mb_width + j]); 2145 draw_edges_task(d, sbe, smbc, sm, j);
2146 }
2147 else
2148 {
2149 {
2150 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2151 struct nanos_args_3_t *ol_args;
2152 nanos_err_t err;
2153 struct nanos_args_3_t imm_args;
2154 static nanos_smp_args_t smp_ol_draw_edges_task_7_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_3_t *))&smp_ol_draw_edges_task_7 };
2155 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_3_t), 0, 1, 0, "draw_edges_task" }, { { &nanos_smp_factory, &smp_ol_draw_edges_task_7_args } } };
2156 nanos_wd_dyn_props.tie_to = 0;
2157 nanos_wd_dyn_props.priority = 0;
2158 nanos_wd_dyn_props.flags.is_final = 0;
2159 ol_args = (struct nanos_args_3_t *)0;
2160 void *nanos_wd_ = (void *)0;
2161 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_3_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
2162 if (err != NANOS_OK)
2163 {
2164 nanos_handle_error(err);
2165 }
2166 /* Check pendant writes on subexpressions */
2167 /* End check pendant writes on subexpressions */
2168 if (nanos_wd_ != (void *)0)
2169 {
2170 {
2171 (*ol_args).d = mcc_arg_18;
2172 (*ol_args).sbe = mcc_arg_19;
2173 (*ol_args).smbc = mcc_arg_20;
2174 (*ol_args).sm = mcc_arg_21;
2175 (*ol_args).line = mcc_arg_22;
2176 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2177 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2178 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2179 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_18, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_19, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_21, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
2180 ;
2181 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
2182 if (err != NANOS_OK)
2183 {
2184 nanos_handle_error(err);
2185 }
2186 }
2187 }
2188 else
2189 {
2190 {
2191 imm_args.d = mcc_arg_18;
2192 imm_args.sbe = mcc_arg_19;
2193 imm_args.smbc = mcc_arg_20;
2194 imm_args.sm = mcc_arg_21;
2195 imm_args.line = mcc_arg_22;
2196 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2197 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2198 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2199 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_18, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_19, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_21, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
2200 ;
2201 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_3_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
2202 if (err != NANOS_OK)
2203 {
2204 nanos_handle_error(err);
2205 }
2206 }
2207 }
2208 }
4977 } 2209 }
4978 } 2210 }
4979 } 2211 }
4980 } 2212 }
4981 static void decode_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *m) 2213 for (; j < smb_height; j++)
4982 { 2214 {
4983 H264Slice *s = &sbe->slice; 2215 {
4984 H264Mb *mbs = sbe->mbs; 2216 nanos_err_t mcc_err_in_final_5;
4985 decode_super_mb_block(d, s, smbc, mbs, m->smb_x, m->smb_y); 2217 _Bool mcc_is_in_final_5;
4986 } 2218 for (i = 0; i < smb_width; i++)
4987 static void draw_edges_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *sm, int line) 2219 {
4988 { 2220 {
4989 H264Slice *s = &sbe->slice; 2221 nanos_err_t mcc_err_in_final_4;
4990 for (int i = line * smbc->smb_height; 2222 _Bool mcc_is_in_final_4;
4991 i < (line + 1) * smbc->smb_height && i < d->mb_height; 2223 sm = smbs + j * smb_width + i;
4992 i++) 2224 sml = sm - (i > 0 ? 1 : 0);
4993 draw_edges(d, s, i); 2225 smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0);
4994 } 2226 mcc_err_in_final_4 = nanos_in_final(&mcc_is_in_final_4);
4995 typedef struct _nx_data_env_0_t_tag 2227 {
4996 { 2228 MBRecContext *mcc_arg_23 = d;
4997 struct MBRecContext *__tmp_0_0; 2229 SliceBufferEntry *mcc_arg_24 = sbe;
4998 SliceBufferEntry *__tmp_1_0; 2230 SuperMBContext *mcc_arg_25 = smbc;
4999 struct SuperMBContext *__tmp_2_0; 2231 SuperMBTask *mcc_arg_26 = sml;
5000 struct SuperMBTask *__tmp_3_0; 2232 SuperMBTask *mcc_arg_27 = smur;
5001 struct SuperMBTask *__tmp_4_0; 2233 SuperMBTask *mcc_arg_28 = sm;
5002 struct SuperMBTask *__tmp_5_0; 2234 if (mcc_is_in_final_4)
5003 } _nx_data_env_0_t; 2235 {
5004 static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe); 2236 decode_super_mb_task(d, sbe, smbc, sml, smur, sm);
5005 static void _smp__ol_decode_mb_in_slice_0(_nx_data_env_0_t *const __restrict__ _args) 2237 }
5006 { 2238 else
5007 struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; 2239 {
5008 SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; 2240 {
5009 struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; 2241 nanos_wd_dyn_props_t nanos_wd_dyn_props;
5010 struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; 2242 struct nanos_args_4_t *ol_args;
5011 struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0; 2243 nanos_err_t err;
5012 struct SuperMBTask *___tmp_5_0 = _args->__tmp_5_0; 2244 struct nanos_args_4_t imm_args;
5013 /* Translation is done by the runtime */ 2245 static nanos_smp_args_t smp_ol_decode_super_mb_task_9_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_4_t *))&smp_ol_decode_super_mb_task_9 };
5014 { 2246 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_4_t), 0, 1, 0, "decode_super_mb_task" }, { { &nanos_smp_factory, &smp_ol_decode_super_mb_task_9_args } } };
5015 decode_super_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0)); 2247 nanos_wd_dyn_props.tie_to = 0;
5016 } 2248 nanos_wd_dyn_props.priority = 0;
5017 } 2249 nanos_wd_dyn_props.flags.is_final = 0;
5018 typedef struct _nx_data_env_1_t_tag 2250 ol_args = (struct nanos_args_4_t *)0;
5019 { 2251 void *nanos_wd_ = (void *)0;
5020 struct MBRecContext *__tmp_0_0; 2252 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_4_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
5021 SliceBufferEntry *__tmp_1_0; 2253 if (err != NANOS_OK)
5022 struct SuperMBContext *__tmp_2_0; 2254 {
5023 struct SuperMBTask *__tmp_3_0; 2255 nanos_handle_error(err);
5024 int __tmp_4_0; 2256 }
5025 } _nx_data_env_1_t; 2257 /* Check pendant writes on subexpressions */
5026 static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe); 2258 /* End check pendant writes on subexpressions */
5027 static void _smp__ol_decode_mb_in_slice_1(_nx_data_env_1_t *const __restrict__ _args) 2259 if (nanos_wd_ != (void *)0)
5028 { 2260 {
5029 struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; 2261 {
5030 SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; 2262 (*ol_args).d = mcc_arg_23;
5031 struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; 2263 (*ol_args).sbe = mcc_arg_24;
5032 struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; 2264 (*ol_args).smbc = mcc_arg_25;
5033 int ___tmp_4_0 = _args->__tmp_4_0; 2265 (*ol_args).ml = mcc_arg_26;
5034 /* Translation is done by the runtime */ 2266 (*ol_args).mur = mcc_arg_27;
5035 { 2267 (*ol_args).m = mcc_arg_28;
5036 draw_edges_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0)); 2268 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
5037 } 2269 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5038 } 2270 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5039 static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe) 2271 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5040 { 2272 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5041 int i, j; 2273 nanos_data_access_t dependences[5] = { { (void *)mcc_arg_23, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_24, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_26, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_27, { 1, 0, 0, 0, 0 }, 1, dimensions_3, 0 }, { (void *)mcc_arg_28, { 1, 1, 0, 0, 0 }, 1, dimensions_4, 0 } };
5042 SuperMBContext *smbc = acquire_smbc(h); 2274 ;
5043 int smb_height = smbc->nsmb_height, smb_width = smbc->nsmb_width; 2275 err = nanos_submit(nanos_wd_, 5, dependences, (void *)0);
5044 SuperMBTask *smbs = smbc->smbs[0]; 2276 if (err != NANOS_OK)
5045 SuperMBTask *sm = ((void *) 0), *sml, *smur; 2277 {
5046 for (j = 0; 2278 nanos_handle_error(err);
5047 j < smb_height; 2279 }
5048 j++) 2280 }
5049 { 2281 }
5050 for (i = 0; 2282 else
5051 i < smb_width; 2283 {
5052 i++) 2284 {
2285 imm_args.d = mcc_arg_23;
2286 imm_args.sbe = mcc_arg_24;
2287 imm_args.smbc = mcc_arg_25;
2288 imm_args.ml = mcc_arg_26;
2289 imm_args.mur = mcc_arg_27;
2290 imm_args.m = mcc_arg_28;
2291 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2292 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2293 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2294 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2295 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2296 nanos_data_access_t dependences[5] = { { (void *)mcc_arg_23, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_24, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_26, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_27, { 1, 0, 0, 0, 0 }, 1, dimensions_3, 0 }, { (void *)mcc_arg_28, { 1, 1, 0, 0, 0 }, 1, dimensions_4, 0 } };
2297 ;
2298 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_4_t), &imm_args, 5, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
2299 if (err != NANOS_OK)
2300 {
2301 nanos_handle_error(err);
2302 }
2303 }
2304 }
2305 }
2306 }
2307 }
2308 }
2309 }
2310 mcc_err_in_final_5 = nanos_in_final(&mcc_is_in_final_5);
5053 { 2311 {
5054 sm = smbs + j * smb_width + i; 2312 MBRecContext *mcc_arg_29 = d;
5055 sml = sm - ((i > 0) ? 1 : 0); 2313 SliceBufferEntry *mcc_arg_30 = sbe;
5056 smur = sm + (((i < smb_width - 1) && (j > 0)) ? - smb_width + 1 : 0); 2314 SuperMBContext *mcc_arg_31 = smbc;
2315 SuperMBTask *mcc_arg_32 = sm;
2316 int mcc_arg_33 = j;
2317 if (mcc_is_in_final_5)
5057 { 2318 {
5058 struct MBRecContext *__tmp_0 = d; 2319 draw_edges_task(d, sbe, smbc, sm, j);
5059 SliceBufferEntry *__tmp_1 = sbe; 2320 }
5060 struct SuperMBContext *__tmp_2 = smbc; 2321 else
5061 struct SuperMBTask *__tmp_3 = sml; 2322 {
5062 struct SuperMBTask *__tmp_4 = smur; 2323 {
5063 struct SuperMBTask *__tmp_5 = sm; 2324 nanos_wd_dyn_props_t nanos_wd_dyn_props;
5064 { 2325 struct nanos_args_5_t *ol_args;
5065 /* SMP device descriptor */ 2326 nanos_err_t err;
5066 static nanos_smp_args_t _ol_decode_mb_in_slice_0_smp_args = {(void (*)(void *)) _smp__ol_decode_mb_in_slice_0}; 2327 struct nanos_args_5_t imm_args;
5067 _nx_data_env_0_t *ol_args = (_nx_data_env_0_t *) 0; 2328 static nanos_smp_args_t smp_ol_draw_edges_task_11_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_5_t *))&smp_ol_draw_edges_task_11 };
5068 nanos_wd_t wd = (nanos_wd_t) 0; 2329 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_5_t), 0, 1, 0, "draw_edges_task" }, { { &nanos_smp_factory, &smp_ol_draw_edges_task_11_args } } };
5069 struct nanos_const_wd_definition_local_t 2330 nanos_wd_dyn_props.tie_to = 0;
2331 nanos_wd_dyn_props.priority = 0;
2332 nanos_wd_dyn_props.flags.is_final = 0;
2333 ol_args = (struct nanos_args_5_t *)0;
2334 void *nanos_wd_ = (void *)0;
2335 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_5_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
2336 if (err != NANOS_OK)
2337 {
2338 nanos_handle_error(err);
2339 }
2340 /* Check pendant writes on subexpressions */
2341 /* End check pendant writes on subexpressions */
2342 if (nanos_wd_ != (void *)0)
2343 {
5070 { 2344 {
5071 nanos_const_wd_definition_t base; 2345 (*ol_args).d = mcc_arg_29;
5072 nanos_device_t devices[1]; 2346 (*ol_args).sbe = mcc_arg_30;
5073 }; 2347 (*ol_args).smbc = mcc_arg_31;
5074 static struct nanos_const_wd_definition_local_t _const_def = { 2348 (*ol_args).sm = mcc_arg_32;
5075 { 2349 (*ol_args).line = mcc_arg_33;
5076 { 2350 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
5077 0, 2351 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5078 1, 2352 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5079 0, 2353 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_29, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_30, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_32, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
5080 0, 2354 ;
5081 0, 2355 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
5082 0, 2356 if (err != NANOS_OK)
5083 0, 2357 {
5084 0 2358 nanos_handle_error(err);
5085 }, 2359 }
5086 __alignof__(_nx_data_env_0_t), 2360 }
5087 0, 2361 }
5088 1 2362 else
5089 }, 2363 {
5090 {{
5091 nanos_smp_factory,
5092 &_ol_decode_mb_in_slice_0_smp_args
5093 }}
5094 };
5095 nanos_wd_dyn_props_t dyn_props = {0};
5096 nanos_err_t err;
5097 dyn_props.priority = 0;
5098 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_0_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
5099 if (err != NANOS_OK)
5100 nanos_handle_error(err);
5101 if (wd != (nanos_wd_t) 0)
5102 { 2364 {
5103 ol_args->__tmp_0_0 = __tmp_0; 2365 imm_args.d = mcc_arg_29;
5104 ol_args->__tmp_1_0 = __tmp_1; 2366 imm_args.sbe = mcc_arg_30;
5105 ol_args->__tmp_2_0 = __tmp_2; 2367 imm_args.smbc = mcc_arg_31;
5106 ol_args->__tmp_3_0 = __tmp_3; 2368 imm_args.sm = mcc_arg_32;
5107 ol_args->__tmp_4_0 = __tmp_4; 2369 imm_args.line = mcc_arg_33;
5108 ol_args->__tmp_5_0 = __tmp_5; 2370 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
5109 nanos_dependence_t _dependences[5] = { 2371 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5110 { 2372 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5111 (void **) &ol_args->__tmp_0_0, 2373 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_29, { 1, 0, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_30, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_32, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
5112 ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), 2374 ;
5113 { 2375 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_5_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
5114 1, 2376 if (err != NANOS_OK)
5115 0, 2377 {
5116 1, 2378 nanos_handle_error(err);
5117 0 2379 }
5118 },
5119 sizeof(struct MBRecContext)
5120 },
5121 {
5122 (void **) &ol_args->__tmp_1_0,
5123 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
5124 {
5125 1,
5126 0,
5127 1,
5128 0
5129 },
5130 sizeof(SliceBufferEntry)
5131 },
5132 {
5133 (void **) &ol_args->__tmp_3_0,
5134 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
5135 {
5136 1,
5137 0,
5138 1,
5139 0
5140 },
5141 sizeof(struct SuperMBTask)
5142 },
5143 {
5144 (void **) &ol_args->__tmp_4_0,
5145 ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0),
5146 {
5147 1,
5148 0,
5149 1,
5150 0
5151 },
5152 sizeof(struct SuperMBTask)
5153 },
5154 {
5155 (void **) &ol_args->__tmp_5_0,
5156 ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0),
5157 {
5158 1,
5159 1,
5160 1,
5161 0
5162 },
5163 sizeof(struct SuperMBTask)
5164 }
5165 };
5166 err = nanos_submit(wd, 5, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
5167 if (err != NANOS_OK)
5168 nanos_handle_error(err);
5169 } 2380 }
5170 else 2381 }
5171 { 2382 }
5172 _nx_data_env_0_t imm_args;
5173 imm_args.__tmp_0_0 = __tmp_0;
5174 imm_args.__tmp_1_0 = __tmp_1;
5175 imm_args.__tmp_2_0 = __tmp_2;
5176 imm_args.__tmp_3_0 = __tmp_3;
5177 imm_args.__tmp_4_0 = __tmp_4;
5178 imm_args.__tmp_5_0 = __tmp_5;
5179 nanos_dependence_t _dependences[5] = {
5180 {
5181 (void **) &imm_args.__tmp_0_0,
5182 ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0),
5183 {
5184 1,
5185 0,
5186 1,
5187 0
5188 },
5189 sizeof(struct MBRecContext)
5190 },
5191 {
5192 (void **) &imm_args.__tmp_1_0,
5193 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
5194 {
5195 1,
5196 0,
5197 1,
5198 0
5199 },
5200 sizeof(SliceBufferEntry)
5201 },
5202 {
5203 (void **) &imm_args.__tmp_3_0,
5204 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
5205 {
5206 1,
5207 0,
5208 1,
5209 0
5210 },
5211 sizeof(struct SuperMBTask)
5212 },
5213 {
5214 (void **) &imm_args.__tmp_4_0,
5215 ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0),
5216 {
5217 1,
5218 0,
5219 1,
5220 0
5221 },
5222 sizeof(struct SuperMBTask)
5223 },
5224 {
5225 (void **) &imm_args.__tmp_5_0,
5226 ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0),
5227 {
5228 1,
5229 1,
5230 1,
5231 0
5232 },
5233 sizeof(struct SuperMBTask)
5234 }
5235 };
5236 dyn_props.priority = 0;
5237 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_0_t), &imm_args, 5, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
5238 if (err != NANOS_OK)
5239 nanos_handle_error(err);
5240 }
5241 }
5242 ;
5243 } 2383 }
5244 } 2384 }
5245 { 2385 }
5246 struct MBRecContext *__tmp_0 = d; 2386 }
5247 SliceBufferEntry *__tmp_1 = sbe; 2387 return sm;
5248 struct SuperMBContext *__tmp_2 = smbc; 2388 }
5249 struct SuperMBTask *__tmp_3 = sm; 2389 static void release_ref_list_task(H264Context *h, SuperMBContext *smbc, MBRecContext *d, SliceBufferEntry *sbe, SuperMBTask *lastsmb, int *release)
5250 int __tmp_4 = j; 2390 {
2391 H264Slice *s = &(*sbe).slice;
2392 for (int i = 0; i < (*s).release_cnt; i++)
2393 {
2394 {
2395 for (int j = 0; j < (*h).max_dpb_cnt; j++)
2396 {
5251 { 2397 {
5252 /* SMP device descriptor */ 2398 if ((*h).dpb[j].cpn == (*s).release_ref_cpn[i])
5253 static nanos_smp_args_t _ol_decode_mb_in_slice_1_smp_args = {(void (*)(void *)) _smp__ol_decode_mb_in_slice_1};
5254 _nx_data_env_1_t *ol_args = (_nx_data_env_1_t *) 0;
5255 nanos_wd_t wd = (nanos_wd_t) 0;
5256 struct nanos_const_wd_definition_local_t
5257 { 2399 {
5258 nanos_const_wd_definition_t base; 2400 {
5259 nanos_device_t devices[1];
5260 };
5261 static struct nanos_const_wd_definition_local_t _const_def = {
5262 { 2401 {
5263 { 2402 nanos_err_t err;
5264 0, 2403 err = nanos_set_lock(&nanos_critical_lock_dpb);
5265 1, 2404 if (err != NANOS_OK)
5266 0, 2405 {
5267 0, 2406 nanos_handle_error(err);
5268 0, 2407 }
5269 0, 2408 release_dpb_entry(h, &(*h).dpb[j], 2);
5270 0, 2409 err = nanos_unset_lock(&nanos_critical_lock_dpb);
5271 0 2410 if (err != NANOS_OK)
5272 }, 2411 {
5273 __alignof__(_nx_data_env_1_t), 2412 nanos_handle_error(err);
5274 0, 2413 }
5275 1 2414 }
5276 }, 2415 break;
5277 {{ 2416 }
5278 nanos_smp_factory,
5279 &_ol_decode_mb_in_slice_1_smp_args
5280 }}
5281 };
5282 nanos_wd_dyn_props_t dyn_props = {0};
5283 nanos_err_t err;
5284 dyn_props.priority = 0;
5285 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_1_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
5286 if (err != NANOS_OK)
5287 nanos_handle_error(err);
5288 if (wd != (nanos_wd_t) 0)
5289 {
5290 ol_args->__tmp_0_0 = __tmp_0;
5291 ol_args->__tmp_1_0 = __tmp_1;
5292 ol_args->__tmp_2_0 = __tmp_2;
5293 ol_args->__tmp_3_0 = __tmp_3;
5294 ol_args->__tmp_4_0 = __tmp_4;
5295 nanos_dependence_t _dependences[3] = {
5296 {
5297 (void **) &ol_args->__tmp_0_0,
5298 ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0),
5299 {
5300 1,
5301 0,
5302 1,
5303 0
5304 },
5305 sizeof(struct MBRecContext)
5306 },
5307 {
5308 (void **) &ol_args->__tmp_1_0,
5309 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
5310 {
5311 1,
5312 0,
5313 1,
5314 0
5315 },
5316 sizeof(SliceBufferEntry)
5317 },
5318 {
5319 (void **) &ol_args->__tmp_3_0,
5320 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
5321 {
5322 1,
5323 1,
5324 1,
5325 0
5326 },
5327 sizeof(struct SuperMBTask)
5328 }
5329 };
5330 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
5331 if (err != NANOS_OK)
5332 nanos_handle_error(err);
5333 }
5334 else
5335 {
5336 _nx_data_env_1_t imm_args;
5337 imm_args.__tmp_0_0 = __tmp_0;
5338 imm_args.__tmp_1_0 = __tmp_1;
5339 imm_args.__tmp_2_0 = __tmp_2;
5340 imm_args.__tmp_3_0 = __tmp_3;
5341 imm_args.__tmp_4_0 = __tmp_4;
5342 nanos_dependence_t _dependences[3] = {
5343 {
5344 (void **) &imm_args.__tmp_0_0,
5345 ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0),
5346 {
5347 1,
5348 0,
5349 1,
5350 0
5351 },
5352 sizeof(struct MBRecContext)
5353 },
5354 {
5355 (void **) &imm_args.__tmp_1_0,
5356 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
5357 {
5358 1,
5359 0,
5360 1,
5361 0
5362 },
5363 sizeof(SliceBufferEntry)
5364 },
5365 {
5366 (void **) &imm_args.__tmp_3_0,
5367 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
5368 {
5369 1,
5370 1,
5371 1,
5372 0
5373 },
5374 sizeof(struct SuperMBTask)
5375 }
5376 };
5377 dyn_props.priority = 0;
5378 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_1_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
5379 if (err != NANOS_OK)
5380 nanos_handle_error(err);
5381 } 2417 }
5382 } 2418 }
5383 ; 2419 }
5384 } 2420 }
5385 } 2421 }
5386 { 2422 (*s).release_cnt = 0;
5387 struct _dependence_holder 2423 release_smbc(h, smbc);
2424 }
2425 struct OutputContext;
2426 typedef struct OutputContext OutputContext;
2427 DecodedPicture *output_frame(H264Context *h, OutputContext *oc, DecodedPicture *pic, int fd, int frame_width, int frame_height);
2428 static void output_task(H264Context *h, OutputContext *oc, SliceBufferEntry *sbe)
2429 {
2430 DecodedPicture *out = output_frame(h, oc, (*sbe).slice.curr_pic, (*h).ofile, (*h).frame_width, (*h).frame_height);
2431 if (out)
2432 {
2433 {
5388 { 2434 {
5389 struct SuperMBTask *dep_0; 2435 nanos_err_t err;
5390 } _dep_holder = {&(*sm)}; 2436 err = nanos_set_lock(&nanos_critical_lock_dpb);
5391 nanos_dependence_t _wait_dependences[1] = {{ 2437 if (err != NANOS_OK)
5392 (void **) &_dep_holder.dep_0,
5393 ((char *) ((sm)) - (char *) _dep_holder.dep_0),
5394 { 2438 {
5395 1, 2439 nanos_handle_error(err);
5396 0, 2440 }
5397 0, 2441 release_dpb_entry(h, out, 1);
5398 0 2442 err = nanos_unset_lock(&nanos_critical_lock_dpb);
5399 }, 2443 if (err != NANOS_OK)
5400 sizeof (*sm)
5401 }};
5402 nanos_wait_on(1, _wait_dependences);
5403 }
5404 release_smbc(h, smbc);
5405 }
5406 __attribute__((weak)) nanos_lock_t _nx_u_dpb_critical_lock = {NANOS_LOCK_FREE};
5407 static void decode_slice_mb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe)
5408 {
5409 H264Slice *s = &sbe->slice;
5410 for (int i = 0;
5411 i < 2;
5412 i++)
5413 {
5414 for (int j = 0;
5415 j < s->ref_count[i];
5416 j++)
5417 {
5418 if (s->ref_list_cpn[i][j] == - 1)
5419 continue;
5420 int k;
5421 for (k = 0;
5422 k < h->max_dpb_cnt;
5423 k++)
5424 { 2444 {
5425 if (h->dpb[k].reference >= 2 && h->dpb[k].cpn == s->ref_list_cpn[i][j]) 2445 nanos_handle_error(err);
5426 {
5427 s->dp_ref_list[i][j] = &h->dpb[k];
5428 break;
5429 }
5430 } 2446 }
5431 } 2447 }
5432 } 2448 }
5433 { 2449 }
5434 nanos_set_lock(&_nx_u_dpb_critical_lock); 2450 }
5435 get_dpb_entry(h, s); 2451 void *av_mallocz(unsigned int size)__attribute__((__malloc__));
5436 nanos_unset_lock(&_nx_u_dpb_critical_lock); 2452 ParserContext *get_parse_context(int ifile);
5437 } 2453 NalContext *get_nal_context(int width, int height);
5438 if (!h->no_mbd) 2454 EntropyContext *get_entropy_context(H264Context *h);
5439 { 2455 MBRecContext *get_mbrec_context(H264Context *h);
5440 decode_mb_in_slice(h, d, sbe); 2456 OutputContext *get_output_context(H264Context *h);
5441 } 2457 void av_start_timer();
5442 for (int i = 0; 2458 struct ParserContext
5443 i < s->release_cnt; 2459 {
5444 i++) 2460 int ifile;
5445 { 2461 int ofile;
5446 for (int j = 0; 2462 int buffer_size;
5447 j < h->max_dpb_cnt; 2463 int eof_reached;
5448 j++) 2464 uint8_t *data;
5449 { 2465 int size;
5450 if (h->dpb[j].cpn == s->release_ref_cpn[i]) 2466 uint8_t *cur_ptr;
2467 int cur_len;
2468 int64_t frame_offset;
2469 int64_t cur_offset;
2470 int64_t next_frame_offset;
2471 int pict_type;
2472 int repeat_pict;
2473 int key_frame;
2474 int64_t pos;
2475 int64_t last_pos;
2476 int final_frame;
2477 uint8_t overread[5];
2478 int overread_cnt;
2479 int index;
2480 int last_index;
2481 int frame_start_found;
2482 uint32_t state;
2483 };
2484 struct nanos_args_6_t
2485 {
2486 H264Context *h;
2487 ParserContext *pc;
2488 NalContext *nc;
2489 SliceBufferEntry *sbe;
2490 };
2491 static void smp_ol_parse_task_13(struct nanos_args_6_t *const args);
2492 struct SPS;
2493 typedef struct SPS SPS;
2494 enum AVColorPrimaries
2495 {
2496 AVCOL_PRI_BT709 = 1,
2497 AVCOL_PRI_UNSPECIFIED = 2,
2498 AVCOL_PRI_BT470M = 4,
2499 AVCOL_PRI_BT470BG = 5,
2500 AVCOL_PRI_SMPTE170M = 6,
2501 AVCOL_PRI_SMPTE240M = 7,
2502 AVCOL_PRI_FILM = 8,
2503 AVCOL_PRI_NB = 9
2504 };
2505 enum AVColorTransferCharacteristic
2506 {
2507 AVCOL_TRC_BT709 = 1,
2508 AVCOL_TRC_UNSPECIFIED = 2,
2509 AVCOL_TRC_GAMMA22 = 4,
2510 AVCOL_TRC_GAMMA28 = 5,
2511 AVCOL_TRC_NB = 6
2512 };
2513 enum AVColorSpace
2514 {
2515 AVCOL_SPC_RGB = 0,
2516 AVCOL_SPC_BT709 = 1,
2517 AVCOL_SPC_UNSPECIFIED = 2,
2518 AVCOL_SPC_FCC = 4,
2519 AVCOL_SPC_BT470BG = 5,
2520 AVCOL_SPC_SMPTE170M = 6,
2521 AVCOL_SPC_SMPTE240M = 7,
2522 AVCOL_SPC_NB = 8
2523 };
2524 struct SPS
2525 {
2526 int profile_idc;
2527 int level_idc;
2528 int chroma_format_idc;
2529 int transform_bypass;
2530 int log2_max_frame_num;
2531 int poc_type;
2532 int log2_max_poc_lsb;
2533 int delta_pic_order_always_zero_flag;
2534 int offset_for_non_ref_pic;
2535 int offset_for_top_to_bottom_field;
2536 int poc_cycle_length;
2537 int ref_frame_count;
2538 int gaps_in_frame_num_allowed_flag;
2539 int mb_width;
2540 int mb_height;
2541 int frame_mbs_only_flag;
2542 int mb_aff;
2543 int direct_8x8_inference_flag;
2544 int crop;
2545 unsigned int crop_left;
2546 unsigned int crop_right;
2547 unsigned int crop_top;
2548 unsigned int crop_bottom;
2549 int vui_parameters_present_flag;
2550 int num;
2551 int den;
2552 int video_signal_type_present_flag;
2553 int full_range;
2554 int colour_description_present_flag;
2555 enum AVColorPrimaries color_primaries;
2556 enum AVColorTransferCharacteristic color_trc;
2557 enum AVColorSpace colorspace;
2558 int timing_info_present_flag;
2559 uint32_t num_units_in_tick;
2560 uint32_t time_scale;
2561 int fixed_frame_rate_flag;
2562 short int offset_for_ref_frame[256];
2563 int bitstream_restriction_flag;
2564 int num_reorder_frames;
2565 int scaling_matrix_present;
2566 uint8_t scaling_matrix4[6][16];
2567 uint8_t scaling_matrix8[2][64];
2568 int nal_hrd_parameters_present_flag;
2569 int vcl_hrd_parameters_present_flag;
2570 int pic_struct_present_flag;
2571 int time_offset_length;
2572 int cpb_cnt;
2573 int initial_cpb_removal_delay_length;
2574 int cpb_removal_delay_length;
2575 int dpb_output_delay_length;
2576 int bit_depth_luma;
2577 int bit_depth_chroma;
2578 int residual_color_transform_flag;
2579 };
2580 struct PictureInfo
2581 {
2582 int ref_poc[2][16];
2583 int ref_count[2];
2584 int poc;
2585 int frame_num;
2586 int pic_id;
2587 int long_ref;
2588 int cpn;
2589 int slice_type_nos;
2590 int reference;
2591 };
2592 enum mcc_enum_anon_20
2593 {
2594 SEI_PIC_STRUCT_FRAME = 0,
2595 SEI_PIC_STRUCT_TOP_FIELD = 1,
2596 SEI_PIC_STRUCT_BOTTOM_FIELD = 2,
2597 SEI_PIC_STRUCT_TOP_BOTTOM = 3,
2598 SEI_PIC_STRUCT_BOTTOM_TOP = 4,
2599 SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5,
2600 SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6,
2601 SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
2602 SEI_PIC_STRUCT_FRAME_TRIPLING = 8
2603 };
2604 typedef enum mcc_enum_anon_20 SEI_PicStructType;
2605 struct NalContext
2606 {
2607 SPS *sps_buffers[32];
2608 PPS *pps_buffers[256];
2609 SPS sps;
2610 PictureInfo picture[17];
2611 PictureInfo *release_ref[66];
2612 PictureInfo *short_ref[32];
2613 PictureInfo *long_ref[32];
2614 int long_ref_count;
2615 int short_ref_count;
2616 uint32_t coded_pic_num;
2617 int poc_lsb;
2618 int poc_msb;
2619 uint32_t poc_offset;
2620 int delta_poc;
2621 int frame_num;
2622 int prev_poc_msb;
2623 int prev_poc_lsb;
2624 int frame_num_offset;
2625 int prev_frame_num_offset;
2626 int prev_frame_num;
2627 int max_pic_num;
2628 int redundant_pic_count;
2629 int outputed_poc;
2630 int ip_id;
2631 int b4_stride;
2632 int mb_stride;
2633 int mb_width;
2634 int mb_height;
2635 int width;
2636 int height;
2637 int has_b_frames;
2638 SEI_PicStructType sei_pic_struct;
2639 int sei_ct_type;
2640 int sei_dpb_output_delay;
2641 int sei_cpb_removal_delay;
2642 int sei_recovery_frame_cnt;
2643 int sei_buffering_period_present;
2644 int initial_cpb_removal_delay[32];
2645 };
2646 struct nanos_args_7_t
2647 {
2648 H264Context *h;
2649 EntropyContext *ec;
2650 SliceBufferEntry *sbe;
2651 };
2652 static void smp_ol_decode_slice_entropy_task_15(struct nanos_args_7_t *const args);
2653 struct nanos_args_8_t
2654 {
2655 H264Context *h;
2656 ParserContext *pc;
2657 NalContext *nc;
2658 SliceBufferEntry *sbe;
2659 };
2660 static void smp_ol_parse_task_17(struct nanos_args_8_t *const args);
2661 struct nanos_args_9_t
2662 {
2663 H264Context *h;
2664 EntropyContext *ec;
2665 SliceBufferEntry *sbe;
2666 };
2667 static void smp_ol_decode_slice_entropy_task_19(struct nanos_args_9_t *const args);
2668 struct nanos_args_10_t
2669 {
2670 H264Context *h;
2671 MBRecContext *d;
2672 SliceBufferEntry *sbe;
2673 int *init;
2674 };
2675 static void smp_ol_init_ref_list_and_get_dpb_task_21(struct nanos_args_10_t *const args);
2676 struct nanos_args_11_t
2677 {
2678 H264Context *h;
2679 SuperMBContext *smbc;
2680 MBRecContext *d;
2681 SliceBufferEntry *sbe;
2682 SuperMBTask *lastsmb;
2683 int *release;
2684 };
2685 static void smp_ol_release_ref_list_task_23(struct nanos_args_11_t *const args);
2686 struct nanos_args_12_t
2687 {
2688 H264Context *h;
2689 OutputContext *oc;
2690 SliceBufferEntry *sbe;
2691 };
2692 static void smp_ol_output_task_25(struct nanos_args_12_t *const args);
2693 struct OutputContext
2694 {
2695 int bit_buffer_size;
2696 uint8_t *bit_buffer;
2697 uint64_t video_size;
2698 int frame_number;
2699 DecodedPicture *delayed_pic[33];
2700 int dp_cnt;
2701 };
2702 struct nanos_args_13_t
2703 {
2704 H264Context *h;
2705 MBRecContext *d;
2706 SliceBufferEntry *sbe;
2707 int *init;
2708 };
2709 static void smp_ol_init_ref_list_and_get_dpb_task_27(struct nanos_args_13_t *const args);
2710 struct nanos_args_14_t
2711 {
2712 H264Context *h;
2713 SuperMBContext *smbc;
2714 MBRecContext *d;
2715 SliceBufferEntry *sbe;
2716 SuperMBTask *lastsmb;
2717 int *release;
2718 };
2719 static void smp_ol_release_ref_list_task_29(struct nanos_args_14_t *const args);
2720 struct nanos_args_15_t
2721 {
2722 H264Context *h;
2723 OutputContext *oc;
2724 SliceBufferEntry *sbe;
2725 };
2726 static void smp_ol_output_task_31(struct nanos_args_15_t *const args);
2727 struct nanos_args_16_t
2728 {
2729 H264Context *h;
2730 ParserContext *pc;
2731 NalContext *nc;
2732 SliceBufferEntry *sbe;
2733 };
2734 static void smp_ol_parse_task_33(struct nanos_args_16_t *const args);
2735 struct nanos_args_17_t
2736 {
2737 H264Context *h;
2738 EntropyContext *ec;
2739 SliceBufferEntry *sbe;
2740 };
2741 static void smp_ol_decode_slice_entropy_task_35(struct nanos_args_17_t *const args);
2742 struct nanos_args_18_t
2743 {
2744 H264Context *h;
2745 MBRecContext *d;
2746 SliceBufferEntry *sbe;
2747 };
2748 static void smp_ol_decode_slice_mb_task_37(struct nanos_args_18_t *const args);
2749 struct nanos_args_19_t
2750 {
2751 H264Context *h;
2752 OutputContext *oc;
2753 SliceBufferEntry *sbe;
2754 };
2755 static void smp_ol_output_task_39(struct nanos_args_19_t *const args);
2756 extern nanos_err_t nanos_wg_wait_completion(void *wg, _Bool avoid_flush);
2757 void free_parse_context(ParserContext *pc);
2758 void free_nal_context(NalContext *nc);
2759 void free_output_context(OutputContext *oc);
2760 void free_sb_entry(SliceBufferEntry *sb);
2761 void free_entropy_context(EntropyContext *ec);
2762 void av_free(void *ptr);
2763 void free_mbrec_context(MBRecContext *d);
2764 int h264_decode_ompss(H264Context *h)
2765 {
2766 SliceBufferEntry *sbe;
2767 ParserContext *pc;
2768 NalContext *nc;
2769 MBRecContext *rc[2];
2770 OutputContext *oc;
2771 int init;
2772 SuperMBContext *smbc;
2773 int release;
2774 DecodedPicture *out;
2775 const int bufs = (*h).pipe_bufs;
2776 EntropyContext *ec[bufs];
2777 int frames = 0;
2778 sbe = av_mallocz(sizeof(SliceBufferEntry) * bufs);
2779 pc = get_parse_context((*h).ifile);
2780 nc = get_nal_context((*h).width, (*h).height);
2781 for (int i = 0; i < bufs; i++)
2782 {
2783 {
2784 ec[i] = get_entropy_context(h);
2785 }
2786 }
2787 for (int i = 0; i < 2; i++)
2788 {
2789 {
2790 rc[i] = get_mbrec_context(h);
2791 }
2792 }
2793 oc = get_output_context(h);
2794 av_start_timer();
2795 int k = 0;
2796 if ((*h).static_3d && bufs < (*h).num_frames)
2797 {
2798 {
2799 int num_pre_ed = 0;
2800 for (num_pre_ed = 0; num_pre_ed < bufs - 1 && !(*pc).final_frame; num_pre_ed++)
2801 {
5451 { 2802 {
5452 { 2803 nanos_err_t mcc_err_in_final_6;
5453 nanos_set_lock(&_nx_u_dpb_critical_lock); 2804 _Bool mcc_is_in_final_6;
5454 release_dpb_entry(h, &h->dpb[j], 2); 2805 nanos_err_t mcc_err_in_final_7;
5455 nanos_unset_lock(&_nx_u_dpb_critical_lock); 2806 _Bool mcc_is_in_final_7;
5456 } 2807 mcc_err_in_final_6 = nanos_in_final(&mcc_is_in_final_6);
5457 break; 2808 {
2809 H264Context *mcc_arg_34 = h;
2810 ParserContext *mcc_arg_35 = pc;
2811 NalContext *mcc_arg_36 = nc;
2812 SliceBufferEntry *mcc_arg_37 = &sbe[k % bufs];
2813 if (mcc_is_in_final_6)
2814 {
2815 parse_task(h, pc, nc, &sbe[k % bufs]);
2816 }
2817 else
2818 {
2819 {
2820 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2821 struct nanos_args_6_t *ol_args;
2822 nanos_err_t err;
2823 struct nanos_args_6_t imm_args;
2824 static nanos_smp_args_t smp_ol_parse_task_13_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_6_t *))&smp_ol_parse_task_13 };
2825 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_6_t), 0, 1, 0, "parse_task" }, { { &nanos_smp_factory, &smp_ol_parse_task_13_args } } };
2826 nanos_wd_dyn_props.tie_to = 0;
2827 nanos_wd_dyn_props.priority = 0;
2828 nanos_wd_dyn_props.flags.is_final = 0;
2829 ol_args = (struct nanos_args_6_t *)0;
2830 void *nanos_wd_ = (void *)0;
2831 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_6_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
2832 if (err != NANOS_OK)
2833 {
2834 nanos_handle_error(err);
2835 }
2836 /* Check pendant writes on subexpressions */
2837 /* End check pendant writes on subexpressions */
2838 if (nanos_wd_ != (void *)0)
2839 {
2840 {
2841 (*ol_args).h = mcc_arg_34;
2842 (*ol_args).pc = mcc_arg_35;
2843 (*ol_args).nc = mcc_arg_36;
2844 (*ol_args).sbe = mcc_arg_37;
2845 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
2846 nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } };
2847 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2848 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_35, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_36, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_37, { 0, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
2849 ;
2850 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
2851 if (err != NANOS_OK)
2852 {
2853 nanos_handle_error(err);
2854 }
2855 }
2856 }
2857 else
2858 {
2859 {
2860 imm_args.h = mcc_arg_34;
2861 imm_args.pc = mcc_arg_35;
2862 imm_args.nc = mcc_arg_36;
2863 imm_args.sbe = mcc_arg_37;
2864 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
2865 nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } };
2866 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2867 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_35, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_36, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_37, { 0, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
2868 ;
2869 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_6_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
2870 if (err != NANOS_OK)
2871 {
2872 nanos_handle_error(err);
2873 }
2874 }
2875 }
2876 }
2877 }
2878 }
2879 mcc_err_in_final_7 = nanos_in_final(&mcc_is_in_final_7);
2880 {
2881 H264Context *mcc_arg_38 = h;
2882 EntropyContext *mcc_arg_39 = ec[k % bufs];
2883 SliceBufferEntry *mcc_arg_40 = &sbe[k % bufs];
2884 if (mcc_is_in_final_7)
2885 {
2886 decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]);
2887 }
2888 else
2889 {
2890 {
2891 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2892 struct nanos_args_7_t *ol_args;
2893 nanos_err_t err;
2894 struct nanos_args_7_t imm_args;
2895 static nanos_smp_args_t smp_ol_decode_slice_entropy_task_15_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_7_t *))&smp_ol_decode_slice_entropy_task_15 };
2896 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_7_t), 0, 1, 0, "decode_slice_entropy_task" }, { { &nanos_smp_factory, &smp_ol_decode_slice_entropy_task_15_args } } };
2897 nanos_wd_dyn_props.tie_to = 0;
2898 nanos_wd_dyn_props.priority = 0;
2899 nanos_wd_dyn_props.flags.is_final = 0;
2900 ol_args = (struct nanos_args_7_t *)0;
2901 void *nanos_wd_ = (void *)0;
2902 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_7_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
2903 if (err != NANOS_OK)
2904 {
2905 nanos_handle_error(err);
2906 }
2907 /* Check pendant writes on subexpressions */
2908 /* End check pendant writes on subexpressions */
2909 if (nanos_wd_ != (void *)0)
2910 {
2911 {
2912 (*ol_args).h = mcc_arg_38;
2913 (*ol_args).ec = mcc_arg_39;
2914 (*ol_args).sbe = mcc_arg_40;
2915 nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } };
2916 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2917 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_39, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_40, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
2918 ;
2919 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
2920 if (err != NANOS_OK)
2921 {
2922 nanos_handle_error(err);
2923 }
2924 }
2925 }
2926 else
2927 {
2928 {
2929 imm_args.h = mcc_arg_38;
2930 imm_args.ec = mcc_arg_39;
2931 imm_args.sbe = mcc_arg_40;
2932 nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } };
2933 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2934 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_39, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_40, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
2935 ;
2936 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_7_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
2937 if (err != NANOS_OK)
2938 {
2939 nanos_handle_error(err);
2940 }
2941 }
2942 }
2943 }
2944 }
2945 }
2946 {
2947 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
2948 nanos_data_access_t dependences[1] = { { (void *)pc, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } };
2949 ;
2950 nanos_err_t err = nanos_wait_on(1, dependences);
2951 if (err != NANOS_OK)
2952 {
2953 nanos_handle_error(err);
2954 }
2955 }
2956 k++;
5458 } 2957 }
5459 } 2958 }
5460 } 2959 while ((!(*pc).final_frame && frames++ < (*h).num_frames) && !(*h).quit)
5461 s->release_cnt = 0; 2960 {
5462 }
5463 static void decode_3dwave_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *mprev, SuperMBTask *m)
5464 {
5465 H264Slice *s = &sbe->slice;
5466 H264Mb *mbs = sbe->mbs;
5467 decode_super_mb_block(d, s, smbc, mbs, m->smb_x, m->smb_y);
5468 }
5469 static void init_ref_list_and_get_dpb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe, int *init)
5470 {
5471 H264Slice *s = &sbe->slice;
5472 for (int i = 0;
5473 i < 2;
5474 i++)
5475 {
5476 for (int j = 0;
5477 j < s->ref_count[i];
5478 j++)
5479 {
5480 if (s->ref_list_cpn[i][j] == - 1)
5481 continue;
5482 int k;
5483 for (k = 0;
5484 k < h->max_dpb_cnt;
5485 k++)
5486 { 2961 {
5487 if (h->dpb[k].reference >= 2 && h->dpb[k].cpn == s->ref_list_cpn[i][j]) 2962 nanos_err_t mcc_err_in_final_8;
5488 { 2963 _Bool mcc_is_in_final_8;
5489 s->dp_ref_list[i][j] = &h->dpb[k]; 2964 nanos_err_t mcc_err_in_final_9;
5490 break; 2965 _Bool mcc_is_in_final_9;
5491 } 2966 nanos_err_t mcc_err_in_final_10;
2967 _Bool mcc_is_in_final_10;
2968 nanos_err_t mcc_err_in_final_11;
2969 _Bool mcc_is_in_final_11;
2970 nanos_err_t mcc_err_in_final_12;
2971 _Bool mcc_is_in_final_12;
2972 mcc_err_in_final_8 = nanos_in_final(&mcc_is_in_final_8);
2973 {
2974 H264Context *mcc_arg_41 = h;
2975 ParserContext *mcc_arg_42 = pc;
2976 NalContext *mcc_arg_43 = nc;
2977 SliceBufferEntry *mcc_arg_44 = &sbe[k % bufs];
2978 if (mcc_is_in_final_8)
2979 {
2980 parse_task(h, pc, nc, &sbe[k % bufs]);
2981 }
2982 else
2983 {
2984 {
2985 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2986 struct nanos_args_8_t *ol_args;
2987 nanos_err_t err;
2988 struct nanos_args_8_t imm_args;
2989 static nanos_smp_args_t smp_ol_parse_task_17_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_8_t *))&smp_ol_parse_task_17 };
2990 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_8_t), 0, 1, 0, "parse_task" }, { { &nanos_smp_factory, &smp_ol_parse_task_17_args } } };
2991 nanos_wd_dyn_props.tie_to = 0;
2992 nanos_wd_dyn_props.priority = 0;
2993 nanos_wd_dyn_props.flags.is_final = 0;
2994 ol_args = (struct nanos_args_8_t *)0;
2995 void *nanos_wd_ = (void *)0;
2996 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_8_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
2997 if (err != NANOS_OK)
2998 {
2999 nanos_handle_error(err);
3000 }
3001 /* Check pendant writes on subexpressions */
3002 /* End check pendant writes on subexpressions */
3003 if (nanos_wd_ != (void *)0)
3004 {
3005 {
3006 (*ol_args).h = mcc_arg_41;
3007 (*ol_args).pc = mcc_arg_42;
3008 (*ol_args).nc = mcc_arg_43;
3009 (*ol_args).sbe = mcc_arg_44;
3010 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
3011 nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } };
3012 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3013 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_42, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_43, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_44, { 0, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3014 ;
3015 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3016 if (err != NANOS_OK)
3017 {
3018 nanos_handle_error(err);
3019 }
3020 }
3021 }
3022 else
3023 {
3024 {
3025 imm_args.h = mcc_arg_41;
3026 imm_args.pc = mcc_arg_42;
3027 imm_args.nc = mcc_arg_43;
3028 imm_args.sbe = mcc_arg_44;
3029 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
3030 nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } };
3031 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3032 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_42, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_43, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_44, { 0, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3033 ;
3034 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_8_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3035 if (err != NANOS_OK)
3036 {
3037 nanos_handle_error(err);
3038 }
3039 }
3040 }
3041 }
3042 }
3043 }
3044 mcc_err_in_final_9 = nanos_in_final(&mcc_is_in_final_9);
3045 {
3046 H264Context *mcc_arg_45 = h;
3047 EntropyContext *mcc_arg_46 = ec[k % bufs];
3048 SliceBufferEntry *mcc_arg_47 = &sbe[k % bufs];
3049 if (mcc_is_in_final_9)
3050 {
3051 decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]);
3052 }
3053 else
3054 {
3055 {
3056 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3057 struct nanos_args_9_t *ol_args;
3058 nanos_err_t err;
3059 struct nanos_args_9_t imm_args;
3060 static nanos_smp_args_t smp_ol_decode_slice_entropy_task_19_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_9_t *))&smp_ol_decode_slice_entropy_task_19 };
3061 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_9_t), 0, 1, 0, "decode_slice_entropy_task" }, { { &nanos_smp_factory, &smp_ol_decode_slice_entropy_task_19_args } } };
3062 nanos_wd_dyn_props.tie_to = 0;
3063 nanos_wd_dyn_props.priority = 0;
3064 nanos_wd_dyn_props.flags.is_final = 0;
3065 ol_args = (struct nanos_args_9_t *)0;
3066 void *nanos_wd_ = (void *)0;
3067 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_9_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3068 if (err != NANOS_OK)
3069 {
3070 nanos_handle_error(err);
3071 }
3072 /* Check pendant writes on subexpressions */
3073 /* End check pendant writes on subexpressions */
3074 if (nanos_wd_ != (void *)0)
3075 {
3076 {
3077 (*ol_args).h = mcc_arg_45;
3078 (*ol_args).ec = mcc_arg_46;
3079 (*ol_args).sbe = mcc_arg_47;
3080 nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } };
3081 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3082 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_46, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_47, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
3083 ;
3084 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3085 if (err != NANOS_OK)
3086 {
3087 nanos_handle_error(err);
3088 }
3089 }
3090 }
3091 else
3092 {
3093 {
3094 imm_args.h = mcc_arg_45;
3095 imm_args.ec = mcc_arg_46;
3096 imm_args.sbe = mcc_arg_47;
3097 nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } };
3098 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3099 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_46, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_47, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
3100 ;
3101 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_9_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3102 if (err != NANOS_OK)
3103 {
3104 nanos_handle_error(err);
3105 }
3106 }
3107 }
3108 }
3109 }
3110 }
3111 k++;
3112 mcc_err_in_final_10 = nanos_in_final(&mcc_is_in_final_10);
3113 {
3114 H264Context *mcc_arg_48 = h;
3115 MBRecContext *mcc_arg_49 = rc[k % 2];
3116 SliceBufferEntry *mcc_arg_50 = &sbe[k % bufs];
3117 int *mcc_arg_51 = &init;
3118 if (mcc_is_in_final_10)
3119 {
3120 init_ref_list_and_get_dpb_task(h, rc[k % 2], &sbe[k % bufs], &init);
3121 }
3122 else
3123 {
3124 {
3125 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3126 struct nanos_args_10_t *ol_args;
3127 nanos_err_t err;
3128 struct nanos_args_10_t imm_args;
3129 static nanos_smp_args_t smp_ol_init_ref_list_and_get_dpb_task_21_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_10_t *))&smp_ol_init_ref_list_and_get_dpb_task_21 };
3130 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_10_t), 0, 1, 0, "init_ref_list_and_get_dpb_task" }, { { &nanos_smp_factory, &smp_ol_init_ref_list_and_get_dpb_task_21_args } } };
3131 nanos_wd_dyn_props.tie_to = 0;
3132 nanos_wd_dyn_props.priority = 0;
3133 nanos_wd_dyn_props.flags.is_final = 0;
3134 ol_args = (struct nanos_args_10_t *)0;
3135 void *nanos_wd_ = (void *)0;
3136 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_10_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3137 if (err != NANOS_OK)
3138 {
3139 nanos_handle_error(err);
3140 }
3141 /* Check pendant writes on subexpressions */
3142 /* End check pendant writes on subexpressions */
3143 if (nanos_wd_ != (void *)0)
3144 {
3145 {
3146 (*ol_args).h = mcc_arg_48;
3147 (*ol_args).d = mcc_arg_49;
3148 (*ol_args).sbe = mcc_arg_50;
3149 (*ol_args).init = mcc_arg_51;
3150 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3151 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3152 nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } };
3153 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_49, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_50, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_51, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3154 ;
3155 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3156 if (err != NANOS_OK)
3157 {
3158 nanos_handle_error(err);
3159 }
3160 }
3161 }
3162 else
3163 {
3164 {
3165 imm_args.h = mcc_arg_48;
3166 imm_args.d = mcc_arg_49;
3167 imm_args.sbe = mcc_arg_50;
3168 imm_args.init = mcc_arg_51;
3169 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3170 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3171 nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } };
3172 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_49, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_50, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_51, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3173 ;
3174 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_10_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3175 if (err != NANOS_OK)
3176 {
3177 nanos_handle_error(err);
3178 }
3179 }
3180 }
3181 }
3182 }
3183 }
3184 smbc = acquire_smbc(h);
3185 SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc);
3186 mcc_err_in_final_11 = nanos_in_final(&mcc_is_in_final_11);
3187 {
3188 H264Context *mcc_arg_52 = h;
3189 SuperMBContext *mcc_arg_53 = smbc;
3190 MBRecContext *mcc_arg_54 = rc[k % 2];
3191 SliceBufferEntry *mcc_arg_55 = &sbe[k % bufs];
3192 SuperMBTask *mcc_arg_56 = lastsmb;
3193 int *mcc_arg_57 = &release;
3194 if (mcc_is_in_final_11)
3195 {
3196 release_ref_list_task(h, smbc, rc[k % 2], &sbe[k % bufs], lastsmb, &release);
3197 }
3198 else
3199 {
3200 {
3201 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3202 struct nanos_args_11_t *ol_args;
3203 nanos_err_t err;
3204 struct nanos_args_11_t imm_args;
3205 static nanos_smp_args_t smp_ol_release_ref_list_task_23_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_11_t *))&smp_ol_release_ref_list_task_23 };
3206 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_11_t), 0, 1, 0, "release_ref_list_task" }, { { &nanos_smp_factory, &smp_ol_release_ref_list_task_23_args } } };
3207 nanos_wd_dyn_props.tie_to = 0;
3208 nanos_wd_dyn_props.priority = 0;
3209 nanos_wd_dyn_props.flags.is_final = 0;
3210 ol_args = (struct nanos_args_11_t *)0;
3211 void *nanos_wd_ = (void *)0;
3212 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_11_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3213 if (err != NANOS_OK)
3214 {
3215 nanos_handle_error(err);
3216 }
3217 /* Check pendant writes on subexpressions */
3218 /* End check pendant writes on subexpressions */
3219 if (nanos_wd_ != (void *)0)
3220 {
3221 {
3222 (*ol_args).h = mcc_arg_52;
3223 (*ol_args).smbc = mcc_arg_53;
3224 (*ol_args).d = mcc_arg_54;
3225 (*ol_args).sbe = mcc_arg_55;
3226 (*ol_args).lastsmb = mcc_arg_56;
3227 (*ol_args).release = mcc_arg_57;
3228 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3229 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3230 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
3231 nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } };
3232 nanos_data_access_t dependences[4] = { { (void *)mcc_arg_54, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_55, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_56, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_57, { 1, 1, 0, 0, 0 }, 1, dimensions_3, 0 } };
3233 ;
3234 err = nanos_submit(nanos_wd_, 4, dependences, (void *)0);
3235 if (err != NANOS_OK)
3236 {
3237 nanos_handle_error(err);
3238 }
3239 }
3240 }
3241 else
3242 {
3243 {
3244 imm_args.h = mcc_arg_52;
3245 imm_args.smbc = mcc_arg_53;
3246 imm_args.d = mcc_arg_54;
3247 imm_args.sbe = mcc_arg_55;
3248 imm_args.lastsmb = mcc_arg_56;
3249 imm_args.release = mcc_arg_57;
3250 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3251 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3252 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
3253 nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } };
3254 nanos_data_access_t dependences[4] = { { (void *)mcc_arg_54, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_55, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_56, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_57, { 1, 1, 0, 0, 0 }, 1, dimensions_3, 0 } };
3255 ;
3256 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_11_t), &imm_args, 4, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3257 if (err != NANOS_OK)
3258 {
3259 nanos_handle_error(err);
3260 }
3261 }
3262 }
3263 }
3264 }
3265 }
3266 mcc_err_in_final_12 = nanos_in_final(&mcc_is_in_final_12);
3267 {
3268 H264Context *mcc_arg_58 = h;
3269 OutputContext *mcc_arg_59 = oc;
3270 SliceBufferEntry *mcc_arg_60 = &sbe[k % bufs];
3271 if (mcc_is_in_final_12)
3272 {
3273 output_task(h, oc, &sbe[k % bufs]);
3274 }
3275 else
3276 {
3277 {
3278 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3279 struct nanos_args_12_t *ol_args;
3280 nanos_err_t err;
3281 struct nanos_args_12_t imm_args;
3282 static nanos_smp_args_t smp_ol_output_task_25_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_12_t *))&smp_ol_output_task_25 };
3283 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_12_t), 0, 1, 0, "output_task" }, { { &nanos_smp_factory, &smp_ol_output_task_25_args } } };
3284 nanos_wd_dyn_props.tie_to = 0;
3285 nanos_wd_dyn_props.priority = 0;
3286 nanos_wd_dyn_props.flags.is_final = 0;
3287 ol_args = (struct nanos_args_12_t *)0;
3288 void *nanos_wd_ = (void *)0;
3289 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_12_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3290 if (err != NANOS_OK)
3291 {
3292 nanos_handle_error(err);
3293 }
3294 /* Check pendant writes on subexpressions */
3295 /* End check pendant writes on subexpressions */
3296 if (nanos_wd_ != (void *)0)
3297 {
3298 {
3299 (*ol_args).h = mcc_arg_58;
3300 (*ol_args).oc = mcc_arg_59;
3301 (*ol_args).sbe = mcc_arg_60;
3302 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
3303 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3304 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_59, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_60, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 } };
3305 ;
3306 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3307 if (err != NANOS_OK)
3308 {
3309 nanos_handle_error(err);
3310 }
3311 }
3312 }
3313 else
3314 {
3315 {
3316 imm_args.h = mcc_arg_58;
3317 imm_args.oc = mcc_arg_59;
3318 imm_args.sbe = mcc_arg_60;
3319 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
3320 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3321 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_59, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_60, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 } };
3322 ;
3323 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_12_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3324 if (err != NANOS_OK)
3325 {
3326 nanos_handle_error(err);
3327 }
3328 }
3329 }
3330 }
3331 }
3332 }
3333 {
3334 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
3335 nanos_data_access_t dependences[1] = { { (void *)pc, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } };
3336 ;
3337 nanos_err_t err = nanos_wait_on(1, dependences);
3338 if (err != NANOS_OK)
3339 {
3340 nanos_handle_error(err);
3341 }
3342 }
5492 } 3343 }
5493 } 3344 }
5494 } 3345 for (int i = 0; i < num_pre_ed; i++)
5495 { 3346 {
5496 nanos_set_lock(&_nx_u_dpb_critical_lock);
5497 get_dpb_entry(h, s);
5498 nanos_unset_lock(&_nx_u_dpb_critical_lock);
5499 }
5500 }
5501 typedef struct _nx_data_env_2_t_tag
5502 {
5503 struct MBRecContext *__tmp_0_0;
5504 SliceBufferEntry *__tmp_1_0;
5505 struct SuperMBContext *__tmp_2_0;
5506 struct SuperMBTask *__tmp_3_0;
5507 struct SuperMBTask *__tmp_4_0;
5508 struct SuperMBTask *__tmp_5_0;
5509 struct SuperMBTask *__tmp_6_0;
5510 } _nx_data_env_2_t;
5511 static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc);
5512 static void _smp__ol_add_decode_slice_3dwave_tasks_2(_nx_data_env_2_t *const __restrict__ _args)
5513 {
5514 struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0;
5515 SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0;
5516 struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0;
5517 struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0;
5518 struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0;
5519 struct SuperMBTask *___tmp_5_0 = _args->__tmp_5_0;
5520 struct SuperMBTask *___tmp_6_0 = _args->__tmp_6_0;
5521 /* Translation is done by the runtime */
5522 {
5523 decode_3dwave_super_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0), (___tmp_6_0));
5524 }
5525 }
5526 typedef struct _nx_data_env_3_t_tag
5527 {
5528 struct MBRecContext *__tmp_0_0;
5529 SliceBufferEntry *__tmp_1_0;
5530 struct SuperMBContext *__tmp_2_0;
5531 struct SuperMBTask *__tmp_3_0;
5532 int __tmp_4_0;
5533 } _nx_data_env_3_t;
5534 static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc);
5535 static void _smp__ol_add_decode_slice_3dwave_tasks_3(_nx_data_env_3_t *const __restrict__ _args)
5536 {
5537 struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0;
5538 SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0;
5539 struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0;
5540 struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0;
5541 int ___tmp_4_0 = _args->__tmp_4_0;
5542 /* Translation is done by the runtime */
5543 {
5544 draw_edges_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0));
5545 }
5546 }
5547 typedef struct _nx_data_env_4_t_tag
5548 {
5549 struct MBRecContext *__tmp_0_0;
5550 SliceBufferEntry *__tmp_1_0;
5551 struct SuperMBContext *__tmp_2_0;
5552 struct SuperMBTask *__tmp_3_0;
5553 struct SuperMBTask *__tmp_4_0;
5554 struct SuperMBTask *__tmp_5_0;
5555 } _nx_data_env_4_t;
5556 static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc);
5557 static void _smp__ol_add_decode_slice_3dwave_tasks_4(_nx_data_env_4_t *const __restrict__ _args)
5558 {
5559 struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0;
5560 SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0;
5561 struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0;
5562 struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0;
5563 struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0;
5564 struct SuperMBTask *___tmp_5_0 = _args->__tmp_5_0;
5565 /* Translation is done by the runtime */
5566 {
5567 decode_super_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0));
5568 }
5569 }
5570 typedef struct _nx_data_env_5_t_tag
5571 {
5572 struct MBRecContext *__tmp_0_0;
5573 SliceBufferEntry *__tmp_1_0;
5574 struct SuperMBContext *__tmp_2_0;
5575 struct SuperMBTask *__tmp_3_0;
5576 int __tmp_4_0;
5577 } _nx_data_env_5_t;
5578 static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc);
5579 static void _smp__ol_add_decode_slice_3dwave_tasks_5(_nx_data_env_5_t *const __restrict__ _args)
5580 {
5581 struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0;
5582 SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0;
5583 struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0;
5584 struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0;
5585 int ___tmp_4_0 = _args->__tmp_4_0;
5586 /* Translation is done by the runtime */
5587 {
5588 draw_edges_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0));
5589 }
5590 }
5591 static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc)
5592 {
5593 int i, j;
5594 int smb_3d_height = smbc->nsmb_3dheight;
5595 int smb_height = smbc->nsmb_height, smb_width = smbc->nsmb_width;
5596 int smb_diff_prev = smb_height - smb_3d_height;
5597 SuperMBTask *sm = ((void *) 0), *sml, *smur, *smprev;
5598 SuperMBTask *smbs = smbc->smbs[smbc->index++];
5599 smbc->index %= 2;
5600 SuperMBTask *smbs_prev = smbc->smbs[smbc->index];
5601 for (j = 0;
5602 j < smb_3d_height;
5603 j++)
5604 {
5605 for (i = 0;
5606 i < smb_width;
5607 i++)
5608 {
5609 sm = smbs + j * smb_width + i;
5610 sml = sm - ((i > 0) ? 1 : 0);
5611 smur = sm + (((i < smb_width - 1) && (j > 0)) ? - smb_width + 1 : 0);
5612 smprev = smbs_prev + (j + smb_diff_prev + 1) * smb_width - 1;
5613 { 3347 {
5614 struct MBRecContext *__tmp_0 = d; 3348 nanos_err_t mcc_err_in_final_13;
5615 SliceBufferEntry *__tmp_1 = sbe; 3349 _Bool mcc_is_in_final_13;
5616 struct SuperMBContext *__tmp_2 = smbc; 3350 nanos_err_t mcc_err_in_final_14;
5617 struct SuperMBTask *__tmp_3 = sml; 3351 _Bool mcc_is_in_final_14;
5618 struct SuperMBTask *__tmp_4 = smur; 3352 nanos_err_t mcc_err_in_final_15;
5619 struct SuperMBTask *__tmp_5 = smprev; 3353 _Bool mcc_is_in_final_15;
5620 struct SuperMBTask *__tmp_6 = sm; 3354 k++;
5621 { 3355 mcc_err_in_final_13 = nanos_in_final(&mcc_is_in_final_13);
5622 /* SMP device descriptor */ 3356 {
5623 static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_2_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_2}; 3357 H264Context *mcc_arg_61 = h;
5624 _nx_data_env_2_t *ol_args = (_nx_data_env_2_t *) 0; 3358 MBRecContext *mcc_arg_62 = rc[k % 2];
5625 nanos_wd_t wd = (nanos_wd_t) 0; 3359 SliceBufferEntry *mcc_arg_63 = &sbe[k % bufs];
5626 struct nanos_const_wd_definition_local_t 3360 int *mcc_arg_64 = &init;
3361 if (mcc_is_in_final_13)
3362 {
3363 init_ref_list_and_get_dpb_task(h, rc[k % 2], &sbe[k % bufs], &init);
3364 }
3365 else
3366 {
5627 { 3367 {
5628 nanos_const_wd_definition_t base; 3368 nanos_wd_dyn_props_t nanos_wd_dyn_props;
5629 nanos_device_t devices[1]; 3369 struct nanos_args_13_t *ol_args;
5630 }; 3370 nanos_err_t err;
5631 static struct nanos_const_wd_definition_local_t _const_def = { 3371 struct nanos_args_13_t imm_args;
5632 { 3372 static nanos_smp_args_t smp_ol_init_ref_list_and_get_dpb_task_27_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_13_t *))&smp_ol_init_ref_list_and_get_dpb_task_27 };
5633 { 3373 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_13_t), 0, 1, 0, "init_ref_list_and_get_dpb_task" }, { { &nanos_smp_factory, &smp_ol_init_ref_list_and_get_dpb_task_27_args } } };
5634 0, 3374 nanos_wd_dyn_props.tie_to = 0;
5635 1, 3375 nanos_wd_dyn_props.priority = 0;
5636 0, 3376 nanos_wd_dyn_props.flags.is_final = 0;
5637 0, 3377 ol_args = (struct nanos_args_13_t *)0;
5638 0, 3378 void *nanos_wd_ = (void *)0;
5639 0, 3379 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_13_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
5640 0, 3380 if (err != NANOS_OK)
5641 0 3381 {
5642 }, 3382 nanos_handle_error(err);
5643 __alignof__(_nx_data_env_2_t), 3383 }
5644 0, 3384 /* Check pendant writes on subexpressions */
5645 1 3385 /* End check pendant writes on subexpressions */
5646 }, 3386 if (nanos_wd_ != (void *)0)
5647 {{ 3387 {
5648 nanos_smp_factory, 3388 {
5649 &_ol_add_decode_slice_3dwave_tasks_2_smp_args 3389 (*ol_args).h = mcc_arg_61;
5650 }} 3390 (*ol_args).d = mcc_arg_62;
5651 }; 3391 (*ol_args).sbe = mcc_arg_63;
5652 nanos_wd_dyn_props_t dyn_props = {0}; 3392 (*ol_args).init = mcc_arg_64;
5653 nanos_err_t err; 3393 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
5654 dyn_props.priority = 0; 3394 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5655 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_2_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); 3395 nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } };
5656 if (err != NANOS_OK) 3396 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_62, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_63, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_64, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
5657 nanos_handle_error(err); 3397 ;
5658 if (wd != (nanos_wd_t) 0) 3398 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3399 if (err != NANOS_OK)
3400 {
3401 nanos_handle_error(err);
3402 }
3403 }
3404 }
3405 else
3406 {
3407 {
3408 imm_args.h = mcc_arg_61;
3409 imm_args.d = mcc_arg_62;
3410 imm_args.sbe = mcc_arg_63;
3411 imm_args.init = mcc_arg_64;
3412 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3413 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3414 nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } };
3415 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_62, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_63, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_64, { 1, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3416 ;
3417 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_13_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3418 if (err != NANOS_OK)
3419 {
3420 nanos_handle_error(err);
3421 }
3422 }
3423 }
3424 }
3425 }
3426 }
3427 smbc = acquire_smbc(h);
3428 SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc);
3429 mcc_err_in_final_14 = nanos_in_final(&mcc_is_in_final_14);
3430 {
3431 H264Context *mcc_arg_65 = h;
3432 SuperMBContext *mcc_arg_66 = smbc;
3433 MBRecContext *mcc_arg_67 = rc[k % 2];
3434 SliceBufferEntry *mcc_arg_68 = &sbe[k % bufs];
3435 SuperMBTask *mcc_arg_69 = lastsmb;
3436 int *mcc_arg_70 = &release;
3437 if (mcc_is_in_final_14)
3438 {
3439 release_ref_list_task(h, smbc, rc[k % 2], &sbe[k % bufs], lastsmb, &release);
3440 }
3441 else
3442 {
5659 { 3443 {
5660 ol_args->__tmp_0_0 = __tmp_0; 3444 nanos_wd_dyn_props_t nanos_wd_dyn_props;
5661 ol_args->__tmp_1_0 = __tmp_1; 3445 struct nanos_args_14_t *ol_args;
5662 ol_args->__tmp_2_0 = __tmp_2; 3446 nanos_err_t err;
5663 ol_args->__tmp_3_0 = __tmp_3; 3447 struct nanos_args_14_t imm_args;
5664 ol_args->__tmp_4_0 = __tmp_4; 3448 static nanos_smp_args_t smp_ol_release_ref_list_task_29_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_14_t *))&smp_ol_release_ref_list_task_29 };
5665 ol_args->__tmp_5_0 = __tmp_5; 3449 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_14_t), 0, 1, 0, "release_ref_list_task" }, { { &nanos_smp_factory, &smp_ol_release_ref_list_task_29_args } } };
5666 ol_args->__tmp_6_0 = __tmp_6; 3450 nanos_wd_dyn_props.tie_to = 0;
5667 nanos_dependence_t _dependences[6] = { 3451 nanos_wd_dyn_props.priority = 0;
5668 { 3452 nanos_wd_dyn_props.flags.is_final = 0;
5669 (void **) &ol_args->__tmp_0_0, 3453 ol_args = (struct nanos_args_14_t *)0;
5670 ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), 3454 void *nanos_wd_ = (void *)0;
5671 { 3455 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_14_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
5672 1, 3456 if (err != NANOS_OK)
5673 0, 3457 {
5674 1, 3458 nanos_handle_error(err);
5675 0 3459 }
5676 }, 3460 /* Check pendant writes on subexpressions */
5677 sizeof(struct MBRecContext) 3461 /* End check pendant writes on subexpressions */
5678 }, 3462 if (nanos_wd_ != (void *)0)
5679 { 3463 {
5680 (void **) &ol_args->__tmp_1_0, 3464 {
5681 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), 3465 (*ol_args).h = mcc_arg_65;
5682 { 3466 (*ol_args).smbc = mcc_arg_66;
5683 1, 3467 (*ol_args).d = mcc_arg_67;
5684 0, 3468 (*ol_args).sbe = mcc_arg_68;
5685 1, 3469 (*ol_args).lastsmb = mcc_arg_69;
5686 0 3470 (*ol_args).release = mcc_arg_70;
5687 }, 3471 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
5688 sizeof(SliceBufferEntry) 3472 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5689 }, 3473 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5690 { 3474 nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } };
5691 (void **) &ol_args->__tmp_3_0, 3475 nanos_data_access_t dependences[4] = { { (void *)mcc_arg_67, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_68, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_69, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_70, { 1, 1, 0, 0, 0 }, 1, dimensions_3, 0 } };
5692 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), 3476 ;
5693 { 3477 err = nanos_submit(nanos_wd_, 4, dependences, (void *)0);
5694 1, 3478 if (err != NANOS_OK)
5695 0, 3479 {
5696 1, 3480 nanos_handle_error(err);
5697 0 3481 }
5698 }, 3482 }
5699 sizeof(struct SuperMBTask) 3483 }
5700 }, 3484 else
5701 { 3485 {
5702 (void **) &ol_args->__tmp_4_0, 3486 {
5703 ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0), 3487 imm_args.h = mcc_arg_65;
5704 { 3488 imm_args.smbc = mcc_arg_66;
5705 1, 3489 imm_args.d = mcc_arg_67;
5706 0, 3490 imm_args.sbe = mcc_arg_68;
5707 1, 3491 imm_args.lastsmb = mcc_arg_69;
5708 0 3492 imm_args.release = mcc_arg_70;
5709 }, 3493 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
5710 sizeof(struct SuperMBTask) 3494 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5711 }, 3495 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
5712 { 3496 nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } };
5713 (void **) &ol_args->__tmp_5_0, 3497 nanos_data_access_t dependences[4] = { { (void *)mcc_arg_67, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_68, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_69, { 1, 0, 0, 0, 0 }, 1, dimensions_2, 0 }, { (void *)mcc_arg_70, { 1, 1, 0, 0, 0 }, 1, dimensions_3, 0 } };
5714 ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0), 3498 ;
5715 { 3499 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_14_t), &imm_args, 4, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
5716 1, 3500 if (err != NANOS_OK)
5717 0, 3501 {
5718 1, 3502 nanos_handle_error(err);
5719 0 3503 }
5720 }, 3504 }
5721 sizeof(struct SuperMBTask) 3505 }
5722 },
5723 {
5724 (void **) &ol_args->__tmp_6_0,
5725 ((char *) ((__tmp_6)) - (char *) ol_args->__tmp_6_0),
5726 {
5727 1,
5728 1,
5729 1,
5730 0
5731 },
5732 sizeof(struct SuperMBTask)
5733 }
5734 };
5735 err = nanos_submit(wd, 6, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
5736 if (err != NANOS_OK)
5737 nanos_handle_error(err);
5738 } 3506 }
5739 else 3507 }
3508 }
3509 mcc_err_in_final_15 = nanos_in_final(&mcc_is_in_final_15);
3510 {
3511 H264Context *mcc_arg_71 = h;
3512 OutputContext *mcc_arg_72 = oc;
3513 SliceBufferEntry *mcc_arg_73 = &sbe[k % bufs];
3514 if (mcc_is_in_final_15)
3515 {
3516 output_task(h, oc, &sbe[k % bufs]);
3517 }
3518 else
3519 {
5740 { 3520 {
5741 _nx_data_env_2_t imm_args; 3521 nanos_wd_dyn_props_t nanos_wd_dyn_props;
5742 imm_args.__tmp_0_0 = __tmp_0; 3522 struct nanos_args_15_t *ol_args;
5743 imm_args.__tmp_1_0 = __tmp_1; 3523 nanos_err_t err;
5744 imm_args.__tmp_2_0 = __tmp_2; 3524 struct nanos_args_15_t imm_args;
5745 imm_args.__tmp_3_0 = __tmp_3; 3525 static nanos_smp_args_t smp_ol_output_task_31_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_15_t *))&smp_ol_output_task_31 };
5746 imm_args.__tmp_4_0 = __tmp_4; 3526 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_15_t), 0, 1, 0, "output_task" }, { { &nanos_smp_factory, &smp_ol_output_task_31_args } } };
5747 imm_args.__tmp_5_0 = __tmp_5; 3527 nanos_wd_dyn_props.tie_to = 0;
5748 imm_args.__tmp_6_0 = __tmp_6; 3528 nanos_wd_dyn_props.priority = 0;
5749 nanos_dependence_t _dependences[6] = { 3529 nanos_wd_dyn_props.flags.is_final = 0;
5750 { 3530 ol_args = (struct nanos_args_15_t *)0;
5751 (void **) &imm_args.__tmp_0_0, 3531 void *nanos_wd_ = (void *)0;
5752 ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), 3532 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_15_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
5753 { 3533 if (err != NANOS_OK)
5754 1, 3534 {
5755 0, 3535 nanos_handle_error(err);
5756 1, 3536 }
5757 0 3537 /* Check pendant writes on subexpressions */
5758 }, 3538 /* End check pendant writes on subexpressions */
5759 sizeof(struct MBRecContext) 3539 if (nanos_wd_ != (void *)0)
5760 }, 3540 {
5761 { 3541 {
5762 (void **) &imm_args.__tmp_1_0, 3542 (*ol_args).h = mcc_arg_71;
5763 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), 3543 (*ol_args).oc = mcc_arg_72;
5764 { 3544 (*ol_args).sbe = mcc_arg_73;
5765 1, 3545 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
5766 0, 3546 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5767 1, 3547 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_72, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_73, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 } };
5768 0 3548 ;
5769 }, 3549 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
5770 sizeof(SliceBufferEntry) 3550 if (err != NANOS_OK)
5771 }, 3551 {
5772 { 3552 nanos_handle_error(err);
5773 (void **) &imm_args.__tmp_3_0, 3553 }
5774 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), 3554 }
5775 { 3555 }
5776 1, 3556 else
5777 0, 3557 {
5778 1, 3558 {
5779 0 3559 imm_args.h = mcc_arg_71;
5780 }, 3560 imm_args.oc = mcc_arg_72;
5781 sizeof(struct SuperMBTask) 3561 imm_args.sbe = mcc_arg_73;
5782 }, 3562 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
5783 { 3563 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
5784 (void **) &imm_args.__tmp_4_0, 3564 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_72, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_73, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 } };
5785 ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0), 3565 ;
5786 { 3566 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_15_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
5787 1, 3567 if (err != NANOS_OK)
5788 0, 3568 {
5789 1, 3569 nanos_handle_error(err);
5790 0 3570 }
5791 }, 3571 }
5792 sizeof(struct SuperMBTask) 3572 }
5793 },
5794 {
5795 (void **) &imm_args.__tmp_5_0,
5796 ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0),
5797 {
5798 1,
5799 0,
5800 1,
5801 0
5802 },
5803 sizeof(struct SuperMBTask)
5804 },
5805 {
5806 (void **) &imm_args.__tmp_6_0,
5807 ((char *) ((__tmp_6)) - (char *) imm_args.__tmp_6_0),
5808 {
5809 1,
5810 1,
5811 1,
5812 0
5813 },
5814 sizeof(struct SuperMBTask)
5815 }
5816 };
5817 dyn_props.priority = 0;
5818 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_2_t), &imm_args, 6, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
5819 if (err != NANOS_OK)
5820 nanos_handle_error(err);
5821 } 3573 }
5822 } 3574 }
3575 }
3576 }
3577 }
3578 }
3579 }
3580 else
3581 {
3582 {
3583 while ((!(*pc).final_frame && frames++ < (*h).num_frames) && !(*h).quit)
3584 {
3585 {
3586 nanos_err_t mcc_err_in_final_16;
3587 _Bool mcc_is_in_final_16;
3588 nanos_err_t mcc_err_in_final_17;
3589 _Bool mcc_is_in_final_17;
3590 nanos_err_t mcc_err_in_final_18;
3591 _Bool mcc_is_in_final_18;
3592 nanos_err_t mcc_err_in_final_19;
3593 _Bool mcc_is_in_final_19;
3594 mcc_err_in_final_16 = nanos_in_final(&mcc_is_in_final_16);
3595 {
3596 H264Context *mcc_arg_74 = h;
3597 ParserContext *mcc_arg_75 = pc;
3598 NalContext *mcc_arg_76 = nc;
3599 SliceBufferEntry *mcc_arg_77 = &sbe[k % bufs];
3600 if (mcc_is_in_final_16)
3601 {
3602 parse_task(h, pc, nc, &sbe[k % bufs]);
3603 }
3604 else
3605 {
3606 {
3607 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3608 struct nanos_args_16_t *ol_args;
3609 nanos_err_t err;
3610 struct nanos_args_16_t imm_args;
3611 static nanos_smp_args_t smp_ol_parse_task_33_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_16_t *))&smp_ol_parse_task_33 };
3612 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_16_t), 0, 1, 0, "parse_task" }, { { &nanos_smp_factory, &smp_ol_parse_task_33_args } } };
3613 nanos_wd_dyn_props.tie_to = 0;
3614 nanos_wd_dyn_props.priority = 0;
3615 nanos_wd_dyn_props.flags.is_final = 0;
3616 ol_args = (struct nanos_args_16_t *)0;
3617 void *nanos_wd_ = (void *)0;
3618 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_16_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3619 if (err != NANOS_OK)
3620 {
3621 nanos_handle_error(err);
3622 }
3623 /* Check pendant writes on subexpressions */
3624 /* End check pendant writes on subexpressions */
3625 if (nanos_wd_ != (void *)0)
3626 {
3627 {
3628 (*ol_args).h = mcc_arg_74;
3629 (*ol_args).pc = mcc_arg_75;
3630 (*ol_args).nc = mcc_arg_76;
3631 (*ol_args).sbe = mcc_arg_77;
3632 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
3633 nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } };
3634 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3635 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_75, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_76, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_77, { 0, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3636 ;
3637 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3638 if (err != NANOS_OK)
3639 {
3640 nanos_handle_error(err);
3641 }
3642 }
3643 }
3644 else
3645 {
3646 {
3647 imm_args.h = mcc_arg_74;
3648 imm_args.pc = mcc_arg_75;
3649 imm_args.nc = mcc_arg_76;
3650 imm_args.sbe = mcc_arg_77;
3651 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
3652 nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } };
3653 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3654 nanos_data_access_t dependences[3] = { { (void *)mcc_arg_75, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_76, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 }, { (void *)mcc_arg_77, { 0, 1, 0, 0, 0 }, 1, dimensions_2, 0 } };
3655 ;
3656 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_16_t), &imm_args, 3, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3657 if (err != NANOS_OK)
3658 {
3659 nanos_handle_error(err);
3660 }
3661 }
3662 }
3663 }
3664 }
3665 }
3666 mcc_err_in_final_17 = nanos_in_final(&mcc_is_in_final_17);
3667 {
3668 H264Context *mcc_arg_78 = h;
3669 EntropyContext *mcc_arg_79 = ec[k % bufs];
3670 SliceBufferEntry *mcc_arg_80 = &sbe[k % bufs];
3671 if (mcc_is_in_final_17)
3672 {
3673 decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]);
3674 }
3675 else
3676 {
3677 {
3678 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3679 struct nanos_args_17_t *ol_args;
3680 nanos_err_t err;
3681 struct nanos_args_17_t imm_args;
3682 static nanos_smp_args_t smp_ol_decode_slice_entropy_task_35_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_17_t *))&smp_ol_decode_slice_entropy_task_35 };
3683 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_17_t), 0, 1, 0, "decode_slice_entropy_task" }, { { &nanos_smp_factory, &smp_ol_decode_slice_entropy_task_35_args } } };
3684 nanos_wd_dyn_props.tie_to = 0;
3685 nanos_wd_dyn_props.priority = 0;
3686 nanos_wd_dyn_props.flags.is_final = 0;
3687 ol_args = (struct nanos_args_17_t *)0;
3688 void *nanos_wd_ = (void *)0;
3689 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_17_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3690 if (err != NANOS_OK)
3691 {
3692 nanos_handle_error(err);
3693 }
3694 /* Check pendant writes on subexpressions */
3695 /* End check pendant writes on subexpressions */
3696 if (nanos_wd_ != (void *)0)
3697 {
3698 {
3699 (*ol_args).h = mcc_arg_78;
3700 (*ol_args).ec = mcc_arg_79;
3701 (*ol_args).sbe = mcc_arg_80;
3702 nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } };
3703 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3704 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_79, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_80, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
3705 ;
3706 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3707 if (err != NANOS_OK)
3708 {
3709 nanos_handle_error(err);
3710 }
3711 }
3712 }
3713 else
3714 {
3715 {
3716 imm_args.h = mcc_arg_78;
3717 imm_args.ec = mcc_arg_79;
3718 imm_args.sbe = mcc_arg_80;
3719 nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } };
3720 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3721 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_79, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_80, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
3722 ;
3723 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_17_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3724 if (err != NANOS_OK)
3725 {
3726 nanos_handle_error(err);
3727 }
3728 }
3729 }
3730 }
3731 }
3732 }
3733 mcc_err_in_final_18 = nanos_in_final(&mcc_is_in_final_18);
3734 {
3735 H264Context *mcc_arg_81 = h;
3736 MBRecContext *mcc_arg_82 = rc[0];
3737 SliceBufferEntry *mcc_arg_83 = &sbe[k % bufs];
3738 if (mcc_is_in_final_18)
3739 {
3740 decode_slice_mb_task(h, rc[0], &sbe[k % bufs]);
3741 }
3742 else
3743 {
3744 {
3745 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3746 struct nanos_args_18_t *ol_args;
3747 nanos_err_t err;
3748 struct nanos_args_18_t imm_args;
3749 static nanos_smp_args_t smp_ol_decode_slice_mb_task_37_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_18_t *))&smp_ol_decode_slice_mb_task_37 };
3750 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_18_t), 0, 1, 0, "decode_slice_mb_task" }, { { &nanos_smp_factory, &smp_ol_decode_slice_mb_task_37_args } } };
3751 nanos_wd_dyn_props.tie_to = 0;
3752 nanos_wd_dyn_props.priority = 0;
3753 nanos_wd_dyn_props.flags.is_final = 0;
3754 ol_args = (struct nanos_args_18_t *)0;
3755 void *nanos_wd_ = (void *)0;
3756 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_18_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3757 if (err != NANOS_OK)
3758 {
3759 nanos_handle_error(err);
3760 }
3761 /* Check pendant writes on subexpressions */
3762 /* End check pendant writes on subexpressions */
3763 if (nanos_wd_ != (void *)0)
3764 {
3765 {
3766 (*ol_args).h = mcc_arg_81;
3767 (*ol_args).d = mcc_arg_82;
3768 (*ol_args).sbe = mcc_arg_83;
3769 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3770 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3771 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_82, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_83, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
3772 ;
3773 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3774 if (err != NANOS_OK)
3775 {
3776 nanos_handle_error(err);
3777 }
3778 }
3779 }
3780 else
3781 {
3782 {
3783 imm_args.h = mcc_arg_81;
3784 imm_args.d = mcc_arg_82;
3785 imm_args.sbe = mcc_arg_83;
3786 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3787 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3788 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_82, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_83, { 1, 1, 0, 0, 0 }, 1, dimensions_1, 0 } };
3789 ;
3790 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_18_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3791 if (err != NANOS_OK)
3792 {
3793 nanos_handle_error(err);
3794 }
3795 }
3796 }
3797 }
3798 }
3799 }
3800 mcc_err_in_final_19 = nanos_in_final(&mcc_is_in_final_19);
3801 {
3802 H264Context *mcc_arg_84 = h;
3803 OutputContext *mcc_arg_85 = oc;
3804 SliceBufferEntry *mcc_arg_86 = &sbe[k % bufs];
3805 if (mcc_is_in_final_19)
3806 {
3807 output_task(h, oc, &sbe[k % bufs]);
3808 }
3809 else
3810 {
3811 {
3812 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3813 struct nanos_args_19_t *ol_args;
3814 nanos_err_t err;
3815 struct nanos_args_19_t imm_args;
3816 static nanos_smp_args_t smp_ol_output_task_39_args = { .outline = (void (*)(void *))(void (*)(struct nanos_args_19_t *))&smp_ol_output_task_39 };
3817 static struct nanos_const_wd_definition_1 nanos_wd_const_data = { { { 0, 1, 0, 0, 0, 0, 0, 0 }, __alignof__(struct nanos_args_19_t), 0, 1, 0, "output_task" }, { { &nanos_smp_factory, &smp_ol_output_task_39_args } } };
3818 nanos_wd_dyn_props.tie_to = 0;
3819 nanos_wd_dyn_props.priority = 0;
3820 nanos_wd_dyn_props.flags.is_final = 0;
3821 ol_args = (struct nanos_args_19_t *)0;
3822 void *nanos_wd_ = (void *)0;
3823 err = nanos_create_wd_compact(&nanos_wd_, &nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_19_t), (void **)&ol_args, nanos_current_wd(), (nanos_copy_data_t **)0, (nanos_region_dimension_internal_t **)0);
3824 if (err != NANOS_OK)
3825 {
3826 nanos_handle_error(err);
3827 }
3828 /* Check pendant writes on subexpressions */
3829 /* End check pendant writes on subexpressions */
3830 if (nanos_wd_ != (void *)0)
3831 {
3832 {
3833 (*ol_args).h = mcc_arg_84;
3834 (*ol_args).oc = mcc_arg_85;
3835 (*ol_args).sbe = mcc_arg_86;
3836 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
3837 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3838 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_85, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_86, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 } };
3839 ;
3840 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3841 if (err != NANOS_OK)
3842 {
3843 nanos_handle_error(err);
3844 }
3845 }
3846 }
3847 else
3848 {
3849 {
3850 imm_args.h = mcc_arg_84;
3851 imm_args.oc = mcc_arg_85;
3852 imm_args.sbe = mcc_arg_86;
3853 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
3854 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3855 nanos_data_access_t dependences[2] = { { (void *)mcc_arg_85, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 }, { (void *)mcc_arg_86, { 1, 0, 0, 0, 0 }, 1, dimensions_1, 0 } };
3856 ;
3857 err = nanos_create_wd_and_run_compact(&nanos_wd_const_data.base, &nanos_wd_dyn_props, sizeof(struct nanos_args_19_t), &imm_args, 2, dependences, (nanos_copy_data_t *)0, (nanos_region_dimension_internal_t *)0, (void (*)(void *, void *))0);
3858 if (err != NANOS_OK)
3859 {
3860 nanos_handle_error(err);
3861 }
3862 }
3863 }
3864 }
3865 }
3866 }
3867 {
3868 nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } };
3869 nanos_data_access_t dependences[1] = { { (void *)pc, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } };
5823 ; 3870 ;
3871 nanos_err_t err = nanos_wait_on(1, dependences);
3872 if (err != NANOS_OK)
3873 {
3874 nanos_handle_error(err);
3875 }
3876 }
3877 k++;
5824 } 3878 }
5825 } 3879 }
5826 { 3880 }
5827 struct MBRecContext *__tmp_0 = d; 3881 }
5828 SliceBufferEntry *__tmp_1 = sbe; 3882 {
5829 struct SuperMBContext *__tmp_2 = smbc; 3883 nanos_err_t err;
5830 struct SuperMBTask *__tmp_3 = sm; 3884 void *nanos_wd_ = nanos_current_wd();
5831 int __tmp_4 = j; 3885 err = nanos_wg_wait_completion(nanos_wd_, 0);
5832 { 3886 if (err != NANOS_OK)
5833 /* SMP device descriptor */ 3887 {
5834 static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_3_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_3}; 3888 nanos_handle_error(err);
5835 _nx_data_env_3_t *ol_args = (_nx_data_env_3_t *) 0; 3889 }
5836 nanos_wd_t wd = (nanos_wd_t) 0; 3890 }
5837 struct nanos_const_wd_definition_local_t 3891 while ((out = output_frame(h, oc, (void *)0, (*h).ofile, (*h).frame_width, (*h).frame_height)))
5838 { 3892 {
5839 nanos_const_wd_definition_t base; 3893 ;
5840 nanos_device_t devices[1]; 3894 }
5841 }; 3895 (*h).num_frames = (*oc).frame_number;
5842 static struct nanos_const_wd_definition_local_t _const_def = { 3896 free_parse_context(pc);
5843 { 3897 free_nal_context(nc);
5844 { 3898 free_output_context(oc);
5845 0, 3899 for (int i = 0; i < bufs; i++)
5846 1, 3900 {
5847 0, 3901 {
5848 0,
5849 0,
5850 0,
5851 0,
5852 0
5853 },
5854 __alignof__(_nx_data_env_3_t),
5855 0,
5856 1
5857 },
5858 {{
5859 nanos_smp_factory,
5860 &_ol_add_decode_slice_3dwave_tasks_3_smp_args
5861 }}
5862 };
5863 nanos_wd_dyn_props_t dyn_props = {0};
5864 nanos_err_t err;
5865 dyn_props.priority = 0;
5866 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_3_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
5867 if (err != NANOS_OK)
5868 nanos_handle_error(err);
5869 if (wd != (nanos_wd_t) 0)
5870 {
5871 ol_args->__tmp_0_0 = __tmp_0;
5872 ol_args->__tmp_1_0 = __tmp_1;
5873 ol_args->__tmp_2_0 = __tmp_2;
5874 ol_args->__tmp_3_0 = __tmp_3;
5875 ol_args->__tmp_4_0 = __tmp_4;
5876 nanos_dependence_t _dependences[3] = {
5877 {
5878 (void **) &ol_args->__tmp_0_0,
5879 ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0),
5880 {
5881 1,
5882 0,
5883 1,
5884 0
5885 },
5886 sizeof(struct MBRecContext)
5887 },
5888 {
5889 (void **) &ol_args->__tmp_1_0,
5890 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
5891 {
5892 1,
5893 0,
5894 1,
5895 0
5896 },
5897 sizeof(SliceBufferEntry)
5898 },
5899 {
5900 (void **) &ol_args->__tmp_3_0,
5901 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
5902 {
5903 1,
5904 1,
5905 1,
5906 0
5907 },
5908 sizeof(struct SuperMBTask)
5909 }
5910 };
5911 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
5912 if (err != NANOS_OK)
5913 nanos_handle_error(err);
5914 }
5915 else
5916 {
5917 _nx_data_env_3_t imm_args;
5918 imm_args.__tmp_0_0 = __tmp_0;
5919 imm_args.__tmp_1_0 = __tmp_1;
5920 imm_args.__tmp_2_0 = __tmp_2;
5921 imm_args.__tmp_3_0 = __tmp_3;
5922 imm_args.__tmp_4_0 = __tmp_4;
5923 nanos_dependence_t _dependences[3] = {
5924 {
5925 (void **) &imm_args.__tmp_0_0,
5926 ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0),
5927 {
5928 1,
5929 0,
5930 1,
5931 0
5932 },
5933 sizeof(struct MBRecContext)
5934 },
5935 {
5936 (void **) &imm_args.__tmp_1_0,
5937 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
5938 {
5939 1,
5940 0,
5941 1,
5942 0
5943 },
5944 sizeof(SliceBufferEntry)
5945 },
5946 {
5947 (void **) &imm_args.__tmp_3_0,
5948 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
5949 {
5950 1,
5951 1,
5952 1,
5953 0
5954 },
5955 sizeof(struct SuperMBTask)
5956 }
5957 };
5958 dyn_props.priority = 0;
5959 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_3_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
5960 if (err != NANOS_OK)
5961 nanos_handle_error(err);
5962 }
5963 }
5964 ;
5965 }
5966 }
5967 for (;
5968 j < smb_height;
5969 j++)
5970 {
5971 for (i = 0;
5972 i < smb_width;
5973 i++)
5974 {
5975 sm = smbs + j * smb_width + i;
5976 sml = sm - ((i > 0) ? 1 : 0);
5977 smur = sm + (((i < smb_width - 1) && (j > 0)) ? - smb_width + 1 : 0);
5978 {
5979 struct MBRecContext *__tmp_0 = d;
5980 SliceBufferEntry *__tmp_1 = sbe;
5981 struct SuperMBContext *__tmp_2 = smbc;
5982 struct SuperMBTask *__tmp_3 = sml;
5983 struct SuperMBTask *__tmp_4 = smur;
5984 struct SuperMBTask *__tmp_5 = sm;
5985 {
5986 /* SMP device descriptor */
5987 static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_4_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_4};
5988 _nx_data_env_4_t *ol_args = (_nx_data_env_4_t *) 0;
5989 nanos_wd_t wd = (nanos_wd_t) 0;
5990 struct nanos_const_wd_definition_local_t
5991 {
5992 nanos_const_wd_definition_t base;
5993 nanos_device_t devices[1];
5994 };
5995 static struct nanos_const_wd_definition_local_t _const_def = {
5996 {
5997 {
5998 0,
5999 1,
6000 0,
6001 0,
6002 0,
6003 0,
6004 0,
6005 0
6006 },
6007 __alignof__(_nx_data_env_4_t),
6008 0,
6009 1
6010 },
6011 {{
6012 nanos_smp_factory,
6013 &_ol_add_decode_slice_3dwave_tasks_4_smp_args
6014 }}
6015 };
6016 nanos_wd_dyn_props_t dyn_props = {0};
6017 nanos_err_t err;
6018 dyn_props.priority = 0;
6019 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_4_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
6020 if (err != NANOS_OK)
6021 nanos_handle_error(err);
6022 if (wd != (nanos_wd_t) 0)
6023 {
6024 ol_args->__tmp_0_0 = __tmp_0;
6025 ol_args->__tmp_1_0 = __tmp_1;
6026 ol_args->__tmp_2_0 = __tmp_2;
6027 ol_args->__tmp_3_0 = __tmp_3;
6028 ol_args->__tmp_4_0 = __tmp_4;
6029 ol_args->__tmp_5_0 = __tmp_5;
6030 nanos_dependence_t _dependences[5] = {
6031 {
6032 (void **) &ol_args->__tmp_0_0,
6033 ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0),
6034 {
6035 1,
6036 0,
6037 1,
6038 0
6039 },
6040 sizeof(struct MBRecContext)
6041 },
6042 {
6043 (void **) &ol_args->__tmp_1_0,
6044 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
6045 {
6046 1,
6047 0,
6048 1,
6049 0
6050 },
6051 sizeof(SliceBufferEntry)
6052 },
6053 {
6054 (void **) &ol_args->__tmp_3_0,
6055 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
6056 {
6057 1,
6058 0,
6059 1,
6060 0
6061 },
6062 sizeof(struct SuperMBTask)
6063 },
6064 {
6065 (void **) &ol_args->__tmp_4_0,
6066 ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0),
6067 {
6068 1,
6069 0,
6070 1,
6071 0
6072 },
6073 sizeof(struct SuperMBTask)
6074 },
6075 {
6076 (void **) &ol_args->__tmp_5_0,
6077 ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0),
6078 {
6079 1,
6080 1,
6081 1,
6082 0
6083 },
6084 sizeof(struct SuperMBTask)
6085 }
6086 };
6087 err = nanos_submit(wd, 5, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
6088 if (err != NANOS_OK)
6089 nanos_handle_error(err);
6090 }
6091 else
6092 {
6093 _nx_data_env_4_t imm_args;
6094 imm_args.__tmp_0_0 = __tmp_0;
6095 imm_args.__tmp_1_0 = __tmp_1;
6096 imm_args.__tmp_2_0 = __tmp_2;
6097 imm_args.__tmp_3_0 = __tmp_3;
6098 imm_args.__tmp_4_0 = __tmp_4;
6099 imm_args.__tmp_5_0 = __tmp_5;
6100 nanos_dependence_t _dependences[5] = {
6101 {
6102 (void **) &imm_args.__tmp_0_0,
6103 ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0),
6104 {
6105 1,
6106 0,
6107 1,
6108 0
6109 },
6110 sizeof(struct MBRecContext)
6111 },
6112 {
6113 (void **) &imm_args.__tmp_1_0,
6114 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
6115 {
6116 1,
6117 0,
6118 1,
6119 0
6120 },
6121 sizeof(SliceBufferEntry)
6122 },
6123 {
6124 (void **) &imm_args.__tmp_3_0,
6125 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
6126 {
6127 1,
6128 0,
6129 1,
6130 0
6131 },
6132 sizeof(struct SuperMBTask)
6133 },
6134 {
6135 (void **) &imm_args.__tmp_4_0,
6136 ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0),
6137 {
6138 1,
6139 0,
6140 1,
6141 0
6142 },
6143 sizeof(struct SuperMBTask)
6144 },
6145 {
6146 (void **) &imm_args.__tmp_5_0,
6147 ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0),
6148 {
6149 1,
6150 1,
6151 1,
6152 0
6153 },
6154 sizeof(struct SuperMBTask)
6155 }
6156 };
6157 dyn_props.priority = 0;
6158 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_4_t), &imm_args, 5, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
6159 if (err != NANOS_OK)
6160 nanos_handle_error(err);
6161 }
6162 }
6163 ;
6164 }
6165 }
6166 {
6167 struct MBRecContext *__tmp_0 = d;
6168 SliceBufferEntry *__tmp_1 = sbe;
6169 struct SuperMBContext *__tmp_2 = smbc;
6170 struct SuperMBTask *__tmp_3 = sm;
6171 int __tmp_4 = j;
6172 {
6173 /* SMP device descriptor */
6174 static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_5_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_5};
6175 _nx_data_env_5_t *ol_args = (_nx_data_env_5_t *) 0;
6176 nanos_wd_t wd = (nanos_wd_t) 0;
6177 struct nanos_const_wd_definition_local_t
6178 {
6179 nanos_const_wd_definition_t base;
6180 nanos_device_t devices[1];
6181 };
6182 static struct nanos_const_wd_definition_local_t _const_def = {
6183 {
6184 {
6185 0,
6186 1,
6187 0,
6188 0,
6189 0,
6190 0,
6191 0,
6192 0
6193 },
6194 __alignof__(_nx_data_env_5_t),
6195 0,
6196 1
6197 },
6198 {{
6199 nanos_smp_factory,
6200 &_ol_add_decode_slice_3dwave_tasks_5_smp_args
6201 }}
6202 };
6203 nanos_wd_dyn_props_t dyn_props = {0};
6204 nanos_err_t err;
6205 dyn_props.priority = 0;
6206 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_5_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
6207 if (err != NANOS_OK)
6208 nanos_handle_error(err);
6209 if (wd != (nanos_wd_t) 0)
6210 {
6211 ol_args->__tmp_0_0 = __tmp_0;
6212 ol_args->__tmp_1_0 = __tmp_1;
6213 ol_args->__tmp_2_0 = __tmp_2;
6214 ol_args->__tmp_3_0 = __tmp_3;
6215 ol_args->__tmp_4_0 = __tmp_4;
6216 nanos_dependence_t _dependences[3] = {
6217 {
6218 (void **) &ol_args->__tmp_0_0,
6219 ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0),
6220 {
6221 1,
6222 0,
6223 1,
6224 0
6225 },
6226 sizeof(struct MBRecContext)
6227 },
6228 {
6229 (void **) &ol_args->__tmp_1_0,
6230 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
6231 {
6232 1,
6233 0,
6234 1,
6235 0
6236 },
6237 sizeof(SliceBufferEntry)
6238 },
6239 {
6240 (void **) &ol_args->__tmp_3_0,
6241 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
6242 {
6243 1,
6244 1,
6245 1,
6246 0
6247 },
6248 sizeof(struct SuperMBTask)
6249 }
6250 };
6251 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
6252 if (err != NANOS_OK)
6253 nanos_handle_error(err);
6254 }
6255 else
6256 {
6257 _nx_data_env_5_t imm_args;
6258 imm_args.__tmp_0_0 = __tmp_0;
6259 imm_args.__tmp_1_0 = __tmp_1;
6260 imm_args.__tmp_2_0 = __tmp_2;
6261 imm_args.__tmp_3_0 = __tmp_3;
6262 imm_args.__tmp_4_0 = __tmp_4;
6263 nanos_dependence_t _dependences[3] = {
6264 {
6265 (void **) &imm_args.__tmp_0_0,
6266 ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0),
6267 {
6268 1,
6269 0,
6270 1,
6271 0
6272 },
6273 sizeof(struct MBRecContext)
6274 },
6275 {
6276 (void **) &imm_args.__tmp_1_0,
6277 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
6278 {
6279 1,
6280 0,
6281 1,
6282 0
6283 },
6284 sizeof(SliceBufferEntry)
6285 },
6286 {
6287 (void **) &imm_args.__tmp_3_0,
6288 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
6289 {
6290 1,
6291 1,
6292 1,
6293 0
6294 },
6295 sizeof(struct SuperMBTask)
6296 }
6297 };
6298 dyn_props.priority = 0;
6299 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_5_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
6300 if (err != NANOS_OK)
6301 nanos_handle_error(err);
6302 }
6303 }
6304 ;
6305 }
6306 }
6307 return sm;
6308 }
6309 static void release_ref_list_task(H264Context *h, SuperMBContext *smbc, MBRecContext *d, SliceBufferEntry *sbe, SuperMBTask *lastsmb, int *release)
6310 {
6311 H264Slice *s = &sbe->slice;
6312 for (int i = 0;
6313 i < s->release_cnt;
6314 i++)
6315 {
6316 for (int j = 0;
6317 j < h->max_dpb_cnt;
6318 j++)
6319 {
6320 if (h->dpb[j].cpn == s->release_ref_cpn[i])
6321 {
6322 {
6323 nanos_set_lock(&_nx_u_dpb_critical_lock);
6324 release_dpb_entry(h, &h->dpb[j], 2);
6325 nanos_unset_lock(&_nx_u_dpb_critical_lock);
6326 }
6327 break;
6328 }
6329 }
6330 }
6331 s->release_cnt = 0;
6332 release_smbc(h, smbc);
6333 }
6334 static void output_task(H264Context *h, OutputContext *oc, SliceBufferEntry *sbe)
6335 {
6336 DecodedPicture *out = output_frame(h, oc, sbe->slice.curr_pic, h->ofile, h->frame_width, h->frame_height);
6337 if (out)
6338 {
6339 {
6340 nanos_set_lock(&_nx_u_dpb_critical_lock);
6341 release_dpb_entry(h, out, 1);
6342 nanos_unset_lock(&_nx_u_dpb_critical_lock);
6343 }
6344 }
6345 }
6346 typedef struct _nx_data_env_6_t_tag
6347 {
6348 struct H264Context *__tmp_0_0;
6349 struct ParserContext *__tmp_1_0;
6350 struct NalContext *__tmp_2_0;
6351 SliceBufferEntry *__tmp_3_0;
6352 } _nx_data_env_6_t;
6353 int h264_decode_ompss(H264Context *h);
6354 static void _smp__ol_h264_decode_ompss_6(_nx_data_env_6_t *const __restrict__ _args)
6355 {
6356 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6357 struct ParserContext *___tmp_1_0 = _args->__tmp_1_0;
6358 struct NalContext *___tmp_2_0 = _args->__tmp_2_0;
6359 SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0;
6360 /* Translation is done by the runtime */
6361 {
6362 parse_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0));
6363 }
6364 }
6365 typedef struct _nx_data_env_7_t_tag
6366 {
6367 struct H264Context *__tmp_0_0;
6368 struct EntropyContext *__tmp_1_0;
6369 SliceBufferEntry *__tmp_2_0;
6370 } _nx_data_env_7_t;
6371 int h264_decode_ompss(H264Context *h);
6372 static void _smp__ol_h264_decode_ompss_7(_nx_data_env_7_t *const __restrict__ _args)
6373 {
6374 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6375 struct EntropyContext *___tmp_1_0 = _args->__tmp_1_0;
6376 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6377 /* Translation is done by the runtime */
6378 {
6379 decode_slice_entropy_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6380 }
6381 }
6382 typedef struct _nx_data_env_8_t_tag
6383 {
6384 struct H264Context *__tmp_0_0;
6385 struct ParserContext *__tmp_1_0;
6386 struct NalContext *__tmp_2_0;
6387 SliceBufferEntry *__tmp_3_0;
6388 } _nx_data_env_8_t;
6389 int h264_decode_ompss(H264Context *h);
6390 static void _smp__ol_h264_decode_ompss_8(_nx_data_env_8_t *const __restrict__ _args)
6391 {
6392 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6393 struct ParserContext *___tmp_1_0 = _args->__tmp_1_0;
6394 struct NalContext *___tmp_2_0 = _args->__tmp_2_0;
6395 SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0;
6396 /* Translation is done by the runtime */
6397 {
6398 parse_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0));
6399 }
6400 }
6401 typedef struct _nx_data_env_9_t_tag
6402 {
6403 struct H264Context *__tmp_0_0;
6404 struct EntropyContext *__tmp_1_0;
6405 SliceBufferEntry *__tmp_2_0;
6406 } _nx_data_env_9_t;
6407 int h264_decode_ompss(H264Context *h);
6408 static void _smp__ol_h264_decode_ompss_9(_nx_data_env_9_t *const __restrict__ _args)
6409 {
6410 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6411 struct EntropyContext *___tmp_1_0 = _args->__tmp_1_0;
6412 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6413 /* Translation is done by the runtime */
6414 {
6415 decode_slice_entropy_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6416 }
6417 }
6418 typedef struct _nx_data_env_10_t_tag
6419 {
6420 struct H264Context *__tmp_0_0;
6421 struct MBRecContext *__tmp_1_0;
6422 SliceBufferEntry *__tmp_2_0;
6423 int *__tmp_3_0;
6424 } _nx_data_env_10_t;
6425 int h264_decode_ompss(H264Context *h);
6426 static void _smp__ol_h264_decode_ompss_10(_nx_data_env_10_t *const __restrict__ _args)
6427 {
6428 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6429 struct MBRecContext *___tmp_1_0 = _args->__tmp_1_0;
6430 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6431 int *___tmp_3_0 = _args->__tmp_3_0;
6432 /* Translation is done by the runtime */
6433 {
6434 init_ref_list_and_get_dpb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0));
6435 }
6436 }
6437 typedef struct _nx_data_env_11_t_tag
6438 {
6439 struct H264Context *__tmp_0_0;
6440 struct SuperMBContext *__tmp_1_0;
6441 struct MBRecContext *__tmp_2_0;
6442 SliceBufferEntry *__tmp_3_0;
6443 struct SuperMBTask *__tmp_4_0;
6444 int *__tmp_5_0;
6445 } _nx_data_env_11_t;
6446 int h264_decode_ompss(H264Context *h);
6447 static void _smp__ol_h264_decode_ompss_11(_nx_data_env_11_t *const __restrict__ _args)
6448 {
6449 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6450 struct SuperMBContext *___tmp_1_0 = _args->__tmp_1_0;
6451 struct MBRecContext *___tmp_2_0 = _args->__tmp_2_0;
6452 SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0;
6453 struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0;
6454 int *___tmp_5_0 = _args->__tmp_5_0;
6455 /* Translation is done by the runtime */
6456 {
6457 release_ref_list_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0));
6458 }
6459 }
6460 typedef struct _nx_data_env_12_t_tag
6461 {
6462 struct H264Context *__tmp_0_0;
6463 struct OutputContext *__tmp_1_0;
6464 SliceBufferEntry *__tmp_2_0;
6465 } _nx_data_env_12_t;
6466 int h264_decode_ompss(H264Context *h);
6467 static void _smp__ol_h264_decode_ompss_12(_nx_data_env_12_t *const __restrict__ _args)
6468 {
6469 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6470 struct OutputContext *___tmp_1_0 = _args->__tmp_1_0;
6471 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6472 /* Translation is done by the runtime */
6473 {
6474 output_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6475 }
6476 }
6477 typedef struct _nx_data_env_13_t_tag
6478 {
6479 struct H264Context *__tmp_0_0;
6480 struct MBRecContext *__tmp_1_0;
6481 SliceBufferEntry *__tmp_2_0;
6482 int *__tmp_3_0;
6483 } _nx_data_env_13_t;
6484 int h264_decode_ompss(H264Context *h);
6485 static void _smp__ol_h264_decode_ompss_13(_nx_data_env_13_t *const __restrict__ _args)
6486 {
6487 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6488 struct MBRecContext *___tmp_1_0 = _args->__tmp_1_0;
6489 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6490 int *___tmp_3_0 = _args->__tmp_3_0;
6491 /* Translation is done by the runtime */
6492 {
6493 init_ref_list_and_get_dpb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0));
6494 }
6495 }
6496 typedef struct _nx_data_env_14_t_tag
6497 {
6498 struct H264Context *__tmp_0_0;
6499 struct SuperMBContext *__tmp_1_0;
6500 struct MBRecContext *__tmp_2_0;
6501 SliceBufferEntry *__tmp_3_0;
6502 struct SuperMBTask *__tmp_4_0;
6503 int *__tmp_5_0;
6504 } _nx_data_env_14_t;
6505 int h264_decode_ompss(H264Context *h);
6506 static void _smp__ol_h264_decode_ompss_14(_nx_data_env_14_t *const __restrict__ _args)
6507 {
6508 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6509 struct SuperMBContext *___tmp_1_0 = _args->__tmp_1_0;
6510 struct MBRecContext *___tmp_2_0 = _args->__tmp_2_0;
6511 SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0;
6512 struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0;
6513 int *___tmp_5_0 = _args->__tmp_5_0;
6514 /* Translation is done by the runtime */
6515 {
6516 release_ref_list_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0));
6517 }
6518 }
6519 typedef struct _nx_data_env_15_t_tag
6520 {
6521 struct H264Context *__tmp_0_0;
6522 struct OutputContext *__tmp_1_0;
6523 SliceBufferEntry *__tmp_2_0;
6524 } _nx_data_env_15_t;
6525 int h264_decode_ompss(H264Context *h);
6526 static void _smp__ol_h264_decode_ompss_15(_nx_data_env_15_t *const __restrict__ _args)
6527 {
6528 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6529 struct OutputContext *___tmp_1_0 = _args->__tmp_1_0;
6530 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6531 /* Translation is done by the runtime */
6532 {
6533 output_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6534 }
6535 }
6536 typedef struct _nx_data_env_16_t_tag
6537 {
6538 struct H264Context *__tmp_0_0;
6539 struct ParserContext *__tmp_1_0;
6540 struct NalContext *__tmp_2_0;
6541 SliceBufferEntry *__tmp_3_0;
6542 } _nx_data_env_16_t;
6543 int h264_decode_ompss(H264Context *h);
6544 static void _smp__ol_h264_decode_ompss_16(_nx_data_env_16_t *const __restrict__ _args)
6545 {
6546 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6547 struct ParserContext *___tmp_1_0 = _args->__tmp_1_0;
6548 struct NalContext *___tmp_2_0 = _args->__tmp_2_0;
6549 SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0;
6550 /* Translation is done by the runtime */
6551 {
6552 parse_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0));
6553 }
6554 }
6555 typedef struct _nx_data_env_17_t_tag
6556 {
6557 struct H264Context *__tmp_0_0;
6558 struct EntropyContext *__tmp_1_0;
6559 SliceBufferEntry *__tmp_2_0;
6560 } _nx_data_env_17_t;
6561 int h264_decode_ompss(H264Context *h);
6562 static void _smp__ol_h264_decode_ompss_17(_nx_data_env_17_t *const __restrict__ _args)
6563 {
6564 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6565 struct EntropyContext *___tmp_1_0 = _args->__tmp_1_0;
6566 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6567 /* Translation is done by the runtime */
6568 {
6569 decode_slice_entropy_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6570 }
6571 }
6572 typedef struct _nx_data_env_18_t_tag
6573 {
6574 struct H264Context *__tmp_0_0;
6575 struct MBRecContext *__tmp_1_0;
6576 SliceBufferEntry *__tmp_2_0;
6577 } _nx_data_env_18_t;
6578 int h264_decode_ompss(H264Context *h);
6579 static void _smp__ol_h264_decode_ompss_18(_nx_data_env_18_t *const __restrict__ _args)
6580 {
6581 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6582 struct MBRecContext *___tmp_1_0 = _args->__tmp_1_0;
6583 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6584 /* Translation is done by the runtime */
6585 {
6586 decode_slice_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6587 }
6588 }
6589 typedef struct _nx_data_env_19_t_tag
6590 {
6591 struct H264Context *__tmp_0_0;
6592 struct OutputContext *__tmp_1_0;
6593 SliceBufferEntry *__tmp_2_0;
6594 } _nx_data_env_19_t;
6595 int h264_decode_ompss(H264Context *h);
6596 static void _smp__ol_h264_decode_ompss_19(_nx_data_env_19_t *const __restrict__ _args)
6597 {
6598 struct H264Context *___tmp_0_0 = _args->__tmp_0_0;
6599 struct OutputContext *___tmp_1_0 = _args->__tmp_1_0;
6600 SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0;
6601 /* Translation is done by the runtime */
6602 {
6603 output_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0));
6604 }
6605 }
6606 int h264_decode_ompss(H264Context *h)
6607 {
6608 const int bufs = h->pipe_bufs;
6609 ParserContext *pc;
6610 NalContext *nc;
6611 EntropyContext *ec[bufs];
6612 MBRecContext *rc[2];
6613 OutputContext *oc;
6614 SliceBufferEntry *sbe;
6615 SuperMBContext *smbc;
6616 DecodedPicture *out;
6617 int frames = 0;
6618 sbe = av_mallocz(sizeof(SliceBufferEntry) * bufs);
6619 pc = get_parse_context(h->ifile);
6620 nc = get_nal_context(h->width, h->height);
6621 for (int i = 0;
6622 i < bufs;
6623 i++)
6624 {
6625 ec[i] = get_entropy_context(h);
6626 }
6627 for (int i = 0;
6628 i < 2;
6629 i++)
6630 {
6631 rc[i] = get_mbrec_context(h);
6632 }
6633 oc = get_output_context(h);
6634 av_start_timer();
6635 int k = 0;
6636 int init, release;
6637 if (h->static_3d && bufs < h->num_frames)
6638 {
6639 int num_pre_ed = 0;
6640 for (num_pre_ed = 0;
6641 num_pre_ed < bufs - 1 && !pc->final_frame;
6642 num_pre_ed++)
6643 {
6644 {
6645 struct H264Context *__tmp_0 = h;
6646 struct ParserContext *__tmp_1 = pc;
6647 struct NalContext *__tmp_2 = nc;
6648 SliceBufferEntry *__tmp_3 = &sbe[k % bufs];
6649 {
6650 /* SMP device descriptor */
6651 static nanos_smp_args_t _ol_h264_decode_ompss_6_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_6};
6652 _nx_data_env_6_t *ol_args = (_nx_data_env_6_t *) 0;
6653 nanos_wd_t wd = (nanos_wd_t) 0;
6654 struct nanos_const_wd_definition_local_t
6655 {
6656 nanos_const_wd_definition_t base;
6657 nanos_device_t devices[1];
6658 };
6659 static struct nanos_const_wd_definition_local_t _const_def = {
6660 {
6661 {
6662 0,
6663 1,
6664 0,
6665 0,
6666 0,
6667 0,
6668 0,
6669 0
6670 },
6671 __alignof__(_nx_data_env_6_t),
6672 0,
6673 1
6674 },
6675 {{
6676 nanos_smp_factory,
6677 &_ol_h264_decode_ompss_6_smp_args
6678 }}
6679 };
6680 nanos_wd_dyn_props_t dyn_props = {0};
6681 nanos_err_t err;
6682 dyn_props.priority = 0;
6683 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_6_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
6684 if (err != NANOS_OK)
6685 nanos_handle_error(err);
6686 if (wd != (nanos_wd_t) 0)
6687 {
6688 ol_args->__tmp_0_0 = __tmp_0;
6689 ol_args->__tmp_1_0 = __tmp_1;
6690 ol_args->__tmp_2_0 = __tmp_2;
6691 ol_args->__tmp_3_0 = __tmp_3;
6692 nanos_dependence_t _dependences[3] = {
6693 {
6694 (void **) &ol_args->__tmp_3_0,
6695 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
6696 {
6697 0,
6698 1,
6699 1,
6700 0
6701 },
6702 sizeof(SliceBufferEntry)
6703 },
6704 {
6705 (void **) &ol_args->__tmp_1_0,
6706 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
6707 {
6708 1,
6709 1,
6710 1,
6711 0
6712 },
6713 sizeof(struct ParserContext)
6714 },
6715 {
6716 (void **) &ol_args->__tmp_2_0,
6717 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
6718 {
6719 1,
6720 1,
6721 1,
6722 0
6723 },
6724 sizeof(struct NalContext)
6725 }
6726 };
6727 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
6728 if (err != NANOS_OK)
6729 nanos_handle_error(err);
6730 }
6731 else
6732 {
6733 _nx_data_env_6_t imm_args;
6734 imm_args.__tmp_0_0 = __tmp_0;
6735 imm_args.__tmp_1_0 = __tmp_1;
6736 imm_args.__tmp_2_0 = __tmp_2;
6737 imm_args.__tmp_3_0 = __tmp_3;
6738 nanos_dependence_t _dependences[3] = {
6739 {
6740 (void **) &imm_args.__tmp_3_0,
6741 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
6742 {
6743 0,
6744 1,
6745 1,
6746 0
6747 },
6748 sizeof(SliceBufferEntry)
6749 },
6750 {
6751 (void **) &imm_args.__tmp_1_0,
6752 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
6753 {
6754 1,
6755 1,
6756 1,
6757 0
6758 },
6759 sizeof(struct ParserContext)
6760 },
6761 {
6762 (void **) &imm_args.__tmp_2_0,
6763 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
6764 {
6765 1,
6766 1,
6767 1,
6768 0
6769 },
6770 sizeof(struct NalContext)
6771 }
6772 };
6773 dyn_props.priority = 0;
6774 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_6_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
6775 if (err != NANOS_OK)
6776 nanos_handle_error(err);
6777 }
6778 }
6779 ;
6780 }
6781 {
6782 struct H264Context *__tmp_0 = h;
6783 struct EntropyContext *__tmp_1 = ec[k % bufs];
6784 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
6785 {
6786 /* SMP device descriptor */
6787 static nanos_smp_args_t _ol_h264_decode_ompss_7_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_7};
6788 _nx_data_env_7_t *ol_args = (_nx_data_env_7_t *) 0;
6789 nanos_wd_t wd = (nanos_wd_t) 0;
6790 struct nanos_const_wd_definition_local_t
6791 {
6792 nanos_const_wd_definition_t base;
6793 nanos_device_t devices[1];
6794 };
6795 static struct nanos_const_wd_definition_local_t _const_def = {
6796 {
6797 {
6798 0,
6799 1,
6800 0,
6801 0,
6802 0,
6803 0,
6804 0,
6805 0
6806 },
6807 __alignof__(_nx_data_env_7_t),
6808 0,
6809 1
6810 },
6811 {{
6812 nanos_smp_factory,
6813 &_ol_h264_decode_ompss_7_smp_args
6814 }}
6815 };
6816 nanos_wd_dyn_props_t dyn_props = {0};
6817 nanos_err_t err;
6818 dyn_props.priority = 0;
6819 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_7_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
6820 if (err != NANOS_OK)
6821 nanos_handle_error(err);
6822 if (wd != (nanos_wd_t) 0)
6823 {
6824 ol_args->__tmp_0_0 = __tmp_0;
6825 ol_args->__tmp_1_0 = __tmp_1;
6826 ol_args->__tmp_2_0 = __tmp_2;
6827 nanos_dependence_t _dependences[2] = {
6828 {
6829 (void **) &ol_args->__tmp_1_0,
6830 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
6831 {
6832 1,
6833 1,
6834 1,
6835 0
6836 },
6837 sizeof(struct EntropyContext)
6838 },
6839 {
6840 (void **) &ol_args->__tmp_2_0,
6841 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
6842 {
6843 1,
6844 1,
6845 1,
6846 0
6847 },
6848 sizeof(SliceBufferEntry)
6849 }
6850 };
6851 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
6852 if (err != NANOS_OK)
6853 nanos_handle_error(err);
6854 }
6855 else
6856 {
6857 _nx_data_env_7_t imm_args;
6858 imm_args.__tmp_0_0 = __tmp_0;
6859 imm_args.__tmp_1_0 = __tmp_1;
6860 imm_args.__tmp_2_0 = __tmp_2;
6861 nanos_dependence_t _dependences[2] = {
6862 {
6863 (void **) &imm_args.__tmp_1_0,
6864 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
6865 {
6866 1,
6867 1,
6868 1,
6869 0
6870 },
6871 sizeof(struct EntropyContext)
6872 },
6873 {
6874 (void **) &imm_args.__tmp_2_0,
6875 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
6876 {
6877 1,
6878 1,
6879 1,
6880 0
6881 },
6882 sizeof(SliceBufferEntry)
6883 }
6884 };
6885 dyn_props.priority = 0;
6886 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_7_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
6887 if (err != NANOS_OK)
6888 nanos_handle_error(err);
6889 }
6890 }
6891 ;
6892 }
6893 {
6894 struct _dependence_holder
6895 {
6896 struct ParserContext *dep_0;
6897 } _dep_holder = {&(*pc)};
6898 nanos_dependence_t _wait_dependences[1] = {{
6899 (void **) &_dep_holder.dep_0,
6900 ((char *) ((pc)) - (char *) _dep_holder.dep_0),
6901 {
6902 1,
6903 0,
6904 0,
6905 0
6906 },
6907 sizeof (*pc)
6908 }};
6909 nanos_wait_on(1, _wait_dependences);
6910 }
6911 k++;
6912 }
6913 while (!pc->final_frame && frames++ < h->num_frames && !h->quit)
6914 {
6915 {
6916 struct H264Context *__tmp_0 = h;
6917 struct ParserContext *__tmp_1 = pc;
6918 struct NalContext *__tmp_2 = nc;
6919 SliceBufferEntry *__tmp_3 = &sbe[k % bufs];
6920 {
6921 /* SMP device descriptor */
6922 static nanos_smp_args_t _ol_h264_decode_ompss_8_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_8};
6923 _nx_data_env_8_t *ol_args = (_nx_data_env_8_t *) 0;
6924 nanos_wd_t wd = (nanos_wd_t) 0;
6925 struct nanos_const_wd_definition_local_t
6926 {
6927 nanos_const_wd_definition_t base;
6928 nanos_device_t devices[1];
6929 };
6930 static struct nanos_const_wd_definition_local_t _const_def = {
6931 {
6932 {
6933 0,
6934 1,
6935 0,
6936 0,
6937 0,
6938 0,
6939 0,
6940 0
6941 },
6942 __alignof__(_nx_data_env_8_t),
6943 0,
6944 1
6945 },
6946 {{
6947 nanos_smp_factory,
6948 &_ol_h264_decode_ompss_8_smp_args
6949 }}
6950 };
6951 nanos_wd_dyn_props_t dyn_props = {0};
6952 nanos_err_t err;
6953 dyn_props.priority = 0;
6954 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_8_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
6955 if (err != NANOS_OK)
6956 nanos_handle_error(err);
6957 if (wd != (nanos_wd_t) 0)
6958 {
6959 ol_args->__tmp_0_0 = __tmp_0;
6960 ol_args->__tmp_1_0 = __tmp_1;
6961 ol_args->__tmp_2_0 = __tmp_2;
6962 ol_args->__tmp_3_0 = __tmp_3;
6963 nanos_dependence_t _dependences[3] = {
6964 {
6965 (void **) &ol_args->__tmp_3_0,
6966 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
6967 {
6968 0,
6969 1,
6970 1,
6971 0
6972 },
6973 sizeof(SliceBufferEntry)
6974 },
6975 {
6976 (void **) &ol_args->__tmp_1_0,
6977 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
6978 {
6979 1,
6980 1,
6981 1,
6982 0
6983 },
6984 sizeof(struct ParserContext)
6985 },
6986 {
6987 (void **) &ol_args->__tmp_2_0,
6988 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
6989 {
6990 1,
6991 1,
6992 1,
6993 0
6994 },
6995 sizeof(struct NalContext)
6996 }
6997 };
6998 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
6999 if (err != NANOS_OK)
7000 nanos_handle_error(err);
7001 }
7002 else
7003 {
7004 _nx_data_env_8_t imm_args;
7005 imm_args.__tmp_0_0 = __tmp_0;
7006 imm_args.__tmp_1_0 = __tmp_1;
7007 imm_args.__tmp_2_0 = __tmp_2;
7008 imm_args.__tmp_3_0 = __tmp_3;
7009 nanos_dependence_t _dependences[3] = {
7010 {
7011 (void **) &imm_args.__tmp_3_0,
7012 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
7013 {
7014 0,
7015 1,
7016 1,
7017 0
7018 },
7019 sizeof(SliceBufferEntry)
7020 },
7021 {
7022 (void **) &imm_args.__tmp_1_0,
7023 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
7024 {
7025 1,
7026 1,
7027 1,
7028 0
7029 },
7030 sizeof(struct ParserContext)
7031 },
7032 {
7033 (void **) &imm_args.__tmp_2_0,
7034 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7035 {
7036 1,
7037 1,
7038 1,
7039 0
7040 },
7041 sizeof(struct NalContext)
7042 }
7043 };
7044 dyn_props.priority = 0;
7045 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_8_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7046 if (err != NANOS_OK)
7047 nanos_handle_error(err);
7048 }
7049 }
7050 ;
7051 }
7052 {
7053 struct H264Context *__tmp_0 = h;
7054 struct EntropyContext *__tmp_1 = ec[k % bufs];
7055 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
7056 {
7057 /* SMP device descriptor */
7058 static nanos_smp_args_t _ol_h264_decode_ompss_9_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_9};
7059 _nx_data_env_9_t *ol_args = (_nx_data_env_9_t *) 0;
7060 nanos_wd_t wd = (nanos_wd_t) 0;
7061 struct nanos_const_wd_definition_local_t
7062 {
7063 nanos_const_wd_definition_t base;
7064 nanos_device_t devices[1];
7065 };
7066 static struct nanos_const_wd_definition_local_t _const_def = {
7067 {
7068 {
7069 0,
7070 1,
7071 0,
7072 0,
7073 0,
7074 0,
7075 0,
7076 0
7077 },
7078 __alignof__(_nx_data_env_9_t),
7079 0,
7080 1
7081 },
7082 {{
7083 nanos_smp_factory,
7084 &_ol_h264_decode_ompss_9_smp_args
7085 }}
7086 };
7087 nanos_wd_dyn_props_t dyn_props = {0};
7088 nanos_err_t err;
7089 dyn_props.priority = 0;
7090 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_9_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7091 if (err != NANOS_OK)
7092 nanos_handle_error(err);
7093 if (wd != (nanos_wd_t) 0)
7094 {
7095 ol_args->__tmp_0_0 = __tmp_0;
7096 ol_args->__tmp_1_0 = __tmp_1;
7097 ol_args->__tmp_2_0 = __tmp_2;
7098 nanos_dependence_t _dependences[2] = {
7099 {
7100 (void **) &ol_args->__tmp_1_0,
7101 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
7102 {
7103 1,
7104 1,
7105 1,
7106 0
7107 },
7108 sizeof(struct EntropyContext)
7109 },
7110 {
7111 (void **) &ol_args->__tmp_2_0,
7112 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7113 {
7114 1,
7115 1,
7116 1,
7117 0
7118 },
7119 sizeof(SliceBufferEntry)
7120 }
7121 };
7122 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7123 if (err != NANOS_OK)
7124 nanos_handle_error(err);
7125 }
7126 else
7127 {
7128 _nx_data_env_9_t imm_args;
7129 imm_args.__tmp_0_0 = __tmp_0;
7130 imm_args.__tmp_1_0 = __tmp_1;
7131 imm_args.__tmp_2_0 = __tmp_2;
7132 nanos_dependence_t _dependences[2] = {
7133 {
7134 (void **) &imm_args.__tmp_1_0,
7135 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
7136 {
7137 1,
7138 1,
7139 1,
7140 0
7141 },
7142 sizeof(struct EntropyContext)
7143 },
7144 {
7145 (void **) &imm_args.__tmp_2_0,
7146 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7147 {
7148 1,
7149 1,
7150 1,
7151 0
7152 },
7153 sizeof(SliceBufferEntry)
7154 }
7155 };
7156 dyn_props.priority = 0;
7157 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_9_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7158 if (err != NANOS_OK)
7159 nanos_handle_error(err);
7160 }
7161 }
7162 ;
7163 }
7164 k++;
7165 {
7166 struct H264Context *__tmp_0 = h;
7167 struct MBRecContext *__tmp_1 = rc[k % 2];
7168 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
7169 int *__tmp_3 = &init;
7170 {
7171 /* SMP device descriptor */
7172 static nanos_smp_args_t _ol_h264_decode_ompss_10_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_10};
7173 _nx_data_env_10_t *ol_args = (_nx_data_env_10_t *) 0;
7174 nanos_wd_t wd = (nanos_wd_t) 0;
7175 struct nanos_const_wd_definition_local_t
7176 {
7177 nanos_const_wd_definition_t base;
7178 nanos_device_t devices[1];
7179 };
7180 static struct nanos_const_wd_definition_local_t _const_def = {
7181 {
7182 {
7183 0,
7184 1,
7185 0,
7186 0,
7187 0,
7188 0,
7189 0,
7190 0
7191 },
7192 __alignof__(_nx_data_env_10_t),
7193 0,
7194 1
7195 },
7196 {{
7197 nanos_smp_factory,
7198 &_ol_h264_decode_ompss_10_smp_args
7199 }}
7200 };
7201 nanos_wd_dyn_props_t dyn_props = {0};
7202 nanos_err_t err;
7203 dyn_props.priority = 0;
7204 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_10_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7205 if (err != NANOS_OK)
7206 nanos_handle_error(err);
7207 if (wd != (nanos_wd_t) 0)
7208 {
7209 ol_args->__tmp_0_0 = __tmp_0;
7210 ol_args->__tmp_1_0 = __tmp_1;
7211 ol_args->__tmp_2_0 = __tmp_2;
7212 ol_args->__tmp_3_0 = __tmp_3;
7213 nanos_dependence_t _dependences[3] = {
7214 {
7215 (void **) &ol_args->__tmp_1_0,
7216 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
7217 {
7218 1,
7219 1,
7220 1,
7221 0
7222 },
7223 sizeof(struct MBRecContext)
7224 },
7225 {
7226 (void **) &ol_args->__tmp_2_0,
7227 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7228 {
7229 1,
7230 1,
7231 1,
7232 0
7233 },
7234 sizeof(SliceBufferEntry)
7235 },
7236 {
7237 (void **) &ol_args->__tmp_3_0,
7238 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
7239 {
7240 1,
7241 1,
7242 1,
7243 0
7244 },
7245 sizeof(int)
7246 }
7247 };
7248 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7249 if (err != NANOS_OK)
7250 nanos_handle_error(err);
7251 }
7252 else
7253 {
7254 _nx_data_env_10_t imm_args;
7255 imm_args.__tmp_0_0 = __tmp_0;
7256 imm_args.__tmp_1_0 = __tmp_1;
7257 imm_args.__tmp_2_0 = __tmp_2;
7258 imm_args.__tmp_3_0 = __tmp_3;
7259 nanos_dependence_t _dependences[3] = {
7260 {
7261 (void **) &imm_args.__tmp_1_0,
7262 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
7263 {
7264 1,
7265 1,
7266 1,
7267 0
7268 },
7269 sizeof(struct MBRecContext)
7270 },
7271 {
7272 (void **) &imm_args.__tmp_2_0,
7273 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7274 {
7275 1,
7276 1,
7277 1,
7278 0
7279 },
7280 sizeof(SliceBufferEntry)
7281 },
7282 {
7283 (void **) &imm_args.__tmp_3_0,
7284 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
7285 {
7286 1,
7287 1,
7288 1,
7289 0
7290 },
7291 sizeof(int)
7292 }
7293 };
7294 dyn_props.priority = 0;
7295 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_10_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7296 if (err != NANOS_OK)
7297 nanos_handle_error(err);
7298 }
7299 }
7300 ;
7301 }
7302 smbc = acquire_smbc(h);
7303 SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc);
7304 {
7305 struct H264Context *__tmp_0 = h;
7306 struct SuperMBContext *__tmp_1 = smbc;
7307 struct MBRecContext *__tmp_2 = rc[k % 2];
7308 SliceBufferEntry *__tmp_3 = &sbe[k % bufs];
7309 struct SuperMBTask *__tmp_4 = lastsmb;
7310 int *__tmp_5 = &release;
7311 {
7312 /* SMP device descriptor */
7313 static nanos_smp_args_t _ol_h264_decode_ompss_11_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_11};
7314 _nx_data_env_11_t *ol_args = (_nx_data_env_11_t *) 0;
7315 nanos_wd_t wd = (nanos_wd_t) 0;
7316 struct nanos_const_wd_definition_local_t
7317 {
7318 nanos_const_wd_definition_t base;
7319 nanos_device_t devices[1];
7320 };
7321 static struct nanos_const_wd_definition_local_t _const_def = {
7322 {
7323 {
7324 0,
7325 1,
7326 0,
7327 0,
7328 0,
7329 0,
7330 0,
7331 0
7332 },
7333 __alignof__(_nx_data_env_11_t),
7334 0,
7335 1
7336 },
7337 {{
7338 nanos_smp_factory,
7339 &_ol_h264_decode_ompss_11_smp_args
7340 }}
7341 };
7342 nanos_wd_dyn_props_t dyn_props = {0};
7343 nanos_err_t err;
7344 dyn_props.priority = 0;
7345 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_11_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7346 if (err != NANOS_OK)
7347 nanos_handle_error(err);
7348 if (wd != (nanos_wd_t) 0)
7349 {
7350 ol_args->__tmp_0_0 = __tmp_0;
7351 ol_args->__tmp_1_0 = __tmp_1;
7352 ol_args->__tmp_2_0 = __tmp_2;
7353 ol_args->__tmp_3_0 = __tmp_3;
7354 ol_args->__tmp_4_0 = __tmp_4;
7355 ol_args->__tmp_5_0 = __tmp_5;
7356 nanos_dependence_t _dependences[4] = {
7357 {
7358 (void **) &ol_args->__tmp_4_0,
7359 ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0),
7360 {
7361 1,
7362 0,
7363 1,
7364 0
7365 },
7366 sizeof(struct SuperMBTask)
7367 },
7368 {
7369 (void **) &ol_args->__tmp_2_0,
7370 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7371 {
7372 1,
7373 1,
7374 1,
7375 0
7376 },
7377 sizeof(struct MBRecContext)
7378 },
7379 {
7380 (void **) &ol_args->__tmp_3_0,
7381 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
7382 {
7383 1,
7384 1,
7385 1,
7386 0
7387 },
7388 sizeof(SliceBufferEntry)
7389 },
7390 {
7391 (void **) &ol_args->__tmp_5_0,
7392 ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0),
7393 {
7394 1,
7395 1,
7396 1,
7397 0
7398 },
7399 sizeof(int)
7400 }
7401 };
7402 err = nanos_submit(wd, 4, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7403 if (err != NANOS_OK)
7404 nanos_handle_error(err);
7405 }
7406 else
7407 {
7408 _nx_data_env_11_t imm_args;
7409 imm_args.__tmp_0_0 = __tmp_0;
7410 imm_args.__tmp_1_0 = __tmp_1;
7411 imm_args.__tmp_2_0 = __tmp_2;
7412 imm_args.__tmp_3_0 = __tmp_3;
7413 imm_args.__tmp_4_0 = __tmp_4;
7414 imm_args.__tmp_5_0 = __tmp_5;
7415 nanos_dependence_t _dependences[4] = {
7416 {
7417 (void **) &imm_args.__tmp_4_0,
7418 ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0),
7419 {
7420 1,
7421 0,
7422 1,
7423 0
7424 },
7425 sizeof(struct SuperMBTask)
7426 },
7427 {
7428 (void **) &imm_args.__tmp_2_0,
7429 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7430 {
7431 1,
7432 1,
7433 1,
7434 0
7435 },
7436 sizeof(struct MBRecContext)
7437 },
7438 {
7439 (void **) &imm_args.__tmp_3_0,
7440 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
7441 {
7442 1,
7443 1,
7444 1,
7445 0
7446 },
7447 sizeof(SliceBufferEntry)
7448 },
7449 {
7450 (void **) &imm_args.__tmp_5_0,
7451 ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0),
7452 {
7453 1,
7454 1,
7455 1,
7456 0
7457 },
7458 sizeof(int)
7459 }
7460 };
7461 dyn_props.priority = 0;
7462 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_11_t), &imm_args, 4, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7463 if (err != NANOS_OK)
7464 nanos_handle_error(err);
7465 }
7466 }
7467 ;
7468 }
7469 {
7470 struct H264Context *__tmp_0 = h;
7471 struct OutputContext *__tmp_1 = oc;
7472 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
7473 {
7474 /* SMP device descriptor */
7475 static nanos_smp_args_t _ol_h264_decode_ompss_12_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_12};
7476 _nx_data_env_12_t *ol_args = (_nx_data_env_12_t *) 0;
7477 nanos_wd_t wd = (nanos_wd_t) 0;
7478 struct nanos_const_wd_definition_local_t
7479 {
7480 nanos_const_wd_definition_t base;
7481 nanos_device_t devices[1];
7482 };
7483 static struct nanos_const_wd_definition_local_t _const_def = {
7484 {
7485 {
7486 0,
7487 1,
7488 0,
7489 0,
7490 0,
7491 0,
7492 0,
7493 0
7494 },
7495 __alignof__(_nx_data_env_12_t),
7496 0,
7497 1
7498 },
7499 {{
7500 nanos_smp_factory,
7501 &_ol_h264_decode_ompss_12_smp_args
7502 }}
7503 };
7504 nanos_wd_dyn_props_t dyn_props = {0};
7505 nanos_err_t err;
7506 dyn_props.priority = 0;
7507 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_12_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7508 if (err != NANOS_OK)
7509 nanos_handle_error(err);
7510 if (wd != (nanos_wd_t) 0)
7511 {
7512 ol_args->__tmp_0_0 = __tmp_0;
7513 ol_args->__tmp_1_0 = __tmp_1;
7514 ol_args->__tmp_2_0 = __tmp_2;
7515 nanos_dependence_t _dependences[2] = {
7516 {
7517 (void **) &ol_args->__tmp_2_0,
7518 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7519 {
7520 1,
7521 0,
7522 1,
7523 0
7524 },
7525 sizeof(SliceBufferEntry)
7526 },
7527 {
7528 (void **) &ol_args->__tmp_1_0,
7529 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
7530 {
7531 1,
7532 1,
7533 1,
7534 0
7535 },
7536 sizeof(struct OutputContext)
7537 }
7538 };
7539 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7540 if (err != NANOS_OK)
7541 nanos_handle_error(err);
7542 }
7543 else
7544 {
7545 _nx_data_env_12_t imm_args;
7546 imm_args.__tmp_0_0 = __tmp_0;
7547 imm_args.__tmp_1_0 = __tmp_1;
7548 imm_args.__tmp_2_0 = __tmp_2;
7549 nanos_dependence_t _dependences[2] = {
7550 {
7551 (void **) &imm_args.__tmp_2_0,
7552 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7553 {
7554 1,
7555 0,
7556 1,
7557 0
7558 },
7559 sizeof(SliceBufferEntry)
7560 },
7561 {
7562 (void **) &imm_args.__tmp_1_0,
7563 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
7564 {
7565 1,
7566 1,
7567 1,
7568 0
7569 },
7570 sizeof(struct OutputContext)
7571 }
7572 };
7573 dyn_props.priority = 0;
7574 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_12_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7575 if (err != NANOS_OK)
7576 nanos_handle_error(err);
7577 }
7578 }
7579 ;
7580 }
7581 {
7582 struct _dependence_holder
7583 {
7584 struct ParserContext *dep_0;
7585 } _dep_holder = {&(*pc)};
7586 nanos_dependence_t _wait_dependences[1] = {{
7587 (void **) &_dep_holder.dep_0,
7588 ((char *) ((pc)) - (char *) _dep_holder.dep_0),
7589 {
7590 1,
7591 0,
7592 0,
7593 0
7594 },
7595 sizeof (*pc)
7596 }};
7597 nanos_wait_on(1, _wait_dependences);
7598 }
7599 }
7600 for (int i = 0;
7601 i < num_pre_ed;
7602 i++)
7603 {
7604 k++;
7605 {
7606 struct H264Context *__tmp_0 = h;
7607 struct MBRecContext *__tmp_1 = rc[k % 2];
7608 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
7609 int *__tmp_3 = &init;
7610 {
7611 /* SMP device descriptor */
7612 static nanos_smp_args_t _ol_h264_decode_ompss_13_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_13};
7613 _nx_data_env_13_t *ol_args = (_nx_data_env_13_t *) 0;
7614 nanos_wd_t wd = (nanos_wd_t) 0;
7615 struct nanos_const_wd_definition_local_t
7616 {
7617 nanos_const_wd_definition_t base;
7618 nanos_device_t devices[1];
7619 };
7620 static struct nanos_const_wd_definition_local_t _const_def = {
7621 {
7622 {
7623 0,
7624 1,
7625 0,
7626 0,
7627 0,
7628 0,
7629 0,
7630 0
7631 },
7632 __alignof__(_nx_data_env_13_t),
7633 0,
7634 1
7635 },
7636 {{
7637 nanos_smp_factory,
7638 &_ol_h264_decode_ompss_13_smp_args
7639 }}
7640 };
7641 nanos_wd_dyn_props_t dyn_props = {0};
7642 nanos_err_t err;
7643 dyn_props.priority = 0;
7644 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_13_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7645 if (err != NANOS_OK)
7646 nanos_handle_error(err);
7647 if (wd != (nanos_wd_t) 0)
7648 {
7649 ol_args->__tmp_0_0 = __tmp_0;
7650 ol_args->__tmp_1_0 = __tmp_1;
7651 ol_args->__tmp_2_0 = __tmp_2;
7652 ol_args->__tmp_3_0 = __tmp_3;
7653 nanos_dependence_t _dependences[3] = {
7654 {
7655 (void **) &ol_args->__tmp_1_0,
7656 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
7657 {
7658 1,
7659 1,
7660 1,
7661 0
7662 },
7663 sizeof(struct MBRecContext)
7664 },
7665 {
7666 (void **) &ol_args->__tmp_2_0,
7667 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7668 {
7669 1,
7670 1,
7671 1,
7672 0
7673 },
7674 sizeof(SliceBufferEntry)
7675 },
7676 {
7677 (void **) &ol_args->__tmp_3_0,
7678 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
7679 {
7680 1,
7681 1,
7682 1,
7683 0
7684 },
7685 sizeof(int)
7686 }
7687 };
7688 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7689 if (err != NANOS_OK)
7690 nanos_handle_error(err);
7691 }
7692 else
7693 {
7694 _nx_data_env_13_t imm_args;
7695 imm_args.__tmp_0_0 = __tmp_0;
7696 imm_args.__tmp_1_0 = __tmp_1;
7697 imm_args.__tmp_2_0 = __tmp_2;
7698 imm_args.__tmp_3_0 = __tmp_3;
7699 nanos_dependence_t _dependences[3] = {
7700 {
7701 (void **) &imm_args.__tmp_1_0,
7702 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
7703 {
7704 1,
7705 1,
7706 1,
7707 0
7708 },
7709 sizeof(struct MBRecContext)
7710 },
7711 {
7712 (void **) &imm_args.__tmp_2_0,
7713 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7714 {
7715 1,
7716 1,
7717 1,
7718 0
7719 },
7720 sizeof(SliceBufferEntry)
7721 },
7722 {
7723 (void **) &imm_args.__tmp_3_0,
7724 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
7725 {
7726 1,
7727 1,
7728 1,
7729 0
7730 },
7731 sizeof(int)
7732 }
7733 };
7734 dyn_props.priority = 0;
7735 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_13_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7736 if (err != NANOS_OK)
7737 nanos_handle_error(err);
7738 }
7739 }
7740 ;
7741 }
7742 smbc = acquire_smbc(h);
7743 SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc);
7744 {
7745 struct H264Context *__tmp_0 = h;
7746 struct SuperMBContext *__tmp_1 = smbc;
7747 struct MBRecContext *__tmp_2 = rc[k % 2];
7748 SliceBufferEntry *__tmp_3 = &sbe[k % bufs];
7749 struct SuperMBTask *__tmp_4 = lastsmb;
7750 int *__tmp_5 = &release;
7751 {
7752 /* SMP device descriptor */
7753 static nanos_smp_args_t _ol_h264_decode_ompss_14_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_14};
7754 _nx_data_env_14_t *ol_args = (_nx_data_env_14_t *) 0;
7755 nanos_wd_t wd = (nanos_wd_t) 0;
7756 struct nanos_const_wd_definition_local_t
7757 {
7758 nanos_const_wd_definition_t base;
7759 nanos_device_t devices[1];
7760 };
7761 static struct nanos_const_wd_definition_local_t _const_def = {
7762 {
7763 {
7764 0,
7765 1,
7766 0,
7767 0,
7768 0,
7769 0,
7770 0,
7771 0
7772 },
7773 __alignof__(_nx_data_env_14_t),
7774 0,
7775 1
7776 },
7777 {{
7778 nanos_smp_factory,
7779 &_ol_h264_decode_ompss_14_smp_args
7780 }}
7781 };
7782 nanos_wd_dyn_props_t dyn_props = {0};
7783 nanos_err_t err;
7784 dyn_props.priority = 0;
7785 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_14_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7786 if (err != NANOS_OK)
7787 nanos_handle_error(err);
7788 if (wd != (nanos_wd_t) 0)
7789 {
7790 ol_args->__tmp_0_0 = __tmp_0;
7791 ol_args->__tmp_1_0 = __tmp_1;
7792 ol_args->__tmp_2_0 = __tmp_2;
7793 ol_args->__tmp_3_0 = __tmp_3;
7794 ol_args->__tmp_4_0 = __tmp_4;
7795 ol_args->__tmp_5_0 = __tmp_5;
7796 nanos_dependence_t _dependences[4] = {
7797 {
7798 (void **) &ol_args->__tmp_4_0,
7799 ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0),
7800 {
7801 1,
7802 0,
7803 1,
7804 0
7805 },
7806 sizeof(struct SuperMBTask)
7807 },
7808 {
7809 (void **) &ol_args->__tmp_2_0,
7810 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7811 {
7812 1,
7813 1,
7814 1,
7815 0
7816 },
7817 sizeof(struct MBRecContext)
7818 },
7819 {
7820 (void **) &ol_args->__tmp_3_0,
7821 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
7822 {
7823 1,
7824 1,
7825 1,
7826 0
7827 },
7828 sizeof(SliceBufferEntry)
7829 },
7830 {
7831 (void **) &ol_args->__tmp_5_0,
7832 ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0),
7833 {
7834 1,
7835 1,
7836 1,
7837 0
7838 },
7839 sizeof(int)
7840 }
7841 };
7842 err = nanos_submit(wd, 4, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7843 if (err != NANOS_OK)
7844 nanos_handle_error(err);
7845 }
7846 else
7847 {
7848 _nx_data_env_14_t imm_args;
7849 imm_args.__tmp_0_0 = __tmp_0;
7850 imm_args.__tmp_1_0 = __tmp_1;
7851 imm_args.__tmp_2_0 = __tmp_2;
7852 imm_args.__tmp_3_0 = __tmp_3;
7853 imm_args.__tmp_4_0 = __tmp_4;
7854 imm_args.__tmp_5_0 = __tmp_5;
7855 nanos_dependence_t _dependences[4] = {
7856 {
7857 (void **) &imm_args.__tmp_4_0,
7858 ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0),
7859 {
7860 1,
7861 0,
7862 1,
7863 0
7864 },
7865 sizeof(struct SuperMBTask)
7866 },
7867 {
7868 (void **) &imm_args.__tmp_2_0,
7869 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7870 {
7871 1,
7872 1,
7873 1,
7874 0
7875 },
7876 sizeof(struct MBRecContext)
7877 },
7878 {
7879 (void **) &imm_args.__tmp_3_0,
7880 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
7881 {
7882 1,
7883 1,
7884 1,
7885 0
7886 },
7887 sizeof(SliceBufferEntry)
7888 },
7889 {
7890 (void **) &imm_args.__tmp_5_0,
7891 ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0),
7892 {
7893 1,
7894 1,
7895 1,
7896 0
7897 },
7898 sizeof(int)
7899 }
7900 };
7901 dyn_props.priority = 0;
7902 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_14_t), &imm_args, 4, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
7903 if (err != NANOS_OK)
7904 nanos_handle_error(err);
7905 }
7906 }
7907 ;
7908 }
7909 {
7910 struct H264Context *__tmp_0 = h;
7911 struct OutputContext *__tmp_1 = oc;
7912 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
7913 {
7914 /* SMP device descriptor */
7915 static nanos_smp_args_t _ol_h264_decode_ompss_15_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_15};
7916 _nx_data_env_15_t *ol_args = (_nx_data_env_15_t *) 0;
7917 nanos_wd_t wd = (nanos_wd_t) 0;
7918 struct nanos_const_wd_definition_local_t
7919 {
7920 nanos_const_wd_definition_t base;
7921 nanos_device_t devices[1];
7922 };
7923 static struct nanos_const_wd_definition_local_t _const_def = {
7924 {
7925 {
7926 0,
7927 1,
7928 0,
7929 0,
7930 0,
7931 0,
7932 0,
7933 0
7934 },
7935 __alignof__(_nx_data_env_15_t),
7936 0,
7937 1
7938 },
7939 {{
7940 nanos_smp_factory,
7941 &_ol_h264_decode_ompss_15_smp_args
7942 }}
7943 };
7944 nanos_wd_dyn_props_t dyn_props = {0};
7945 nanos_err_t err;
7946 dyn_props.priority = 0;
7947 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_15_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
7948 if (err != NANOS_OK)
7949 nanos_handle_error(err);
7950 if (wd != (nanos_wd_t) 0)
7951 {
7952 ol_args->__tmp_0_0 = __tmp_0;
7953 ol_args->__tmp_1_0 = __tmp_1;
7954 ol_args->__tmp_2_0 = __tmp_2;
7955 nanos_dependence_t _dependences[2] = {
7956 {
7957 (void **) &ol_args->__tmp_2_0,
7958 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
7959 {
7960 1,
7961 0,
7962 1,
7963 0
7964 },
7965 sizeof(SliceBufferEntry)
7966 },
7967 {
7968 (void **) &ol_args->__tmp_1_0,
7969 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
7970 {
7971 1,
7972 1,
7973 1,
7974 0
7975 },
7976 sizeof(struct OutputContext)
7977 }
7978 };
7979 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
7980 if (err != NANOS_OK)
7981 nanos_handle_error(err);
7982 }
7983 else
7984 {
7985 _nx_data_env_15_t imm_args;
7986 imm_args.__tmp_0_0 = __tmp_0;
7987 imm_args.__tmp_1_0 = __tmp_1;
7988 imm_args.__tmp_2_0 = __tmp_2;
7989 nanos_dependence_t _dependences[2] = {
7990 {
7991 (void **) &imm_args.__tmp_2_0,
7992 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
7993 {
7994 1,
7995 0,
7996 1,
7997 0
7998 },
7999 sizeof(SliceBufferEntry)
8000 },
8001 {
8002 (void **) &imm_args.__tmp_1_0,
8003 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
8004 {
8005 1,
8006 1,
8007 1,
8008 0
8009 },
8010 sizeof(struct OutputContext)
8011 }
8012 };
8013 dyn_props.priority = 0;
8014 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_15_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
8015 if (err != NANOS_OK)
8016 nanos_handle_error(err);
8017 }
8018 }
8019 ;
8020 }
8021 }
8022 }
8023 else
8024 {
8025 while (!pc->final_frame && frames++ < h->num_frames && !h->quit)
8026 {
8027 {
8028 struct H264Context *__tmp_0 = h;
8029 struct ParserContext *__tmp_1 = pc;
8030 struct NalContext *__tmp_2 = nc;
8031 SliceBufferEntry *__tmp_3 = &sbe[k % bufs];
8032 {
8033 /* SMP device descriptor */
8034 static nanos_smp_args_t _ol_h264_decode_ompss_16_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_16};
8035 _nx_data_env_16_t *ol_args = (_nx_data_env_16_t *) 0;
8036 nanos_wd_t wd = (nanos_wd_t) 0;
8037 struct nanos_const_wd_definition_local_t
8038 {
8039 nanos_const_wd_definition_t base;
8040 nanos_device_t devices[1];
8041 };
8042 static struct nanos_const_wd_definition_local_t _const_def = {
8043 {
8044 {
8045 0,
8046 1,
8047 0,
8048 0,
8049 0,
8050 0,
8051 0,
8052 0
8053 },
8054 __alignof__(_nx_data_env_16_t),
8055 0,
8056 1
8057 },
8058 {{
8059 nanos_smp_factory,
8060 &_ol_h264_decode_ompss_16_smp_args
8061 }}
8062 };
8063 nanos_wd_dyn_props_t dyn_props = {0};
8064 nanos_err_t err;
8065 dyn_props.priority = 0;
8066 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_16_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
8067 if (err != NANOS_OK)
8068 nanos_handle_error(err);
8069 if (wd != (nanos_wd_t) 0)
8070 {
8071 ol_args->__tmp_0_0 = __tmp_0;
8072 ol_args->__tmp_1_0 = __tmp_1;
8073 ol_args->__tmp_2_0 = __tmp_2;
8074 ol_args->__tmp_3_0 = __tmp_3;
8075 nanos_dependence_t _dependences[3] = {
8076 {
8077 (void **) &ol_args->__tmp_3_0,
8078 ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0),
8079 {
8080 0,
8081 1,
8082 1,
8083 0
8084 },
8085 sizeof(SliceBufferEntry)
8086 },
8087 {
8088 (void **) &ol_args->__tmp_1_0,
8089 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
8090 {
8091 1,
8092 1,
8093 1,
8094 0
8095 },
8096 sizeof(struct ParserContext)
8097 },
8098 {
8099 (void **) &ol_args->__tmp_2_0,
8100 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
8101 {
8102 1,
8103 1,
8104 1,
8105 0
8106 },
8107 sizeof(struct NalContext)
8108 }
8109 };
8110 err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
8111 if (err != NANOS_OK)
8112 nanos_handle_error(err);
8113 }
8114 else
8115 {
8116 _nx_data_env_16_t imm_args;
8117 imm_args.__tmp_0_0 = __tmp_0;
8118 imm_args.__tmp_1_0 = __tmp_1;
8119 imm_args.__tmp_2_0 = __tmp_2;
8120 imm_args.__tmp_3_0 = __tmp_3;
8121 nanos_dependence_t _dependences[3] = {
8122 {
8123 (void **) &imm_args.__tmp_3_0,
8124 ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0),
8125 {
8126 0,
8127 1,
8128 1,
8129 0
8130 },
8131 sizeof(SliceBufferEntry)
8132 },
8133 {
8134 (void **) &imm_args.__tmp_1_0,
8135 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
8136 {
8137 1,
8138 1,
8139 1,
8140 0
8141 },
8142 sizeof(struct ParserContext)
8143 },
8144 {
8145 (void **) &imm_args.__tmp_2_0,
8146 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
8147 {
8148 1,
8149 1,
8150 1,
8151 0
8152 },
8153 sizeof(struct NalContext)
8154 }
8155 };
8156 dyn_props.priority = 0;
8157 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_16_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
8158 if (err != NANOS_OK)
8159 nanos_handle_error(err);
8160 }
8161 }
8162 ;
8163 }
8164 {
8165 struct H264Context *__tmp_0 = h;
8166 struct EntropyContext *__tmp_1 = ec[k % bufs];
8167 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
8168 {
8169 /* SMP device descriptor */
8170 static nanos_smp_args_t _ol_h264_decode_ompss_17_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_17};
8171 _nx_data_env_17_t *ol_args = (_nx_data_env_17_t *) 0;
8172 nanos_wd_t wd = (nanos_wd_t) 0;
8173 struct nanos_const_wd_definition_local_t
8174 {
8175 nanos_const_wd_definition_t base;
8176 nanos_device_t devices[1];
8177 };
8178 static struct nanos_const_wd_definition_local_t _const_def = {
8179 {
8180 {
8181 0,
8182 1,
8183 0,
8184 0,
8185 0,
8186 0,
8187 0,
8188 0
8189 },
8190 __alignof__(_nx_data_env_17_t),
8191 0,
8192 1
8193 },
8194 {{
8195 nanos_smp_factory,
8196 &_ol_h264_decode_ompss_17_smp_args
8197 }}
8198 };
8199 nanos_wd_dyn_props_t dyn_props = {0};
8200 nanos_err_t err;
8201 dyn_props.priority = 0;
8202 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_17_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
8203 if (err != NANOS_OK)
8204 nanos_handle_error(err);
8205 if (wd != (nanos_wd_t) 0)
8206 {
8207 ol_args->__tmp_0_0 = __tmp_0;
8208 ol_args->__tmp_1_0 = __tmp_1;
8209 ol_args->__tmp_2_0 = __tmp_2;
8210 nanos_dependence_t _dependences[2] = {
8211 {
8212 (void **) &ol_args->__tmp_1_0,
8213 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
8214 {
8215 1,
8216 1,
8217 1,
8218 0
8219 },
8220 sizeof(struct EntropyContext)
8221 },
8222 {
8223 (void **) &ol_args->__tmp_2_0,
8224 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
8225 {
8226 1,
8227 1,
8228 1,
8229 0
8230 },
8231 sizeof(SliceBufferEntry)
8232 }
8233 };
8234 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
8235 if (err != NANOS_OK)
8236 nanos_handle_error(err);
8237 }
8238 else
8239 {
8240 _nx_data_env_17_t imm_args;
8241 imm_args.__tmp_0_0 = __tmp_0;
8242 imm_args.__tmp_1_0 = __tmp_1;
8243 imm_args.__tmp_2_0 = __tmp_2;
8244 nanos_dependence_t _dependences[2] = {
8245 {
8246 (void **) &imm_args.__tmp_1_0,
8247 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
8248 {
8249 1,
8250 1,
8251 1,
8252 0
8253 },
8254 sizeof(struct EntropyContext)
8255 },
8256 {
8257 (void **) &imm_args.__tmp_2_0,
8258 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
8259 {
8260 1,
8261 1,
8262 1,
8263 0
8264 },
8265 sizeof(SliceBufferEntry)
8266 }
8267 };
8268 dyn_props.priority = 0;
8269 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_17_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
8270 if (err != NANOS_OK)
8271 nanos_handle_error(err);
8272 }
8273 }
8274 ;
8275 }
8276 {
8277 struct H264Context *__tmp_0 = h;
8278 struct MBRecContext *__tmp_1 = rc[0];
8279 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
8280 {
8281 /* SMP device descriptor */
8282 static nanos_smp_args_t _ol_h264_decode_ompss_18_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_18};
8283 _nx_data_env_18_t *ol_args = (_nx_data_env_18_t *) 0;
8284 nanos_wd_t wd = (nanos_wd_t) 0;
8285 struct nanos_const_wd_definition_local_t
8286 {
8287 nanos_const_wd_definition_t base;
8288 nanos_device_t devices[1];
8289 };
8290 static struct nanos_const_wd_definition_local_t _const_def = {
8291 {
8292 {
8293 0,
8294 1,
8295 0,
8296 0,
8297 0,
8298 0,
8299 0,
8300 0
8301 },
8302 __alignof__(_nx_data_env_18_t),
8303 0,
8304 1
8305 },
8306 {{
8307 nanos_smp_factory,
8308 &_ol_h264_decode_ompss_18_smp_args
8309 }}
8310 };
8311 nanos_wd_dyn_props_t dyn_props = {0};
8312 nanos_err_t err;
8313 dyn_props.priority = 0;
8314 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_18_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
8315 if (err != NANOS_OK)
8316 nanos_handle_error(err);
8317 if (wd != (nanos_wd_t) 0)
8318 {
8319 ol_args->__tmp_0_0 = __tmp_0;
8320 ol_args->__tmp_1_0 = __tmp_1;
8321 ol_args->__tmp_2_0 = __tmp_2;
8322 nanos_dependence_t _dependences[2] = {
8323 {
8324 (void **) &ol_args->__tmp_1_0,
8325 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
8326 {
8327 1,
8328 1,
8329 1,
8330 0
8331 },
8332 sizeof(struct MBRecContext)
8333 },
8334 {
8335 (void **) &ol_args->__tmp_2_0,
8336 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
8337 {
8338 1,
8339 1,
8340 1,
8341 0
8342 },
8343 sizeof(SliceBufferEntry)
8344 }
8345 };
8346 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
8347 if (err != NANOS_OK)
8348 nanos_handle_error(err);
8349 }
8350 else
8351 {
8352 _nx_data_env_18_t imm_args;
8353 imm_args.__tmp_0_0 = __tmp_0;
8354 imm_args.__tmp_1_0 = __tmp_1;
8355 imm_args.__tmp_2_0 = __tmp_2;
8356 nanos_dependence_t _dependences[2] = {
8357 {
8358 (void **) &imm_args.__tmp_1_0,
8359 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
8360 {
8361 1,
8362 1,
8363 1,
8364 0
8365 },
8366 sizeof(struct MBRecContext)
8367 },
8368 {
8369 (void **) &imm_args.__tmp_2_0,
8370 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
8371 {
8372 1,
8373 1,
8374 1,
8375 0
8376 },
8377 sizeof(SliceBufferEntry)
8378 }
8379 };
8380 dyn_props.priority = 0;
8381 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_18_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
8382 if (err != NANOS_OK)
8383 nanos_handle_error(err);
8384 }
8385 }
8386 ;
8387 }
8388 {
8389 struct H264Context *__tmp_0 = h;
8390 struct OutputContext *__tmp_1 = oc;
8391 SliceBufferEntry *__tmp_2 = &sbe[k % bufs];
8392 {
8393 /* SMP device descriptor */
8394 static nanos_smp_args_t _ol_h264_decode_ompss_19_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_19};
8395 _nx_data_env_19_t *ol_args = (_nx_data_env_19_t *) 0;
8396 nanos_wd_t wd = (nanos_wd_t) 0;
8397 struct nanos_const_wd_definition_local_t
8398 {
8399 nanos_const_wd_definition_t base;
8400 nanos_device_t devices[1];
8401 };
8402 static struct nanos_const_wd_definition_local_t _const_def = {
8403 {
8404 {
8405 0,
8406 1,
8407 0,
8408 0,
8409 0,
8410 0,
8411 0,
8412 0
8413 },
8414 __alignof__(_nx_data_env_19_t),
8415 0,
8416 1
8417 },
8418 {{
8419 nanos_smp_factory,
8420 &_ol_h264_decode_ompss_19_smp_args
8421 }}
8422 };
8423 nanos_wd_dyn_props_t dyn_props = {0};
8424 nanos_err_t err;
8425 dyn_props.priority = 0;
8426 err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_19_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0);
8427 if (err != NANOS_OK)
8428 nanos_handle_error(err);
8429 if (wd != (nanos_wd_t) 0)
8430 {
8431 ol_args->__tmp_0_0 = __tmp_0;
8432 ol_args->__tmp_1_0 = __tmp_1;
8433 ol_args->__tmp_2_0 = __tmp_2;
8434 nanos_dependence_t _dependences[2] = {
8435 {
8436 (void **) &ol_args->__tmp_2_0,
8437 ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0),
8438 {
8439 1,
8440 0,
8441 1,
8442 0
8443 },
8444 sizeof(SliceBufferEntry)
8445 },
8446 {
8447 (void **) &ol_args->__tmp_1_0,
8448 ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0),
8449 {
8450 1,
8451 1,
8452 1,
8453 0
8454 },
8455 sizeof(struct OutputContext)
8456 }
8457 };
8458 err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0);
8459 if (err != NANOS_OK)
8460 nanos_handle_error(err);
8461 }
8462 else
8463 {
8464 _nx_data_env_19_t imm_args;
8465 imm_args.__tmp_0_0 = __tmp_0;
8466 imm_args.__tmp_1_0 = __tmp_1;
8467 imm_args.__tmp_2_0 = __tmp_2;
8468 nanos_dependence_t _dependences[2] = {
8469 {
8470 (void **) &imm_args.__tmp_2_0,
8471 ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0),
8472 {
8473 1,
8474 0,
8475 1,
8476 0
8477 },
8478 sizeof(SliceBufferEntry)
8479 },
8480 {
8481 (void **) &imm_args.__tmp_1_0,
8482 ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0),
8483 {
8484 1,
8485 1,
8486 1,
8487 0
8488 },
8489 sizeof(struct OutputContext)
8490 }
8491 };
8492 dyn_props.priority = 0;
8493 err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_19_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0);
8494 if (err != NANOS_OK)
8495 nanos_handle_error(err);
8496 }
8497 }
8498 ;
8499 }
8500 {
8501 struct _dependence_holder
8502 {
8503 struct ParserContext *dep_0;
8504 } _dep_holder = {&(*pc)};
8505 nanos_dependence_t _wait_dependences[1] = {{
8506 (void **) &_dep_holder.dep_0,
8507 ((char *) ((pc)) - (char *) _dep_holder.dep_0),
8508 {
8509 1,
8510 0,
8511 0,
8512 0
8513 },
8514 sizeof (*pc)
8515 }};
8516 nanos_wait_on(1, _wait_dependences);
8517 }
8518 k++;
8519 }
8520 }
8521 nanos_wg_wait_completion(nanos_current_wd(), 0);
8522 while ((out = output_frame(h, oc, ((void *) 0), h->ofile, h->frame_width, h->frame_height)))
8523 ;
8524 h->num_frames = oc->frame_number;
8525 free_parse_context(pc);
8526 free_nal_context(nc);
8527 free_output_context(oc);
8528 for (int i = 0;
8529 i < bufs;
8530 i++)
8531 {
8532 free_sb_entry(&sbe[i]); 3902 free_sb_entry(&sbe[i]);
8533 free_entropy_context(ec[i]); 3903 free_entropy_context(ec[i]);
8534 } 3904 }
8535 av_free(sbe); 3905 }
8536 for (int i = 0; 3906 av_free(sbe);
8537 i < 2; 3907 for (int i = 0; i < 2; i++)
8538 i++) 3908 {
8539 { 3909 {
8540 free_mbrec_context(rc[i]); 3910 free_mbrec_context(rc[i]);
8541 } 3911 }
8542 return 0; 3912 }
8543 } 3913 return 0;
8544 __attribute__((weak, section("nanos_init"))) nanos_init_desc_t __section__nanos_init = { 3914 }
8545 nanos_omp_set_interface, 3915 static void smp_ol_decode_super_mb_task_1_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const ml, SuperMBTask **const mur, SuperMBTask **const m)
8546 (void *) 0 3916 {
8547 }; 3917 {
3918 decode_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*m));
3919 }
3920 }
3921 static void smp_ol_decode_super_mb_task_1(struct nanos_args_0_t *const args)
3922 {
3923 {
3924 smp_ol_decode_super_mb_task_1_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).m));
3925 }
3926 }
3927 static void smp_ol_draw_edges_task_3_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const sm, int *const line)
3928 {
3929 {
3930 draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line));
3931 }
3932 }
3933 static void smp_ol_draw_edges_task_3(struct nanos_args_1_t *const args)
3934 {
3935 {
3936 smp_ol_draw_edges_task_3_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line));
3937 }
3938 }
3939 static void smp_ol_decode_3dwave_super_mb_task_5_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const ml, SuperMBTask **const mur, SuperMBTask **const mprev, SuperMBTask **const m)
3940 {
3941 {
3942 decode_3dwave_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*mprev), (*m));
3943 }
3944 }
3945 static void smp_ol_decode_3dwave_super_mb_task_5(struct nanos_args_2_t *const args)
3946 {
3947 {
3948 smp_ol_decode_3dwave_super_mb_task_5_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).mprev), &((*args).m));
3949 }
3950 }
3951 static void smp_ol_draw_edges_task_7_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const sm, int *const line)
3952 {
3953 {
3954 draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line));
3955 }
3956 }
3957 static void smp_ol_draw_edges_task_7(struct nanos_args_3_t *const args)
3958 {
3959 {
3960 smp_ol_draw_edges_task_7_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line));
3961 }
3962 }
3963 static void smp_ol_decode_super_mb_task_9_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const ml, SuperMBTask **const mur, SuperMBTask **const m)
3964 {
3965 {
3966 decode_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*m));
3967 }
3968 }
3969 static void smp_ol_decode_super_mb_task_9(struct nanos_args_4_t *const args)
3970 {
3971 {
3972 smp_ol_decode_super_mb_task_9_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).m));
3973 }
3974 }
3975 static void smp_ol_draw_edges_task_11_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const sm, int *const line)
3976 {
3977 {
3978 draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line));
3979 }
3980 }
3981 static void smp_ol_draw_edges_task_11(struct nanos_args_5_t *const args)
3982 {
3983 {
3984 smp_ol_draw_edges_task_11_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line));
3985 }
3986 }
3987 static void smp_ol_parse_task_13_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe)
3988 {
3989 {
3990 parse_task((*h), (*pc), (*nc), (*sbe));
3991 }
3992 }
3993 static void smp_ol_parse_task_13(struct nanos_args_6_t *const args)
3994 {
3995 {
3996 smp_ol_parse_task_13_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe));
3997 }
3998 }
3999 static void smp_ol_decode_slice_entropy_task_15_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe)
4000 {
4001 {
4002 decode_slice_entropy_task((*h), (*ec), (*sbe));
4003 }
4004 }
4005 static void smp_ol_decode_slice_entropy_task_15(struct nanos_args_7_t *const args)
4006 {
4007 {
4008 smp_ol_decode_slice_entropy_task_15_unpacked(&((*args).h), &((*args).ec), &((*args).sbe));
4009 }
4010 }
4011 static void smp_ol_parse_task_17_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe)
4012 {
4013 {
4014 parse_task((*h), (*pc), (*nc), (*sbe));
4015 }
4016 }
4017 static void smp_ol_parse_task_17(struct nanos_args_8_t *const args)
4018 {
4019 {
4020 smp_ol_parse_task_17_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe));
4021 }
4022 }
4023 static void smp_ol_decode_slice_entropy_task_19_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe)
4024 {
4025 {
4026 decode_slice_entropy_task((*h), (*ec), (*sbe));
4027 }
4028 }
4029 static void smp_ol_decode_slice_entropy_task_19(struct nanos_args_9_t *const args)
4030 {
4031 {
4032 smp_ol_decode_slice_entropy_task_19_unpacked(&((*args).h), &((*args).ec), &((*args).sbe));
4033 }
4034 }
4035 static void smp_ol_init_ref_list_and_get_dpb_task_21_unpacked(H264Context **const h, MBRecContext **const d, SliceBufferEntry **const sbe, int **const init)
4036 {
4037 {
4038 init_ref_list_and_get_dpb_task((*h), (*d), (*sbe), (*init));
4039 }
4040 }
4041 static void smp_ol_init_ref_list_and_get_dpb_task_21(struct nanos_args_10_t *const args)
4042 {
4043 {
4044 smp_ol_init_ref_list_and_get_dpb_task_21_unpacked(&((*args).h), &((*args).d), &((*args).sbe), &((*args).init));
4045 }
4046 }
4047 static void smp_ol_release_ref_list_task_23_unpacked(H264Context **const h, SuperMBContext **const smbc, MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBTask **const lastsmb, int **const release)
4048 {
4049 {
4050 release_ref_list_task((*h), (*smbc), (*d), (*sbe), (*lastsmb), (*release));
4051 }
4052 }
4053 static void smp_ol_release_ref_list_task_23(struct nanos_args_11_t *const args)
4054 {
4055 {
4056 smp_ol_release_ref_list_task_23_unpacked(&((*args).h), &((*args).smbc), &((*args).d), &((*args).sbe), &((*args).lastsmb), &((*args).release));
4057 }
4058 }
4059 static void smp_ol_output_task_25_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe)
4060 {
4061 {
4062 output_task((*h), (*oc), (*sbe));
4063 }
4064 }
4065 static void smp_ol_output_task_25(struct nanos_args_12_t *const args)
4066 {
4067 {
4068 smp_ol_output_task_25_unpacked(&((*args).h), &((*args).oc), &((*args).sbe));
4069 }
4070 }
4071 static void smp_ol_init_ref_list_and_get_dpb_task_27_unpacked(H264Context **const h, MBRecContext **const d, SliceBufferEntry **const sbe, int **const init)
4072 {
4073 {
4074 init_ref_list_and_get_dpb_task((*h), (*d), (*sbe), (*init));
4075 }
4076 }
4077 static void smp_ol_init_ref_list_and_get_dpb_task_27(struct nanos_args_13_t *const args)
4078 {
4079 {
4080 smp_ol_init_ref_list_and_get_dpb_task_27_unpacked(&((*args).h), &((*args).d), &((*args).sbe), &((*args).init));
4081 }
4082 }
4083 static void smp_ol_release_ref_list_task_29_unpacked(H264Context **const h, SuperMBContext **const smbc, MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBTask **const lastsmb, int **const release)
4084 {
4085 {
4086 release_ref_list_task((*h), (*smbc), (*d), (*sbe), (*lastsmb), (*release));
4087 }
4088 }
4089 static void smp_ol_release_ref_list_task_29(struct nanos_args_14_t *const args)
4090 {
4091 {
4092 smp_ol_release_ref_list_task_29_unpacked(&((*args).h), &((*args).smbc), &((*args).d), &((*args).sbe), &((*args).lastsmb), &((*args).release));
4093 }
4094 }
4095 static void smp_ol_output_task_31_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe)
4096 {
4097 {
4098 output_task((*h), (*oc), (*sbe));
4099 }
4100 }
4101 static void smp_ol_output_task_31(struct nanos_args_15_t *const args)
4102 {
4103 {
4104 smp_ol_output_task_31_unpacked(&((*args).h), &((*args).oc), &((*args).sbe));
4105 }
4106 }
4107 static void smp_ol_parse_task_33_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe)
4108 {
4109 {
4110 parse_task((*h), (*pc), (*nc), (*sbe));
4111 }
4112 }
4113 static void smp_ol_parse_task_33(struct nanos_args_16_t *const args)
4114 {
4115 {
4116 smp_ol_parse_task_33_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe));
4117 }
4118 }
4119 static void smp_ol_decode_slice_entropy_task_35_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe)
4120 {
4121 {
4122 decode_slice_entropy_task((*h), (*ec), (*sbe));
4123 }
4124 }
4125 static void smp_ol_decode_slice_entropy_task_35(struct nanos_args_17_t *const args)
4126 {
4127 {
4128 smp_ol_decode_slice_entropy_task_35_unpacked(&((*args).h), &((*args).ec), &((*args).sbe));
4129 }
4130 }
4131 static void smp_ol_decode_slice_mb_task_37_unpacked(H264Context **const h, MBRecContext **const d, SliceBufferEntry **const sbe)
4132 {
4133 {
4134 decode_slice_mb_task((*h), (*d), (*sbe));
4135 }
4136 }
4137 static void smp_ol_decode_slice_mb_task_37(struct nanos_args_18_t *const args)
4138 {
4139 {
4140 smp_ol_decode_slice_mb_task_37_unpacked(&((*args).h), &((*args).d), &((*args).sbe));
4141 }
4142 }
4143 static void smp_ol_output_task_39_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe)
4144 {
4145 {
4146 output_task((*h), (*oc), (*sbe));
4147 }
4148 }
4149 static void smp_ol_output_task_39(struct nanos_args_19_t *const args)
4150 {
4151 {
4152 smp_ol_output_task_39_unpacked(&((*args).h), &((*args).oc), &((*args).sbe));
4153 }
4154 }
4155 typedef void nanos_init_func_t(void *);
4156 struct mcc_struct_anon_22
4157 {
4158 void (*func)(void *);
4159 void *data;
4160 };
4161 typedef struct mcc_struct_anon_22 nanos_init_desc_t;
4162 void nanos_omp_set_interface(void *);
4163 __attribute__((weak)) __attribute__((section("nanos_init"))) nanos_init_desc_t __section__nanos_init = { nanos_omp_set_interface, (void *)0 };