view 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
line source
1 typedef unsigned int uint32_t;
2 static __inline __attribute__((always_inline)) uint32_t pack16to32(int a, int b)
3 {
4 return (a & 65535) + (b << 16);
5 }
6 typedef unsigned short int uint16_t;
7 static __inline __attribute__((always_inline)) uint16_t pack8to16(int a, int b)
8 {
9 return (a & 255) + (b << 8);
10 }
11 struct CABACContext;
12 typedef struct CABACContext CABACContext;
13 typedef unsigned char uint8_t;
14 struct CABACContext
15 {
16 int low;
17 int range;
18 int outstanding_count;
19 const uint8_t *bytestream_start;
20 const uint8_t *bytestream;
21 const uint8_t *bytestream_end;
22 uint8_t cabac_state[460];
23 };
24 static void refill(CABACContext *c)
25 {
26 (*c).low += ((*c).bytestream[0] << 9) + ((*c).bytestream[1] << 1);
27 (*c).low -= (1 << 16) - 1;
28 (*c).bytestream += 16 / 8;
29 }
30 extern const uint8_t ff_h264_norm_shift[512];
31 static void refill2(CABACContext *c)
32 {
33 int x;
34 int i;
35 x = (*c).low ^ ((*c).low - 1);
36 i = 7 - ff_h264_norm_shift[x >> (16 - 1)];
37 x = -((1 << 16) - 1);
38 x += ((*c).bytestream[0] << 9) + ((*c).bytestream[1] << 1);
39 (*c).low += x << i;
40 (*c).bytestream += 16 / 8;
41 }
42 static __inline void renorm_cabac_decoder(CABACContext *c)
43 {
44 while ((*c).range < 256)
45 {
46 {
47 (*c).range += (*c).range;
48 (*c).low += (*c).low;
49 if (!((*c).low & ((1 << 16) - 1)))
50 {
51 refill(c);
52 }
53 }
54 }
55 }
56 static __inline void renorm_cabac_decoder_once(CABACContext *c)
57 {
58 int shift = (uint32_t)((*c).range - 256) >> 31;
59 (*c).range <<= shift;
60 (*c).low <<= shift;
61 if (!((*c).low & ((1 << 16) - 1)))
62 {
63 refill(c);
64 }
65 }
66 extern uint8_t ff_h264_lps_range[512];
67 extern uint8_t ff_h264_mlps_state[256];
68 static __inline __attribute__((always_inline)) int get_cabac_inline(CABACContext *c, uint8_t *const state)
69 {
70 __attribute__((unused)) int lps_mask;
71 int bit;
72 int s = *state;
73 int RangeLPS = ff_h264_lps_range[2 * ((*c).range & 192) + s];
74 (*c).range -= RangeLPS;
75 lps_mask = (((*c).range << (16 + 1)) - (*c).low) >> 31;
76 (*c).low -= (*c).range << (16 + 1) & lps_mask;
77 (*c).range += (RangeLPS - (*c).range) & lps_mask;
78 s ^= lps_mask;
79 *state = (ff_h264_mlps_state + 128)[s];
80 bit = s & 1;
81 lps_mask = ff_h264_norm_shift[(*c).range];
82 (*c).range <<= lps_mask;
83 (*c).low <<= lps_mask;
84 if (!((*c).low & ((1 << 16) - 1)))
85 {
86 refill2(c);
87 }
88 return bit;
89 }
90 static __attribute__((noinline)) __attribute__((unused)) int get_cabac_noinline(CABACContext *c, uint8_t *const state)
91 {
92 return get_cabac_inline(c, state);
93 }
94 static __attribute__((unused)) int get_cabac(CABACContext *c, uint8_t *const state)
95 {
96 return get_cabac_inline(c, state);
97 }
98 static __attribute__((unused)) int get_cabac_bypass(CABACContext *c)
99 {
100 int range;
101 (*c).low += (*c).low;
102 if (!((*c).low & ((1 << 16) - 1)))
103 {
104 refill(c);
105 }
106 range = (*c).range << (16 + 1);
107 if ((*c).low < range)
108 {
109 {
110 return 0;
111 }
112 }
113 else
114 {
115 {
116 (*c).low -= range;
117 return 1;
118 }
119 }
120 }
121 static __inline __attribute__((always_inline)) int get_cabac_bypass_sign(CABACContext *c, int val)
122 {
123 int range;
124 int mask;
125 (*c).low += (*c).low;
126 if (!((*c).low & ((1 << 16) - 1)))
127 {
128 refill(c);
129 }
130 range = (*c).range << (16 + 1);
131 (*c).low -= range;
132 mask = (*c).low >> 31;
133 range &= mask;
134 (*c).low += range;
135 return (val ^ mask) - mask;
136 }
137 static __attribute__((unused)) int get_cabac_terminate(CABACContext *c)
138 {
139 (*c).range -= 2;
140 if ((*c).low < (*c).range << (16 + 1))
141 {
142 {
143 renorm_cabac_decoder_once(c);
144 return 0;
145 }
146 }
147 else
148 {
149 {
150 return (*c).bytestream - (*c).bytestream_start;
151 }
152 }
153 }
154 static __inline __attribute__((always_inline)) __attribute__((const)) uint16_t bswap_16(uint16_t x)
155 {
156 __asm__ ("rorw $8, %0" : "+r"(x) : );
157 return x;
158 }
159 static __inline __attribute__((always_inline)) __attribute__((const)) uint32_t bswap_32(uint32_t x)
160 {
161 __asm__ ("bswap %0" : "+r"(x) : );
162 return x;
163 }
164 typedef unsigned long int uint64_t;
165 static __inline __attribute__((const)) uint64_t bswap_64(uint64_t x)
166 {
167 __asm__ ("bswap %0" : "=r"(x) : "0"(x));
168 return x;
169 }
170 extern const uint8_t ff_log2_tab[256];
171 static __inline __attribute__((const)) int av_log2_c(unsigned int v)
172 {
173 int n = 0;
174 if (v & 4294901760U)
175 {
176 {
177 v >>= 16;
178 n += 16;
179 }
180 }
181 if (v & 65280)
182 {
183 {
184 v >>= 8;
185 n += 8;
186 }
187 }
188 n += ff_log2_tab[v];
189 return n;
190 }
191 static __inline __attribute__((const)) int av_log2_16bit_c(unsigned int v)
192 {
193 int n = 0;
194 if (v & 65280)
195 {
196 {
197 v >>= 8;
198 n += 8;
199 }
200 }
201 n += ff_log2_tab[v];
202 return n;
203 }
204 static __inline __attribute__((const)) int av_clip(int a, int amin, int amax)
205 {
206 if (a < amin)
207 {
208 return amin;
209 }
210 else
211 {
212 if (a > amax)
213 {
214 return amax;
215 }
216 else
217 {
218 return a;
219 }
220 }
221 }
222 static __inline __attribute__((const)) uint8_t av_clip_uint8(int a)
223 {
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 }
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 }
256 typedef int int32_t;
257 typedef long int int64_t;
258 static __inline __attribute__((const)) int32_t av_clipl_int32(int64_t a)
259 {
260 if ((a + 2147483648U) & ~4294967295LU)
261 {
262 return a >> 63 ^ 2147483647;
263 }
264 else
265 {
266 return a;
267 }
268 }
269 static __inline __attribute__((const)) float av_clipf(float a, float amin, float amax)
270 {
271 if (a < amin)
272 {
273 return amin;
274 }
275 else
276 {
277 if (a > amax)
278 {
279 return amax;
280 }
281 else
282 {
283 return a;
284 }
285 }
286 }
287 static __inline __attribute__((const)) int av_ceil_log2(int x)
288 {
289 return av_log2_c((x - 1) << 1);
290 }
291 static __inline __attribute__((always_inline)) void AV_COPY64(void *d, const void *s)
292 {
293 __asm__ ("movq %1, %%mm0 \n\t""movq %%mm0, %0 \n\t" : "=m"(*((uint64_t *)d)) : "m"(*((const uint64_t *)s)) : "mm0");
294 }
295 static __inline __attribute__((always_inline)) void AV_SWAP64(void *a, void *b)
296 {
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");
298 }
299 static __inline __attribute__((always_inline)) void AV_ZERO64(void *d)
300 {
301 __asm__ ("pxor %%mm0, %%mm0 \n\t""movq %%mm0, %0 \n\t" : "=m"(*((uint64_t *)d)) : : "mm0");
302 }
303 static __inline __attribute__((always_inline)) void AV_COPY128(void *d, const void *s)
304 {
305 struct v;
306 struct v
307 {
308 uint64_t v[2];
309 };
310 __asm__ ("movaps %1, %%xmm0 \n\t""movaps %%xmm0, %0 \n\t" : "=m"(*((struct v *)d)) : "m"(*((const struct v *)s)) : "xmm0");
311 }
312 static __inline __attribute__((always_inline)) void AV_ZERO128(void *d)
313 {
314 struct v;
315 struct v
316 {
317 uint64_t v[2];
318 };
319 __asm__ ("pxor %%xmm0, %%xmm0 \n\t""movdqa %%xmm0, %0 \n\t" : "=m"(*((struct v *)d)) : : "xmm0");
320 }
321 static __inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
322 {
323 return (a | b) - (((a ^ b) & ~(1 * 16843009LU)) >> 1);
324 }
325 static __inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
326 {
327 return (a & b) + (((a ^ b) & ~(1 * 16843009LU)) >> 1);
328 }
329 static __inline void emms(void)
330 {
331 __asm__ volatile("emms;" : : : "memory");
332 }
333 static __inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
334 {
335 int i;
336 for (i = 0; i < h; i++)
337 {
338 {
339 do
340 {
341 {
342 ((uint8_t *)dst)[0] = ((const uint8_t *)src)[1] << 8 | ((const uint8_t *)src)[0];
343 ((uint8_t *)dst)[1] = (((const uint8_t *)src)[1] << 8 | ((const uint8_t *)src)[0]) >> 8;
344 }
345 }
346 while (0);
347 dst += dstStride;
348 src += srcStride;
349 }
350 }
351 }
352 static __inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
353 {
354 int i;
355 for (i = 0; i < h; i++)
356 {
357 {
358 do
359 {
360 {
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];
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;
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;
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 }
367 while (0);
368 dst += dstStride;
369 src += srcStride;
370 }
371 }
372 }
373 static __inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
374 {
375 int i;
376 for (i = 0; i < h; i++)
377 {
378 {
379 do
380 {
381 {
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];
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;
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;
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 }
388 while (0);
389 do
390 {
391 {
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];
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;
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;
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 }
398 while (0);
399 dst += dstStride;
400 src += srcStride;
401 }
402 }
403 }
404 static __inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
405 {
406 int i;
407 for (i = 0; i < h; i++)
408 {
409 {
410 do
411 {
412 {
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];
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;
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;
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 }
419 while (0);
420 do
421 {
422 {
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];
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;
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;
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 }
429 while (0);
430 dst[8] = src[8];
431 dst += dstStride;
432 src += srcStride;
433 }
434 }
435 }
436 static __inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
437 {
438 int i;
439 for (i = 0; i < h; i++)
440 {
441 {
442 do
443 {
444 {
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];
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;
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;
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 }
451 while (0);
452 do
453 {
454 {
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];
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;
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;
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 }
461 while (0);
462 do
463 {
464 {
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];
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;
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;
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 }
471 while (0);
472 do
473 {
474 {
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];
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;
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;
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 }
481 while (0);
482 dst += dstStride;
483 src += srcStride;
484 }
485 }
486 }
487 static __inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
488 {
489 int i;
490 for (i = 0; i < h; i++)
491 {
492 {
493 do
494 {
495 {
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];
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;
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;
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 }
502 while (0);
503 do
504 {
505 {
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];
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;
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;
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 }
512 while (0);
513 do
514 {
515 {
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];
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;
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;
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 }
522 while (0);
523 do
524 {
525 {
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];
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;
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;
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 }
532 while (0);
533 dst[16] = src[16];
534 dst += dstStride;
535 src += srcStride;
536 }
537 }
538 }
539 static __inline uint64_t read_time(void)
540 {
541 uint32_t a;
542 uint32_t d;
543 __asm__ volatile("rdtsc" : "=a"(a), "=d"(d) : );
544 return ((uint64_t)d << 32) + a;
545 }
546 typedef signed char int8_t;
547 static __inline int32_t NEG_SSR32(int32_t a, int8_t s)
548 {
549 __asm__ ("sarl %1, %0\n\t" : "+r"(a) : "ic"((uint8_t) -s));
550 return a;
551 }
552 static __inline uint32_t NEG_USR32(uint32_t a, int8_t s)
553 {
554 __asm__ ("shrl %1, %0\n\t" : "+r"(a) : "ic"((uint8_t) -s));
555 return a;
556 }
557 static __inline __attribute__((always_inline)) int MULH(int a, int b)
558 {
559 return (int64_t)a * (int64_t)b >> 32;
560 }
561 static __inline __attribute__((always_inline)) unsigned int UMULH(unsigned int a, unsigned int b)
562 {
563 return (uint64_t)a * (uint64_t)b >> 32;
564 }
565 static __inline __attribute__((const)) int mid_pred(int a, int b, int c)
566 {
567 if (a > b)
568 {
569 {
570 if (c > b)
571 {
572 {
573 if (c > a)
574 {
575 b = a;
576 }
577 else
578 {
579 b = c;
580 }
581 }
582 }
583 }
584 }
585 else
586 {
587 {
588 if (b > c)
589 {
590 {
591 if (c > a)
592 {
593 b = c;
594 }
595 else
596 {
597 b = a;
598 }
599 }
600 }
601 }
602 }
603 return b;
604 }
605 static __inline __attribute__((const)) int sign_extend(int val, unsigned int bits)
606 {
607 return val << (8 * sizeof(int) - bits) >> (8 * sizeof(int) - bits);
608 }
609 static __inline __attribute__((const)) unsigned int zero_extend(unsigned int val, unsigned int bits)
610 {
611 return val << (8 * sizeof(int) - bits) >> (8 * sizeof(int) - bits);
612 }
613 struct GetBitContext;
614 typedef struct GetBitContext GetBitContext;
615 struct GetBitContext
616 {
617 uint8_t *rbsp;
618 unsigned int rbsp_size;
619 uint8_t *raw;
620 const uint8_t *buffer;
621 const uint8_t *buffer_end;
622 unsigned int alloc_size;
623 unsigned int buf_size;
624 uint32_t *buffer_ptr;
625 uint32_t cache0;
626 uint32_t cache1;
627 int bit_count;
628 int size_in_bits;
629 };
630 static __inline int get_bits_count(const GetBitContext *s)
631 {
632 return ((uint8_t *)(*s).buffer_ptr - (*s).buffer) * 8 - 32 + (*s).bit_count;
633 }
634 static __inline void skip_bits_long(GetBitContext *s, int n)
635 {
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 {
648 const uint32_t next = bswap_32(*re_buffer_ptr);
649 re_cache0 |= NEG_USR32(next, re_bit_count);
650 re_cache1 |= next << re_bit_count;
651 re_buffer_ptr++;
652 re_bit_count -= 32;
653 }
654 }
655 (*s).bit_count = re_bit_count;
656 (*s).cache0 = re_cache0;
657 (*s).cache1 = re_cache1;
658 (*s).buffer_ptr = re_buffer_ptr;
659 }
660 static __inline int get_xbits(GetBitContext *s, int n)
661 {
662 register int32_t cache;
663 register int sign;
664 int re_bit_count = (*s).bit_count;
665 uint32_t re_cache0 = (*s).cache0;
666 uint32_t re_cache1 = (*s).cache1;
667 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
668 if (re_bit_count > 0)
669 {
670 {
671 const uint32_t next = bswap_32(*re_buffer_ptr);
672 re_cache0 |= NEG_USR32(next, re_bit_count);
673 re_cache1 |= next << re_bit_count;
674 re_buffer_ptr++;
675 re_bit_count -= 32;
676 }
677 }
678 cache = re_cache0;
679 sign = ~cache >> 31;
680 {
681 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
682 re_bit_count += n;
683 }
684 (*s).bit_count = re_bit_count;
685 (*s).cache0 = re_cache0;
686 (*s).cache1 = re_cache1;
687 (*s).buffer_ptr = re_buffer_ptr;
688 return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
689 }
690 static __inline int get_sbits(GetBitContext *s, int n)
691 {
692 register int tmp;
693 int re_bit_count = (*s).bit_count;
694 uint32_t re_cache0 = (*s).cache0;
695 uint32_t re_cache1 = (*s).cache1;
696 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
697 if (re_bit_count > 0)
698 {
699 {
700 const uint32_t next = bswap_32(*re_buffer_ptr);
701 re_cache0 |= NEG_USR32(next, re_bit_count);
702 re_cache1 |= next << re_bit_count;
703 re_buffer_ptr++;
704 re_bit_count -= 32;
705 }
706 }
707 tmp = NEG_SSR32(re_cache0, n);
708 {
709 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
710 re_bit_count += n;
711 }
712 (*s).bit_count = re_bit_count;
713 (*s).cache0 = re_cache0;
714 (*s).cache1 = re_cache1;
715 (*s).buffer_ptr = re_buffer_ptr;
716 return tmp;
717 }
718 static __inline unsigned int get_bits(GetBitContext *s, int n)
719 {
720 register int tmp;
721 int re_bit_count = (*s).bit_count;
722 uint32_t re_cache0 = (*s).cache0;
723 uint32_t re_cache1 = (*s).cache1;
724 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
725 if (re_bit_count > 0)
726 {
727 {
728 const uint32_t next = bswap_32(*re_buffer_ptr);
729 re_cache0 |= NEG_USR32(next, re_bit_count);
730 re_cache1 |= next << re_bit_count;
731 re_buffer_ptr++;
732 re_bit_count -= 32;
733 }
734 }
735 tmp = NEG_USR32(re_cache0, n);
736 {
737 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
738 re_bit_count += n;
739 }
740 (*s).bit_count = re_bit_count;
741 (*s).cache0 = re_cache0;
742 (*s).cache1 = re_cache1;
743 (*s).buffer_ptr = re_buffer_ptr;
744 return tmp;
745 }
746 static __inline unsigned int show_bits(GetBitContext *s, int n)
747 {
748 register int tmp;
749 int re_bit_count = (*s).bit_count;
750 uint32_t re_cache0 = (*s).cache0;
751 uint32_t re_cache1 = (*s).cache1;
752 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
753 if (re_bit_count > 0)
754 {
755 {
756 const uint32_t next = bswap_32(*re_buffer_ptr);
757 re_cache0 |= NEG_USR32(next, re_bit_count);
758 re_cache1 |= next << re_bit_count;
759 re_buffer_ptr++;
760 re_bit_count -= 32;
761 }
762 }
763 tmp = NEG_USR32(re_cache0, n);
764 return tmp;
765 }
766 static __inline void skip_bits(GetBitContext *s, int n)
767 {
768 int re_bit_count = (*s).bit_count;
769 uint32_t re_cache0 = (*s).cache0;
770 uint32_t re_cache1 = (*s).cache1;
771 uint32_t *re_buffer_ptr = (*s).buffer_ptr;
772 if (re_bit_count > 0)
773 {
774 {
775 const uint32_t next = bswap_32(*re_buffer_ptr);
776 re_cache0 |= NEG_USR32(next, re_bit_count);
777 re_cache1 |= next << re_bit_count;
778 re_buffer_ptr++;
779 re_bit_count -= 32;
780 }
781 }
782 {
783 __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n));
784 re_bit_count += n;
785 }
786 (*s).bit_count = re_bit_count;
787 (*s).cache0 = re_cache0;
788 (*s).cache1 = re_cache1;
789 (*s).buffer_ptr = re_buffer_ptr;
790 }
791 static __inline unsigned int get_bits1(GetBitContext *s)
792 {
793 return get_bits(s, 1);
794 }
795 static __inline unsigned int show_bits1(GetBitContext *s)
796 {
797 return show_bits(s, 1);
798 }
799 static __inline void skip_bits1(GetBitContext *s)
800 {
801 skip_bits(s, 1);
802 }
803 static __inline unsigned int get_bits_long(GetBitContext *s, int n)
804 {
805 if (n <= 32)
806 {
807 return get_bits(s, n);
808 }
809 else
810 {
811 {
812 int ret = get_bits(s, 16) << (n - 16);
813 return ret | get_bits(s, n - 16);
814 }
815 }
816 }
817 static __inline int get_sbits_long(GetBitContext *s, int n)
818 {
819 return sign_extend(get_bits_long(s, n), n);
820 }
821 static __inline unsigned int show_bits_long(GetBitContext *s, int n)
822 {
823 if (n <= 32)
824 {
825 return show_bits(s, n);
826 }
827 else
828 {
829 {
830 GetBitContext gb = *s;
831 return get_bits_long(&gb, n);
832 }
833 }
834 }
835 void av_log(int level, const char *fmt, ...);
836 static __inline int check_marker(GetBitContext *s, const char *msg)
837 {
838 int bit = get_bits1(s);
839 if (!bit)
840 {
841 av_log(32, "Marker bit missing %s\n", msg);
842 }
843 return bit;
844 }
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 {
853 buffer_size = bit_size = 0;
854 buffer = (void *)0;
855 }
856 }
857 (*s).buffer = buffer;
858 (*s).size_in_bits = bit_size;
859 (*s).buffer_end = buffer + buffer_size;
860 (*s).buffer_ptr = (uint32_t *)((intptr_t)buffer & ~3);
861 (*s).bit_count = 32 + 8 * ((intptr_t)buffer & 3);
862 skip_bits_long(s, 0);
863 }
864 static __inline void align_get_bits(GetBitContext *s)
865 {
866 int n = -get_bits_count(s) & 7;
867 if (n)
868 {
869 skip_bits(s, n);
870 }
871 }
872 static __inline int get_bits_left(GetBitContext *gb)
873 {
874 return (*gb).size_in_bits - get_bits_count(gb);
875 }
876 struct H264Slice;
877 typedef struct H264Slice H264Slice;
878 struct PPS
879 {
880 unsigned int sps_id;
881 int cabac;
882 int pic_order_present;
883 int slice_group_count;
884 int mb_slice_group_map_type;
885 unsigned int ref_count[2];
886 int weighted_pred;
887 int weighted_bipred_idc;
888 int init_qp;
889 int init_qs;
890 int chroma_qp_index_offset[2];
891 int deblocking_filter_parameters_present;
892 int constrained_intra_pred;
893 int redundant_pic_cnt_present;
894 int transform_8x8_mode;
895 uint8_t scaling_matrix4[6][16];
896 uint8_t scaling_matrix8[2][64];
897 uint8_t chroma_qp_table[2][64];
898 int chroma_qp_diff;
899 };
900 typedef struct PPS PPS;
901 struct PictureInfo;
902 typedef struct PictureInfo PictureInfo;
903 struct DecodedPicture;
904 typedef struct DecodedPicture DecodedPicture;
905 struct H264Slice
906 {
907 PPS pps;
908 PictureInfo *current_picture_info;
909 DecodedPicture *curr_pic;
910 int slice_num;
911 int release_ref_cpn[66];
912 int release_cnt;
913 int qp_thresh;
914 int use_weight;
915 int use_weight_chroma;
916 int luma_log2_weight_denom;
917 int chroma_log2_weight_denom;
918 int16_t luma_weight[16][2][2];
919 int16_t chroma_weight[16][2][2][2];
920 int16_t implicit_weight[16][16][2];
921 int ref_list_cpn[2][16];
922 PictureInfo *ref_list[2][16];
923 DecodedPicture *dp_ref_list[2][16];
924 int ref_count[2];
925 int slice_type;
926 int slice_type_nos;
927 int slice_alpha_c0_offset;
928 int slice_beta_offset;
929 int direct_8x8_inference_flag;
930 uint8_t list_count;
931 uint32_t coded_pic_num;
932 int poc;
933 int key_frame;
934 int mmco_reset;
935 int ip_id;
936 int transform_bypass;
937 int direct_spatial_mv_pred;
938 int map_col_to_list0[2][16];
939 int dist_scale_factor[16];
940 int cabac_init_idc;
941 int nal_ref_idc;
942 int nal_unit_type;
943 int ref2frm[2][64];
944 int qscale;
945 };
946 static __inline int get_chroma_qp(H264Slice *s, int t, int qscale)
947 {
948 return (*s).pps.chroma_qp_table[t][qscale];
949 }
950 struct H264Context;
951 typedef struct H264Context H264Context;
952 struct ParserContext;
953 typedef struct ParserContext ParserContext;
954 struct NalContext;
955 typedef struct NalContext NalContext;
956 struct mcc_struct_anon_54;
957 typedef struct mcc_struct_anon_54 SliceBufferEntry;
958 struct H264Mb;
959 typedef struct H264Mb H264Mb;
960 struct mcc_struct_anon_54
961 {
962 H264Slice slice;
963 H264Mb *mbs;
964 DecodedPicture *dp;
965 GetBitContext gb;
966 int lines_taken;
967 int lines_total;
968 int state;
969 int initialized;
970 };
971 void init_sb_entry(H264Context *h, SliceBufferEntry *sbe);
972 struct __pthread_internal_list;
973 struct __pthread_internal_list
974 {
975 struct __pthread_internal_list *__prev;
976 struct __pthread_internal_list *__next;
977 };
978 typedef struct __pthread_internal_list __pthread_list_t;
979 struct __pthread_mutex_s
980 {
981 int __lock;
982 unsigned int __count;
983 int __owner;
984 unsigned int __nusers;
985 int __kind;
986 int __spins;
987 __pthread_list_t __list;
988 };
989 union mcc_union_anon_26
990 {
991 struct __pthread_mutex_s __data;
992 char __size[40];
993 long int __align;
994 };
995 typedef union mcc_union_anon_26 pthread_mutex_t;
996 struct mcc_struct_anon_29
997 {
998 int __lock;
999 unsigned int __futex;
1000 __extension__ unsigned long long int __total_seq;
1001 __extension__ unsigned long long int __wakeup_seq;
1002 __extension__ unsigned long long int __woken_seq;
1003 void *__mutex;
1004 unsigned int __nwaiters;
1005 unsigned int __broadcast_seq;
1006 };
1007 union mcc_union_anon_28
1009 struct mcc_struct_anon_29 __data;
1010 char __size[48];
1011 __extension__ long long int __align;
1012 };
1013 typedef union mcc_union_anon_28 pthread_cond_t;
1014 struct mcc_struct_anon_56
1016 pthread_mutex_t lock;
1017 pthread_cond_t cond;
1018 SliceBufferEntry **queue;
1019 int size;
1020 int cnt;
1021 int fi;
1022 int fo;
1023 };
1024 typedef struct mcc_struct_anon_56 SliceBufferQueue;
1025 struct RingLineEntry;
1026 typedef struct RingLineEntry RingLineEntry;
1027 struct mcc_struct_anon_57
1029 pthread_mutex_t wslock;
1030 pthread_cond_t wscond;
1031 pthread_mutex_t swlock;
1032 pthread_cond_t swcond;
1033 RingLineEntry **queue;
1034 int size;
1035 int ready;
1036 int free;
1037 int fi;
1038 int fo;
1039 };
1040 typedef struct mcc_struct_anon_57 RingLineQueue;
1041 union mcc_union_anon_25
1043 char __size[56];
1044 long int __align;
1045 };
1046 typedef union mcc_union_anon_25 pthread_attr_t;
1047 typedef unsigned long int pthread_t;
1048 struct SuperMBContext;
1049 typedef struct SuperMBContext SuperMBContext;
1050 typedef long int __time_t;
1051 struct timespec
1053 __time_t tv_sec;
1054 long int tv_nsec;
1055 };
1056 struct H264Context
1058 SliceBufferQueue sb_q[6];
1059 RingLineQueue rl_q;
1060 pthread_mutex_t lock[6];
1061 pthread_cond_t cond[6];
1062 pthread_mutex_t task_lock;
1063 pthread_cond_t task_cond;
1064 pthread_attr_t ed_rec_attr[80];
1065 pthread_t ed_rec_thr[80];
1066 int init_threads;
1067 pthread_mutex_t ilock;
1068 pthread_cond_t icond;
1069 const char *file_name;
1070 int profile;
1071 int start;
1072 int touch_start;
1073 int setaff;
1074 int touch_done;
1075 int rl_side_touch;
1076 int statmbd;
1077 pthread_mutex_t slock;
1078 pthread_cond_t scond;
1079 pthread_mutex_t tlock;
1080 pthread_cond_t tcond;
1081 pthread_mutex_t tdlock;
1082 pthread_cond_t tdcond;
1083 int ed_ppe_threads;
1084 int threads;
1085 int smt;
1086 int acdpb_cnt;
1087 int reldpb_cnt;
1088 int sb_size;
1089 SliceBufferEntry *sb;
1090 int free_sb_cnt;
1091 int slice_bufs;
1092 int max_dpb_cnt;
1093 DecodedPicture *dpb;
1094 int free_dpb_cnt;
1095 int ifile;
1096 int ofile;
1097 int frame_width;
1098 int frame_height;
1099 int num_frames;
1100 int width;
1101 int height;
1102 int mb_width;
1103 int mb_height;
1104 int mb_stride;
1105 int b4_stride;
1106 int b_stride;
1107 int smb_height;
1108 int smb_width;
1109 pthread_mutex_t smb_lock;
1110 pthread_cond_t sdl_cond;
1111 pthread_mutex_t sdl_lock;
1112 SuperMBContext *smbc;
1113 int wave_order;
1114 int static_3d;
1115 int pipe_bufs;
1116 uint8_t zigzag_scan[16];
1117 uint8_t zigzag_scan8x8[64];
1118 int verbose;
1119 int no_mbd;
1120 int display;
1121 int fullscreen;
1122 int quit;
1123 struct timespec start_time[4];
1124 struct timespec end_time[4];
1125 double last_time[4];
1126 double total_time[4];
1127 };
1128 void av_read_frame_internal(ParserContext *pc, GetBitContext *gb);
1129 int decode_nal_units(NalContext *n, H264Slice *s, GetBitContext *gb);
1130 static void parse_task(H264Context *h, ParserContext *pc, NalContext *nc, SliceBufferEntry *sbe)
1132 H264Slice *s;
1133 if (!(*sbe).initialized)
1136 init_sb_entry(h, sbe);
1137 (*sbe).lines_total = (*h).mb_height;
1140 av_read_frame_internal(pc, &(*sbe).gb);
1141 s = &(*sbe).slice;
1142 decode_nal_units(nc, s, &(*sbe).gb);
1144 struct EntropyContext;
1145 typedef struct EntropyContext EntropyContext;
1146 struct EntropyContext
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);
1204 void ff_h264_init_cabac_states(EntropyContext *ec, H264Slice *s, CABACContext *c);
1205 int init_entropy_buf(EntropyContext *ec, H264Slice *s, int line);
1206 struct H264Mb
1208 int16_t mb_x;
1209 int16_t mb_y;
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
1220 struct
1222 __attribute__((aligned(8))) int8_t ref_index[2][4];
1223 __attribute__((aligned(16))) int16_t mvd[2][16][2];
1224 };
1225 struct
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)
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)
1249 av_log(16, "Only cabac encoded streams are supported\n");
1250 return ;
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++)
1264 init_entropy_buf(ec, s, j);
1265 for (i = 0; i < (*ec).mb_width; i++)
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)
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 ;
1289 struct MBRecContext;
1290 typedef struct MBRecContext MBRecContext;
1291 struct SuperMBTask;
1292 typedef struct SuperMBTask SuperMBTask;
1293 struct SuperMBContext
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
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
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
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
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
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 };
1439 void h264_decode_mb_internal(MBRecContext *d, MBRecState *mrs, H264Slice *s, H264Mb *m);
1440 static void decode_super_mb_block(MBRecContext *d, H264Slice *s, SuperMBContext *smbc, H264Mb *mbs, int smb_x, int smb_y)
1442 MBRecState mrs;
1443 for (int k = 0, i = smb_y; i < smb_y + (*smbc).smb_height; (i++, k++))
1446 init_mbrec_context(d, &mrs, s, i);
1447 for (int j = smb_x - k; j < smb_x - k + (*smbc).smb_width; j++)
1450 if ((i < (*d).mb_height && j >= 0) && j < (*d).mb_width)
1453 h264_decode_mb_internal(d, &mrs, s, &mbs[i * (*d).mb_width + j]);
1461 struct SuperMBTask
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)
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);
1472 void draw_edges(MBRecContext *d, H264Slice *s, int line);
1473 static void draw_edges_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *sm, int line)
1475 H264Slice *s = &(*sbe).slice;
1476 for (int i = line * (*smbc).smb_height; i < (line + 1) * (*smbc).smb_height && i < (*d).mb_height; i++)
1478 draw_edges(d, s, i);
1481 SuperMBContext *acquire_smbc(H264Context *h);
1482 enum mcc_enum_anon_8
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
1494 void (*outline)(void *);
1495 };
1496 typedef struct mcc_struct_anon_20 nanos_smp_args_t;
1497 struct nanos_args_0_t
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
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
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
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
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
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
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
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
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
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
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);
1613 void release_smbc(H264Context *h, SuperMBContext *smbc);
1614 static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe)
1616 int j;
1617 int i;
1618 SuperMBTask *sml;
1619 SuperMBTask *smur;
1620 SuperMBContext *smbc = acquire_smbc(h);
1621 int smb_height = (*smbc).nsmb_height;
1622 int smb_width = (*smbc).nsmb_width;
1623 SuperMBTask *smbs = (*smbc).smbs[0];
1624 SuperMBTask *sm = (void *)0;
1625 for (j = 0; j < smb_height; j++)
1628 nanos_err_t mcc_err_in_final_1;
1629 _Bool mcc_is_in_final_1;
1630 for (i = 0; i < smb_width; i++)
1633 nanos_err_t mcc_err_in_final_0;
1634 _Bool mcc_is_in_final_0;
1635 sm = smbs + j * smb_width + i;
1636 sml = sm - (i > 0 ? 1 : 0);
1637 smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0);
1638 mcc_err_in_final_0 = nanos_in_final(&mcc_is_in_final_0);
1640 MBRecContext *mcc_arg_0 = d;
1641 SliceBufferEntry *mcc_arg_1 = sbe;
1642 SuperMBContext *mcc_arg_2 = smbc;
1643 SuperMBTask *mcc_arg_3 = sml;
1644 SuperMBTask *mcc_arg_4 = smur;
1645 SuperMBTask *mcc_arg_5 = sm;
1646 if (mcc_is_in_final_0)
1648 decode_super_mb_task(d, sbe, smbc, sml, smur, sm);
1650 else
1653 nanos_wd_dyn_props_t nanos_wd_dyn_props;
1654 struct nanos_args_0_t *ol_args;
1655 nanos_err_t err;
1656 struct nanos_args_0_t imm_args;
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 };
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)
1667 nanos_handle_error(err);
1669 /* Check pendant writes on subexpressions */
1670 /* End check pendant writes on subexpressions */
1671 if (nanos_wd_ != (void *)0)
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 } };
1687 err = nanos_submit(nanos_wd_, 5, dependences, (void *)0);
1688 if (err != NANOS_OK)
1690 nanos_handle_error(err);
1694 else
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 } };
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)
1713 nanos_handle_error(err);
1722 mcc_err_in_final_1 = nanos_in_final(&mcc_is_in_final_1);
1724 MBRecContext *mcc_arg_6 = d;
1725 SliceBufferEntry *mcc_arg_7 = sbe;
1726 SuperMBContext *mcc_arg_8 = smbc;
1727 SuperMBTask *mcc_arg_9 = sm;
1728 int mcc_arg_10 = j;
1729 if (mcc_is_in_final_1)
1731 draw_edges_task(d, sbe, smbc, sm, j);
1733 else
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)
1750 nanos_handle_error(err);
1752 /* Check pendant writes on subexpressions */
1753 /* End check pendant writes on subexpressions */
1754 if (nanos_wd_ != (void *)0)
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 } };
1767 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
1768 if (err != NANOS_OK)
1770 nanos_handle_error(err);
1774 else
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 } };
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)
1790 nanos_handle_error(err);
1800 nanos_region_dimension_t dimensions_0[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
1801 nanos_data_access_t dependences[1] = { { (void *)sm, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } };
1803 nanos_err_t err = nanos_wait_on(1, dependences);
1804 if (err != NANOS_OK)
1806 nanos_handle_error(err);
1809 release_smbc(h, smbc);
1811 struct DecodedPicture
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
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
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)
1848 H264Slice *s = &(*sbe).slice;
1849 for (int i = 0; i < 2; i++)
1852 for (int j = 0; j < (*s).ref_count[i]; j++)
1855 int k;
1856 if ((*s).ref_list_cpn[i][j] == -1)
1858 continue;
1860 for (k = 0; k < (*h).max_dpb_cnt; k++)
1863 if ((*h).dpb[k].reference >= 2 && (*h).dpb[k].cpn == (*s).ref_list_cpn[i][j])
1866 (*s).dp_ref_list[i][j] = &(*h).dpb[k];
1867 break;
1877 nanos_err_t err;
1878 err = nanos_set_lock(&nanos_critical_lock_dpb);
1879 if (err != NANOS_OK)
1881 nanos_handle_error(err);
1883 get_dpb_entry(h, s);
1884 err = nanos_unset_lock(&nanos_critical_lock_dpb);
1885 if (err != NANOS_OK)
1887 nanos_handle_error(err);
1890 if (!(*h).no_mbd)
1893 decode_mb_in_slice(h, d, sbe);
1896 for (int i = 0; i < (*s).release_cnt; i++)
1899 for (int j = 0; j < (*h).max_dpb_cnt; j++)
1902 if ((*h).dpb[j].cpn == (*s).release_ref_cpn[i])
1906 nanos_err_t err;
1907 err = nanos_set_lock(&nanos_critical_lock_dpb);
1908 if (err != NANOS_OK)
1910 nanos_handle_error(err);
1912 release_dpb_entry(h, &(*h).dpb[j], 2);
1913 err = nanos_unset_lock(&nanos_critical_lock_dpb);
1914 if (err != NANOS_OK)
1916 nanos_handle_error(err);
1919 break;
1926 (*s).release_cnt = 0;
1928 static void decode_3dwave_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *mprev, SuperMBTask *m)
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);
1934 static void init_ref_list_and_get_dpb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe, int *init)
1936 H264Slice *s = &(*sbe).slice;
1937 for (int i = 0; i < 2; i++)
1940 for (int j = 0; j < (*s).ref_count[i]; j++)
1943 int k;
1944 if ((*s).ref_list_cpn[i][j] == -1)
1946 continue;
1948 for (k = 0; k < (*h).max_dpb_cnt; k++)
1951 if ((*h).dpb[k].reference >= 2 && (*h).dpb[k].cpn == (*s).ref_list_cpn[i][j])
1954 (*s).dp_ref_list[i][j] = &(*h).dpb[k];
1955 break;
1965 nanos_err_t err;
1966 err = nanos_set_lock(&nanos_critical_lock_dpb);
1967 if (err != NANOS_OK)
1969 nanos_handle_error(err);
1971 get_dpb_entry(h, s);
1972 err = nanos_unset_lock(&nanos_critical_lock_dpb);
1973 if (err != NANOS_OK)
1975 nanos_handle_error(err);
1979 struct nanos_args_2_t
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
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
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
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)
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++)
2036 nanos_err_t mcc_err_in_final_3;
2037 _Bool mcc_is_in_final_3;
2038 for (i = 0; i < smb_width; i++)
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);
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)
2058 decode_3dwave_super_mb_task(d, sbe, smbc, sml, smur, smprev, sm);
2060 else
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)
2077 nanos_handle_error(err);
2079 /* Check pendant writes on subexpressions */
2080 /* End check pendant writes on subexpressions */
2081 if (nanos_wd_ != (void *)0)
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 } };
2099 err = nanos_submit(nanos_wd_, 6, dependences, (void *)0);
2100 if (err != NANOS_OK)
2102 nanos_handle_error(err);
2106 else
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 } };
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)
2127 nanos_handle_error(err);
2136 mcc_err_in_final_3 = nanos_in_final(&mcc_is_in_final_3);
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)
2145 draw_edges_task(d, sbe, smbc, sm, j);
2147 else
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)
2164 nanos_handle_error(err);
2166 /* Check pendant writes on subexpressions */
2167 /* End check pendant writes on subexpressions */
2168 if (nanos_wd_ != (void *)0)
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 } };
2181 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
2182 if (err != NANOS_OK)
2184 nanos_handle_error(err);
2188 else
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 } };
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)
2204 nanos_handle_error(err);
2213 for (; j < smb_height; j++)
2216 nanos_err_t mcc_err_in_final_5;
2217 _Bool mcc_is_in_final_5;
2218 for (i = 0; i < smb_width; i++)
2221 nanos_err_t mcc_err_in_final_4;
2222 _Bool mcc_is_in_final_4;
2223 sm = smbs + j * smb_width + i;
2224 sml = sm - (i > 0 ? 1 : 0);
2225 smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0);
2226 mcc_err_in_final_4 = nanos_in_final(&mcc_is_in_final_4);
2228 MBRecContext *mcc_arg_23 = d;
2229 SliceBufferEntry *mcc_arg_24 = sbe;
2230 SuperMBContext *mcc_arg_25 = smbc;
2231 SuperMBTask *mcc_arg_26 = sml;
2232 SuperMBTask *mcc_arg_27 = smur;
2233 SuperMBTask *mcc_arg_28 = sm;
2234 if (mcc_is_in_final_4)
2236 decode_super_mb_task(d, sbe, smbc, sml, smur, sm);
2238 else
2241 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2242 struct nanos_args_4_t *ol_args;
2243 nanos_err_t err;
2244 struct nanos_args_4_t imm_args;
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 };
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 } } };
2247 nanos_wd_dyn_props.tie_to = 0;
2248 nanos_wd_dyn_props.priority = 0;
2249 nanos_wd_dyn_props.flags.is_final = 0;
2250 ol_args = (struct nanos_args_4_t *)0;
2251 void *nanos_wd_ = (void *)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);
2253 if (err != NANOS_OK)
2255 nanos_handle_error(err);
2257 /* Check pendant writes on subexpressions */
2258 /* End check pendant writes on subexpressions */
2259 if (nanos_wd_ != (void *)0)
2262 (*ol_args).d = mcc_arg_23;
2263 (*ol_args).sbe = mcc_arg_24;
2264 (*ol_args).smbc = mcc_arg_25;
2265 (*ol_args).ml = mcc_arg_26;
2266 (*ol_args).mur = mcc_arg_27;
2267 (*ol_args).m = mcc_arg_28;
2268 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2269 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2270 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2271 nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
2272 nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
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 } };
2275 err = nanos_submit(nanos_wd_, 5, dependences, (void *)0);
2276 if (err != NANOS_OK)
2278 nanos_handle_error(err);
2282 else
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 } };
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)
2301 nanos_handle_error(err);
2310 mcc_err_in_final_5 = nanos_in_final(&mcc_is_in_final_5);
2312 MBRecContext *mcc_arg_29 = d;
2313 SliceBufferEntry *mcc_arg_30 = sbe;
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)
2319 draw_edges_task(d, sbe, smbc, sm, j);
2321 else
2324 nanos_wd_dyn_props_t nanos_wd_dyn_props;
2325 struct nanos_args_5_t *ol_args;
2326 nanos_err_t err;
2327 struct nanos_args_5_t imm_args;
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 };
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 } } };
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)
2338 nanos_handle_error(err);
2340 /* Check pendant writes on subexpressions */
2341 /* End check pendant writes on subexpressions */
2342 if (nanos_wd_ != (void *)0)
2345 (*ol_args).d = mcc_arg_29;
2346 (*ol_args).sbe = mcc_arg_30;
2347 (*ol_args).smbc = mcc_arg_31;
2348 (*ol_args).sm = mcc_arg_32;
2349 (*ol_args).line = mcc_arg_33;
2350 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2351 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2352 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
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 } };
2355 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
2356 if (err != NANOS_OK)
2358 nanos_handle_error(err);
2362 else
2365 imm_args.d = mcc_arg_29;
2366 imm_args.sbe = mcc_arg_30;
2367 imm_args.smbc = mcc_arg_31;
2368 imm_args.sm = mcc_arg_32;
2369 imm_args.line = mcc_arg_33;
2370 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
2371 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
2372 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
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 } };
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);
2376 if (err != NANOS_OK)
2378 nanos_handle_error(err);
2387 return sm;
2389 static void release_ref_list_task(H264Context *h, SuperMBContext *smbc, MBRecContext *d, SliceBufferEntry *sbe, SuperMBTask *lastsmb, int *release)
2391 H264Slice *s = &(*sbe).slice;
2392 for (int i = 0; i < (*s).release_cnt; i++)
2395 for (int j = 0; j < (*h).max_dpb_cnt; j++)
2398 if ((*h).dpb[j].cpn == (*s).release_ref_cpn[i])
2402 nanos_err_t err;
2403 err = nanos_set_lock(&nanos_critical_lock_dpb);
2404 if (err != NANOS_OK)
2406 nanos_handle_error(err);
2408 release_dpb_entry(h, &(*h).dpb[j], 2);
2409 err = nanos_unset_lock(&nanos_critical_lock_dpb);
2410 if (err != NANOS_OK)
2412 nanos_handle_error(err);
2415 break;
2422 (*s).release_cnt = 0;
2423 release_smbc(h, smbc);
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)
2430 DecodedPicture *out = output_frame(h, oc, (*sbe).slice.curr_pic, (*h).ofile, (*h).frame_width, (*h).frame_height);
2431 if (out)
2435 nanos_err_t err;
2436 err = nanos_set_lock(&nanos_critical_lock_dpb);
2437 if (err != NANOS_OK)
2439 nanos_handle_error(err);
2441 release_dpb_entry(h, out, 1);
2442 err = nanos_unset_lock(&nanos_critical_lock_dpb);
2443 if (err != NANOS_OK)
2445 nanos_handle_error(err);
2451 void *av_mallocz(unsigned int size)__attribute__((__malloc__));
2452 ParserContext *get_parse_context(int ifile);
2453 NalContext *get_nal_context(int width, int height);
2454 EntropyContext *get_entropy_context(H264Context *h);
2455 MBRecContext *get_mbrec_context(H264Context *h);
2456 OutputContext *get_output_context(H264Context *h);
2457 void av_start_timer();
2458 struct ParserContext
2460 int ifile;
2461 int ofile;
2462 int buffer_size;
2463 int eof_reached;
2464 uint8_t *data;
2465 int size;
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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++)
2784 ec[i] = get_entropy_context(h);
2787 for (int i = 0; i < 2; i++)
2790 rc[i] = get_mbrec_context(h);
2793 oc = get_output_context(h);
2794 av_start_timer();
2795 int k = 0;
2796 if ((*h).static_3d && bufs < (*h).num_frames)
2799 int num_pre_ed = 0;
2800 for (num_pre_ed = 0; num_pre_ed < bufs - 1 && !(*pc).final_frame; num_pre_ed++)
2803 nanos_err_t mcc_err_in_final_6;
2804 _Bool mcc_is_in_final_6;
2805 nanos_err_t mcc_err_in_final_7;
2806 _Bool mcc_is_in_final_7;
2807 mcc_err_in_final_6 = nanos_in_final(&mcc_is_in_final_6);
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)
2815 parse_task(h, pc, nc, &sbe[k % bufs]);
2817 else
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)
2834 nanos_handle_error(err);
2836 /* Check pendant writes on subexpressions */
2837 /* End check pendant writes on subexpressions */
2838 if (nanos_wd_ != (void *)0)
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 } };
2850 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
2851 if (err != NANOS_OK)
2853 nanos_handle_error(err);
2857 else
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 } };
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)
2872 nanos_handle_error(err);
2879 mcc_err_in_final_7 = nanos_in_final(&mcc_is_in_final_7);
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)
2886 decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]);
2888 else
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)
2905 nanos_handle_error(err);
2907 /* Check pendant writes on subexpressions */
2908 /* End check pendant writes on subexpressions */
2909 if (nanos_wd_ != (void *)0)
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 } };
2919 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
2920 if (err != NANOS_OK)
2922 nanos_handle_error(err);
2926 else
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 } };
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)
2939 nanos_handle_error(err);
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 } };
2950 nanos_err_t err = nanos_wait_on(1, dependences);
2951 if (err != NANOS_OK)
2953 nanos_handle_error(err);
2956 k++;
2959 while ((!(*pc).final_frame && frames++ < (*h).num_frames) && !(*h).quit)
2962 nanos_err_t mcc_err_in_final_8;
2963 _Bool mcc_is_in_final_8;
2964 nanos_err_t mcc_err_in_final_9;
2965 _Bool mcc_is_in_final_9;
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);
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)
2980 parse_task(h, pc, nc, &sbe[k % bufs]);
2982 else
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)
2999 nanos_handle_error(err);
3001 /* Check pendant writes on subexpressions */
3002 /* End check pendant writes on subexpressions */
3003 if (nanos_wd_ != (void *)0)
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 } };
3015 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3016 if (err != NANOS_OK)
3018 nanos_handle_error(err);
3022 else
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 } };
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)
3037 nanos_handle_error(err);
3044 mcc_err_in_final_9 = nanos_in_final(&mcc_is_in_final_9);
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)
3051 decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]);
3053 else
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)
3070 nanos_handle_error(err);
3072 /* Check pendant writes on subexpressions */
3073 /* End check pendant writes on subexpressions */
3074 if (nanos_wd_ != (void *)0)
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 } };
3084 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3085 if (err != NANOS_OK)
3087 nanos_handle_error(err);
3091 else
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 } };
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)
3104 nanos_handle_error(err);
3111 k++;
3112 mcc_err_in_final_10 = nanos_in_final(&mcc_is_in_final_10);
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)
3120 init_ref_list_and_get_dpb_task(h, rc[k % 2], &sbe[k % bufs], &init);
3122 else
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)
3139 nanos_handle_error(err);
3141 /* Check pendant writes on subexpressions */
3142 /* End check pendant writes on subexpressions */
3143 if (nanos_wd_ != (void *)0)
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 } };
3155 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3156 if (err != NANOS_OK)
3158 nanos_handle_error(err);
3162 else
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 } };
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)
3177 nanos_handle_error(err);
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);
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)
3196 release_ref_list_task(h, smbc, rc[k % 2], &sbe[k % bufs], lastsmb, &release);
3198 else
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)
3215 nanos_handle_error(err);
3217 /* Check pendant writes on subexpressions */
3218 /* End check pendant writes on subexpressions */
3219 if (nanos_wd_ != (void *)0)
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 } };
3234 err = nanos_submit(nanos_wd_, 4, dependences, (void *)0);
3235 if (err != NANOS_OK)
3237 nanos_handle_error(err);
3241 else
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 } };
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)
3259 nanos_handle_error(err);
3266 mcc_err_in_final_12 = nanos_in_final(&mcc_is_in_final_12);
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)
3273 output_task(h, oc, &sbe[k % bufs]);
3275 else
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)
3292 nanos_handle_error(err);
3294 /* Check pendant writes on subexpressions */
3295 /* End check pendant writes on subexpressions */
3296 if (nanos_wd_ != (void *)0)
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 } };
3306 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3307 if (err != NANOS_OK)
3309 nanos_handle_error(err);
3313 else
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 } };
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)
3326 nanos_handle_error(err);
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 } };
3337 nanos_err_t err = nanos_wait_on(1, dependences);
3338 if (err != NANOS_OK)
3340 nanos_handle_error(err);
3345 for (int i = 0; i < num_pre_ed; i++)
3348 nanos_err_t mcc_err_in_final_13;
3349 _Bool mcc_is_in_final_13;
3350 nanos_err_t mcc_err_in_final_14;
3351 _Bool mcc_is_in_final_14;
3352 nanos_err_t mcc_err_in_final_15;
3353 _Bool mcc_is_in_final_15;
3354 k++;
3355 mcc_err_in_final_13 = nanos_in_final(&mcc_is_in_final_13);
3357 H264Context *mcc_arg_61 = h;
3358 MBRecContext *mcc_arg_62 = rc[k % 2];
3359 SliceBufferEntry *mcc_arg_63 = &sbe[k % bufs];
3360 int *mcc_arg_64 = &init;
3361 if (mcc_is_in_final_13)
3363 init_ref_list_and_get_dpb_task(h, rc[k % 2], &sbe[k % bufs], &init);
3365 else
3368 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3369 struct nanos_args_13_t *ol_args;
3370 nanos_err_t err;
3371 struct nanos_args_13_t imm_args;
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 };
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 } } };
3374 nanos_wd_dyn_props.tie_to = 0;
3375 nanos_wd_dyn_props.priority = 0;
3376 nanos_wd_dyn_props.flags.is_final = 0;
3377 ol_args = (struct nanos_args_13_t *)0;
3378 void *nanos_wd_ = (void *)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);
3380 if (err != NANOS_OK)
3382 nanos_handle_error(err);
3384 /* Check pendant writes on subexpressions */
3385 /* End check pendant writes on subexpressions */
3386 if (nanos_wd_ != (void *)0)
3389 (*ol_args).h = mcc_arg_61;
3390 (*ol_args).d = mcc_arg_62;
3391 (*ol_args).sbe = mcc_arg_63;
3392 (*ol_args).init = mcc_arg_64;
3393 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3394 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3395 nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } };
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 } };
3398 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3399 if (err != NANOS_OK)
3401 nanos_handle_error(err);
3405 else
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 } };
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)
3420 nanos_handle_error(err);
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);
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)
3439 release_ref_list_task(h, smbc, rc[k % 2], &sbe[k % bufs], lastsmb, &release);
3441 else
3444 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3445 struct nanos_args_14_t *ol_args;
3446 nanos_err_t err;
3447 struct nanos_args_14_t imm_args;
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 };
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 } } };
3450 nanos_wd_dyn_props.tie_to = 0;
3451 nanos_wd_dyn_props.priority = 0;
3452 nanos_wd_dyn_props.flags.is_final = 0;
3453 ol_args = (struct nanos_args_14_t *)0;
3454 void *nanos_wd_ = (void *)0;
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);
3456 if (err != NANOS_OK)
3458 nanos_handle_error(err);
3460 /* Check pendant writes on subexpressions */
3461 /* End check pendant writes on subexpressions */
3462 if (nanos_wd_ != (void *)0)
3465 (*ol_args).h = mcc_arg_65;
3466 (*ol_args).smbc = mcc_arg_66;
3467 (*ol_args).d = mcc_arg_67;
3468 (*ol_args).sbe = mcc_arg_68;
3469 (*ol_args).lastsmb = mcc_arg_69;
3470 (*ol_args).release = mcc_arg_70;
3471 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3472 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3473 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
3474 nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } };
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 } };
3477 err = nanos_submit(nanos_wd_, 4, dependences, (void *)0);
3478 if (err != NANOS_OK)
3480 nanos_handle_error(err);
3484 else
3487 imm_args.h = mcc_arg_65;
3488 imm_args.smbc = mcc_arg_66;
3489 imm_args.d = mcc_arg_67;
3490 imm_args.sbe = mcc_arg_68;
3491 imm_args.lastsmb = mcc_arg_69;
3492 imm_args.release = mcc_arg_70;
3493 nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } };
3494 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
3495 nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } };
3496 nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } };
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 } };
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);
3500 if (err != NANOS_OK)
3502 nanos_handle_error(err);
3509 mcc_err_in_final_15 = nanos_in_final(&mcc_is_in_final_15);
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)
3516 output_task(h, oc, &sbe[k % bufs]);
3518 else
3521 nanos_wd_dyn_props_t nanos_wd_dyn_props;
3522 struct nanos_args_15_t *ol_args;
3523 nanos_err_t err;
3524 struct nanos_args_15_t imm_args;
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 };
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 } } };
3527 nanos_wd_dyn_props.tie_to = 0;
3528 nanos_wd_dyn_props.priority = 0;
3529 nanos_wd_dyn_props.flags.is_final = 0;
3530 ol_args = (struct nanos_args_15_t *)0;
3531 void *nanos_wd_ = (void *)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);
3533 if (err != NANOS_OK)
3535 nanos_handle_error(err);
3537 /* Check pendant writes on subexpressions */
3538 /* End check pendant writes on subexpressions */
3539 if (nanos_wd_ != (void *)0)
3542 (*ol_args).h = mcc_arg_71;
3543 (*ol_args).oc = mcc_arg_72;
3544 (*ol_args).sbe = mcc_arg_73;
3545 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
3546 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
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 } };
3549 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3550 if (err != NANOS_OK)
3552 nanos_handle_error(err);
3556 else
3559 imm_args.h = mcc_arg_71;
3560 imm_args.oc = mcc_arg_72;
3561 imm_args.sbe = mcc_arg_73;
3562 nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } };
3563 nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } };
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 } };
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);
3567 if (err != NANOS_OK)
3569 nanos_handle_error(err);
3580 else
3583 while ((!(*pc).final_frame && frames++ < (*h).num_frames) && !(*h).quit)
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);
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)
3602 parse_task(h, pc, nc, &sbe[k % bufs]);
3604 else
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)
3621 nanos_handle_error(err);
3623 /* Check pendant writes on subexpressions */
3624 /* End check pendant writes on subexpressions */
3625 if (nanos_wd_ != (void *)0)
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 } };
3637 err = nanos_submit(nanos_wd_, 3, dependences, (void *)0);
3638 if (err != NANOS_OK)
3640 nanos_handle_error(err);
3644 else
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 } };
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)
3659 nanos_handle_error(err);
3666 mcc_err_in_final_17 = nanos_in_final(&mcc_is_in_final_17);
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)
3673 decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]);
3675 else
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)
3692 nanos_handle_error(err);
3694 /* Check pendant writes on subexpressions */
3695 /* End check pendant writes on subexpressions */
3696 if (nanos_wd_ != (void *)0)
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 } };
3706 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3707 if (err != NANOS_OK)
3709 nanos_handle_error(err);
3713 else
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 } };
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)
3726 nanos_handle_error(err);
3733 mcc_err_in_final_18 = nanos_in_final(&mcc_is_in_final_18);
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)
3740 decode_slice_mb_task(h, rc[0], &sbe[k % bufs]);
3742 else
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)
3759 nanos_handle_error(err);
3761 /* Check pendant writes on subexpressions */
3762 /* End check pendant writes on subexpressions */
3763 if (nanos_wd_ != (void *)0)
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 } };
3773 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3774 if (err != NANOS_OK)
3776 nanos_handle_error(err);
3780 else
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 } };
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)
3793 nanos_handle_error(err);
3800 mcc_err_in_final_19 = nanos_in_final(&mcc_is_in_final_19);
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)
3807 output_task(h, oc, &sbe[k % bufs]);
3809 else
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)
3826 nanos_handle_error(err);
3828 /* Check pendant writes on subexpressions */
3829 /* End check pendant writes on subexpressions */
3830 if (nanos_wd_ != (void *)0)
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 } };
3840 err = nanos_submit(nanos_wd_, 2, dependences, (void *)0);
3841 if (err != NANOS_OK)
3843 nanos_handle_error(err);
3847 else
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 } };
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)
3860 nanos_handle_error(err);
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 } };
3871 nanos_err_t err = nanos_wait_on(1, dependences);
3872 if (err != NANOS_OK)
3874 nanos_handle_error(err);
3877 k++;
3883 nanos_err_t err;
3884 void *nanos_wd_ = nanos_current_wd();
3885 err = nanos_wg_wait_completion(nanos_wd_, 0);
3886 if (err != NANOS_OK)
3888 nanos_handle_error(err);
3891 while ((out = output_frame(h, oc, (void *)0, (*h).ofile, (*h).frame_width, (*h).frame_height)))
3895 (*h).num_frames = (*oc).frame_number;
3896 free_parse_context(pc);
3897 free_nal_context(nc);
3898 free_output_context(oc);
3899 for (int i = 0; i < bufs; i++)
3902 free_sb_entry(&sbe[i]);
3903 free_entropy_context(ec[i]);
3906 av_free(sbe);
3907 for (int i = 0; i < 2; i++)
3910 free_mbrec_context(rc[i]);
3913 return 0;
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)
3918 decode_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*m));
3921 static void smp_ol_decode_super_mb_task_1(struct nanos_args_0_t *const args)
3924 smp_ol_decode_super_mb_task_1_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).m));
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)
3930 draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line));
3933 static void smp_ol_draw_edges_task_3(struct nanos_args_1_t *const args)
3936 smp_ol_draw_edges_task_3_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line));
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)
3942 decode_3dwave_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*mprev), (*m));
3945 static void smp_ol_decode_3dwave_super_mb_task_5(struct nanos_args_2_t *const args)
3948 smp_ol_decode_3dwave_super_mb_task_5_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).mprev), &((*args).m));
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)
3954 draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line));
3957 static void smp_ol_draw_edges_task_7(struct nanos_args_3_t *const args)
3960 smp_ol_draw_edges_task_7_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line));
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)
3966 decode_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*m));
3969 static void smp_ol_decode_super_mb_task_9(struct nanos_args_4_t *const args)
3972 smp_ol_decode_super_mb_task_9_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).m));
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)
3978 draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line));
3981 static void smp_ol_draw_edges_task_11(struct nanos_args_5_t *const args)
3984 smp_ol_draw_edges_task_11_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line));
3987 static void smp_ol_parse_task_13_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe)
3990 parse_task((*h), (*pc), (*nc), (*sbe));
3993 static void smp_ol_parse_task_13(struct nanos_args_6_t *const args)
3996 smp_ol_parse_task_13_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe));
3999 static void smp_ol_decode_slice_entropy_task_15_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe)
4002 decode_slice_entropy_task((*h), (*ec), (*sbe));
4005 static void smp_ol_decode_slice_entropy_task_15(struct nanos_args_7_t *const args)
4008 smp_ol_decode_slice_entropy_task_15_unpacked(&((*args).h), &((*args).ec), &((*args).sbe));
4011 static void smp_ol_parse_task_17_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe)
4014 parse_task((*h), (*pc), (*nc), (*sbe));
4017 static void smp_ol_parse_task_17(struct nanos_args_8_t *const args)
4020 smp_ol_parse_task_17_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe));
4023 static void smp_ol_decode_slice_entropy_task_19_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe)
4026 decode_slice_entropy_task((*h), (*ec), (*sbe));
4029 static void smp_ol_decode_slice_entropy_task_19(struct nanos_args_9_t *const args)
4032 smp_ol_decode_slice_entropy_task_19_unpacked(&((*args).h), &((*args).ec), &((*args).sbe));
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)
4038 init_ref_list_and_get_dpb_task((*h), (*d), (*sbe), (*init));
4041 static void smp_ol_init_ref_list_and_get_dpb_task_21(struct nanos_args_10_t *const args)
4044 smp_ol_init_ref_list_and_get_dpb_task_21_unpacked(&((*args).h), &((*args).d), &((*args).sbe), &((*args).init));
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)
4050 release_ref_list_task((*h), (*smbc), (*d), (*sbe), (*lastsmb), (*release));
4053 static void smp_ol_release_ref_list_task_23(struct nanos_args_11_t *const args)
4056 smp_ol_release_ref_list_task_23_unpacked(&((*args).h), &((*args).smbc), &((*args).d), &((*args).sbe), &((*args).lastsmb), &((*args).release));
4059 static void smp_ol_output_task_25_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe)
4062 output_task((*h), (*oc), (*sbe));
4065 static void smp_ol_output_task_25(struct nanos_args_12_t *const args)
4068 smp_ol_output_task_25_unpacked(&((*args).h), &((*args).oc), &((*args).sbe));
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)
4074 init_ref_list_and_get_dpb_task((*h), (*d), (*sbe), (*init));
4077 static void smp_ol_init_ref_list_and_get_dpb_task_27(struct nanos_args_13_t *const args)
4080 smp_ol_init_ref_list_and_get_dpb_task_27_unpacked(&((*args).h), &((*args).d), &((*args).sbe), &((*args).init));
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)
4086 release_ref_list_task((*h), (*smbc), (*d), (*sbe), (*lastsmb), (*release));
4089 static void smp_ol_release_ref_list_task_29(struct nanos_args_14_t *const args)
4092 smp_ol_release_ref_list_task_29_unpacked(&((*args).h), &((*args).smbc), &((*args).d), &((*args).sbe), &((*args).lastsmb), &((*args).release));
4095 static void smp_ol_output_task_31_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe)
4098 output_task((*h), (*oc), (*sbe));
4101 static void smp_ol_output_task_31(struct nanos_args_15_t *const args)
4104 smp_ol_output_task_31_unpacked(&((*args).h), &((*args).oc), &((*args).sbe));
4107 static void smp_ol_parse_task_33_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe)
4110 parse_task((*h), (*pc), (*nc), (*sbe));
4113 static void smp_ol_parse_task_33(struct nanos_args_16_t *const args)
4116 smp_ol_parse_task_33_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe));
4119 static void smp_ol_decode_slice_entropy_task_35_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe)
4122 decode_slice_entropy_task((*h), (*ec), (*sbe));
4125 static void smp_ol_decode_slice_entropy_task_35(struct nanos_args_17_t *const args)
4128 smp_ol_decode_slice_entropy_task_35_unpacked(&((*args).h), &((*args).ec), &((*args).sbe));
4131 static void smp_ol_decode_slice_mb_task_37_unpacked(H264Context **const h, MBRecContext **const d, SliceBufferEntry **const sbe)
4134 decode_slice_mb_task((*h), (*d), (*sbe));
4137 static void smp_ol_decode_slice_mb_task_37(struct nanos_args_18_t *const args)
4140 smp_ol_decode_slice_mb_task_37_unpacked(&((*args).h), &((*args).d), &((*args).sbe));
4143 static void smp_ol_output_task_39_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe)
4146 output_task((*h), (*oc), (*sbe));
4149 static void smp_ol_output_task_39(struct nanos_args_19_t *const args)
4152 smp_ol_output_task_39_unpacked(&((*args).h), &((*args).oc), &((*args).sbe));
4155 typedef void nanos_init_func_t(void *);
4156 struct mcc_struct_anon_22
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 };