# HG changeset patch # User Nina Engelhardt # Date 1376392377 -7200 # Node ID 4d1f822304492f7365e0742f769d62ca7e6dde2f # Parent ea1ba68cf0ed9342daeca9df88fe6f174ce9f9b0 preprocessed source from newer mercurial ver. diff -r ea1ba68cf0ed -r 4d1f82230449 libavcodec/sscc_h264_ompss.c --- a/libavcodec/sscc_h264_ompss.c Wed Jun 05 14:43:26 2013 +0200 +++ b/libavcodec/sscc_h264_ompss.c Tue Aug 13 13:12:57 2013 +0200 @@ -1,8547 +1,4163 @@ -const char *__nanos_family __attribute__((weak)) = "master"; -int __nanos_version __attribute__((weak)) = 5015; -int __mcc_master __attribute__((weak)) = 5015; -int __mcc_openmp __attribute__((weak)) = 5; -int __mcc_trunk __attribute__((weak)) = 399; -int __mcc_worksharing __attribute__((weak)) = 1000; -typedef unsigned char __u_char; -typedef unsigned short int __u_short; -typedef unsigned int __u_int; -typedef unsigned long int __u_long; -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef signed short int __int16_t; -typedef unsigned short int __uint16_t; -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -typedef signed long int __int64_t; -typedef unsigned long int __uint64_t; -typedef long int __quad_t; -typedef unsigned long int __u_quad_t; -typedef unsigned long int __dev_t; -typedef unsigned int __uid_t; -typedef unsigned int __gid_t; -typedef unsigned long int __ino_t; -typedef unsigned long int __ino64_t; -typedef unsigned int __mode_t; -typedef unsigned long int __nlink_t; -typedef long int __off_t; -typedef long int __off64_t; -typedef int __pid_t; -typedef struct +typedef unsigned int uint32_t; +static __inline __attribute__((always_inline)) uint32_t pack16to32(int a, int b) { - int __val[2]; -} __fsid_t; -typedef long int __clock_t; -typedef unsigned long int __rlim_t; -typedef unsigned long int __rlim64_t; -typedef unsigned int __id_t; -typedef long int __time_t; -typedef unsigned int __useconds_t; -typedef long int __suseconds_t; -typedef int __daddr_t; -typedef long int __swblk_t; -typedef int __key_t; -typedef int __clockid_t; -typedef void *__timer_t; -typedef long int __blksize_t; -typedef long int __blkcnt_t; -typedef long int __blkcnt64_t; -typedef unsigned long int __fsblkcnt_t; -typedef unsigned long int __fsblkcnt64_t; -typedef unsigned long int __fsfilcnt_t; -typedef unsigned long int __fsfilcnt64_t; -typedef long int __ssize_t; -typedef __off64_t __loff_t; -typedef __quad_t *__qaddr_t; -typedef char *__caddr_t; -typedef long int __intptr_t; -typedef unsigned int __socklen_t; -typedef __ssize_t ssize_t; -typedef long unsigned int size_t; -typedef __gid_t gid_t; -typedef __uid_t uid_t; -typedef __off_t off_t; -typedef __useconds_t useconds_t; -typedef __pid_t pid_t; -typedef __intptr_t intptr_t; -typedef __socklen_t socklen_t; -extern int access(__const char *__name, int __type) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int faccessat(int __fd, __const char *__file, int __type, int __flag) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warn_unused_result__)); -extern __off_t lseek(int __fd, __off_t __offset, int __whence) __attribute__((__nothrow__, __leaf__)); -extern int close(int __fd); -extern ssize_t read(int __fd, void *__buf, size_t __nbytes) __attribute__((__warn_unused_result__)); -extern ssize_t write(int __fd, __const void *__buf, size_t __n) __attribute__((__warn_unused_result__)); -extern ssize_t pread(int __fd, void *__buf, size_t __nbytes, __off_t __offset) __attribute__((__warn_unused_result__)); -extern ssize_t pwrite(int __fd, __const void *__buf, size_t __n, __off_t __offset) __attribute__((__warn_unused_result__)); -extern int pipe(int __pipedes[2]) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern unsigned int alarm(unsigned int __seconds) __attribute__((__nothrow__, __leaf__)); -extern unsigned int sleep(unsigned int __seconds); -extern __useconds_t ualarm(__useconds_t __value, __useconds_t __interval) __attribute__((__nothrow__, __leaf__)); -extern int usleep(__useconds_t __useconds); -extern int pause(void); -extern int chown(__const char *__file, __uid_t __owner, __gid_t __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int fchown(int __fd, __uid_t __owner, __gid_t __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int lchown(__const char *__file, __uid_t __owner, __gid_t __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int fchownat(int __fd, __const char *__file, __uid_t __owner, __gid_t __group, int __flag) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warn_unused_result__)); -extern int chdir(__const char *__path) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int fchdir(int __fd) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *getcwd(char *__buf, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *getwd(char *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__deprecated__)) __attribute__((__warn_unused_result__)); -extern int dup(int __fd) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int dup2(int __fd, int __fd2) __attribute__((__nothrow__, __leaf__)); -extern char **__environ; -extern int execve(__const char *__path, char *__const __argv[], char *__const __envp[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int fexecve(int __fd, char *__const __argv[], char *__const __envp[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int execv(__const char *__path, char *__const __argv[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int execle(__const char *__path, __const char *__arg, ...) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int execl(__const char *__path, __const char *__arg, ...) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int execvp(__const char *__file, char *__const __argv[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int execlp(__const char *__file, __const char *__arg, ...) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int nice(int __inc) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void _exit(int __status) __attribute__((__noreturn__)); -enum + return (a & 65535) + (b << 16); +} +typedef unsigned short int uint16_t; +static __inline __attribute__((always_inline)) uint16_t pack8to16(int a, int b) { - _PC_LINK_MAX, - _PC_MAX_CANON, - _PC_MAX_INPUT, - _PC_NAME_MAX, - _PC_PATH_MAX, - _PC_PIPE_BUF, - _PC_CHOWN_RESTRICTED, - _PC_NO_TRUNC, - _PC_VDISABLE, - _PC_SYNC_IO, - _PC_ASYNC_IO, - _PC_PRIO_IO, - _PC_SOCK_MAXBUF, - _PC_FILESIZEBITS, - _PC_REC_INCR_XFER_SIZE, - _PC_REC_MAX_XFER_SIZE, - _PC_REC_MIN_XFER_SIZE, - _PC_REC_XFER_ALIGN, - _PC_ALLOC_SIZE_MIN, - _PC_SYMLINK_MAX, - _PC_2_SYMLINKS + return (a & 255) + (b << 8); +} +struct CABACContext; +typedef struct CABACContext CABACContext; +typedef unsigned char uint8_t; +struct CABACContext +{ + int low; + int range; + int outstanding_count; + const uint8_t *bytestream_start; + const uint8_t *bytestream; + const uint8_t *bytestream_end; + uint8_t cabac_state[460]; }; -enum +static void refill(CABACContext *c) { - _SC_ARG_MAX, - _SC_CHILD_MAX, - _SC_CLK_TCK, - _SC_NGROUPS_MAX, - _SC_OPEN_MAX, - _SC_STREAM_MAX, - _SC_TZNAME_MAX, - _SC_JOB_CONTROL, - _SC_SAVED_IDS, - _SC_REALTIME_SIGNALS, - _SC_PRIORITY_SCHEDULING, - _SC_TIMERS, - _SC_ASYNCHRONOUS_IO, - _SC_PRIORITIZED_IO, - _SC_SYNCHRONIZED_IO, - _SC_FSYNC, - _SC_MAPPED_FILES, - _SC_MEMLOCK, - _SC_MEMLOCK_RANGE, - _SC_MEMORY_PROTECTION, - _SC_MESSAGE_PASSING, - _SC_SEMAPHORES, - _SC_SHARED_MEMORY_OBJECTS, - _SC_AIO_LISTIO_MAX, - _SC_AIO_MAX, - _SC_AIO_PRIO_DELTA_MAX, - _SC_DELAYTIMER_MAX, - _SC_MQ_OPEN_MAX, - _SC_MQ_PRIO_MAX, - _SC_VERSION, - _SC_PAGESIZE, - _SC_RTSIG_MAX, - _SC_SEM_NSEMS_MAX, - _SC_SEM_VALUE_MAX, - _SC_SIGQUEUE_MAX, - _SC_TIMER_MAX, - _SC_BC_BASE_MAX, - _SC_BC_DIM_MAX, - _SC_BC_SCALE_MAX, - _SC_BC_STRING_MAX, - _SC_COLL_WEIGHTS_MAX, - _SC_EQUIV_CLASS_MAX, - _SC_EXPR_NEST_MAX, - _SC_LINE_MAX, - _SC_RE_DUP_MAX, - _SC_CHARCLASS_NAME_MAX, - _SC_2_VERSION, - _SC_2_C_BIND, - _SC_2_C_DEV, - _SC_2_FORT_DEV, - _SC_2_FORT_RUN, - _SC_2_SW_DEV, - _SC_2_LOCALEDEF, - _SC_PII, - _SC_PII_XTI, - _SC_PII_SOCKET, - _SC_PII_INTERNET, - _SC_PII_OSI, - _SC_POLL, - _SC_SELECT, - _SC_UIO_MAXIOV, - _SC_IOV_MAX = _SC_UIO_MAXIOV, - _SC_PII_INTERNET_STREAM, - _SC_PII_INTERNET_DGRAM, - _SC_PII_OSI_COTS, - _SC_PII_OSI_CLTS, - _SC_PII_OSI_M, - _SC_T_IOV_MAX, - _SC_THREADS, - _SC_THREAD_SAFE_FUNCTIONS, - _SC_GETGR_R_SIZE_MAX, - _SC_GETPW_R_SIZE_MAX, - _SC_LOGIN_NAME_MAX, - _SC_TTY_NAME_MAX, - _SC_THREAD_DESTRUCTOR_ITERATIONS, - _SC_THREAD_KEYS_MAX, - _SC_THREAD_STACK_MIN, - _SC_THREAD_THREADS_MAX, - _SC_THREAD_ATTR_STACKADDR, - _SC_THREAD_ATTR_STACKSIZE, - _SC_THREAD_PRIORITY_SCHEDULING, - _SC_THREAD_PRIO_INHERIT, - _SC_THREAD_PRIO_PROTECT, - _SC_THREAD_PROCESS_SHARED, - _SC_NPROCESSORS_CONF, - _SC_NPROCESSORS_ONLN, - _SC_PHYS_PAGES, - _SC_AVPHYS_PAGES, - _SC_ATEXIT_MAX, - _SC_PASS_MAX, - _SC_XOPEN_VERSION, - _SC_XOPEN_XCU_VERSION, - _SC_XOPEN_UNIX, - _SC_XOPEN_CRYPT, - _SC_XOPEN_ENH_I18N, - _SC_XOPEN_SHM, - _SC_2_CHAR_TERM, - _SC_2_C_VERSION, - _SC_2_UPE, - _SC_XOPEN_XPG2, - _SC_XOPEN_XPG3, - _SC_XOPEN_XPG4, - _SC_CHAR_BIT, - _SC_CHAR_MAX, - _SC_CHAR_MIN, - _SC_INT_MAX, - _SC_INT_MIN, - _SC_LONG_BIT, - _SC_WORD_BIT, - _SC_MB_LEN_MAX, - _SC_NZERO, - _SC_SSIZE_MAX, - _SC_SCHAR_MAX, - _SC_SCHAR_MIN, - _SC_SHRT_MAX, - _SC_SHRT_MIN, - _SC_UCHAR_MAX, - _SC_UINT_MAX, - _SC_ULONG_MAX, - _SC_USHRT_MAX, - _SC_NL_ARGMAX, - _SC_NL_LANGMAX, - _SC_NL_MSGMAX, - _SC_NL_NMAX, - _SC_NL_SETMAX, - _SC_NL_TEXTMAX, - _SC_XBS5_ILP32_OFF32, - _SC_XBS5_ILP32_OFFBIG, - _SC_XBS5_LP64_OFF64, - _SC_XBS5_LPBIG_OFFBIG, - _SC_XOPEN_LEGACY, - _SC_XOPEN_REALTIME, - _SC_XOPEN_REALTIME_THREADS, - _SC_ADVISORY_INFO, - _SC_BARRIERS, - _SC_BASE, - _SC_C_LANG_SUPPORT, - _SC_C_LANG_SUPPORT_R, - _SC_CLOCK_SELECTION, - _SC_CPUTIME, - _SC_THREAD_CPUTIME, - _SC_DEVICE_IO, - _SC_DEVICE_SPECIFIC, - _SC_DEVICE_SPECIFIC_R, - _SC_FD_MGMT, - _SC_FIFO, - _SC_PIPE, - _SC_FILE_ATTRIBUTES, - _SC_FILE_LOCKING, - _SC_FILE_SYSTEM, - _SC_MONOTONIC_CLOCK, - _SC_MULTI_PROCESS, - _SC_SINGLE_PROCESS, - _SC_NETWORKING, - _SC_READER_WRITER_LOCKS, - _SC_SPIN_LOCKS, - _SC_REGEXP, - _SC_REGEX_VERSION, - _SC_SHELL, - _SC_SIGNALS, - _SC_SPAWN, - _SC_SPORADIC_SERVER, - _SC_THREAD_SPORADIC_SERVER, - _SC_SYSTEM_DATABASE, - _SC_SYSTEM_DATABASE_R, - _SC_TIMEOUTS, - _SC_TYPED_MEMORY_OBJECTS, - _SC_USER_GROUPS, - _SC_USER_GROUPS_R, - _SC_2_PBS, - _SC_2_PBS_ACCOUNTING, - _SC_2_PBS_LOCATE, - _SC_2_PBS_MESSAGE, - _SC_2_PBS_TRACK, - _SC_SYMLOOP_MAX, - _SC_STREAMS, - _SC_2_PBS_CHECKPOINT, - _SC_V6_ILP32_OFF32, - _SC_V6_ILP32_OFFBIG, - _SC_V6_LP64_OFF64, - _SC_V6_LPBIG_OFFBIG, - _SC_HOST_NAME_MAX, - _SC_TRACE, - _SC_TRACE_EVENT_FILTER, - _SC_TRACE_INHERIT, - _SC_TRACE_LOG, - _SC_LEVEL1_ICACHE_SIZE, - _SC_LEVEL1_ICACHE_ASSOC, - _SC_LEVEL1_ICACHE_LINESIZE, - _SC_LEVEL1_DCACHE_SIZE, - _SC_LEVEL1_DCACHE_ASSOC, - _SC_LEVEL1_DCACHE_LINESIZE, - _SC_LEVEL2_CACHE_SIZE, - _SC_LEVEL2_CACHE_ASSOC, - _SC_LEVEL2_CACHE_LINESIZE, - _SC_LEVEL3_CACHE_SIZE, - _SC_LEVEL3_CACHE_ASSOC, - _SC_LEVEL3_CACHE_LINESIZE, - _SC_LEVEL4_CACHE_SIZE, - _SC_LEVEL4_CACHE_ASSOC, - _SC_LEVEL4_CACHE_LINESIZE, - _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, - _SC_RAW_SOCKETS, - _SC_V7_ILP32_OFF32, - _SC_V7_ILP32_OFFBIG, - _SC_V7_LP64_OFF64, - _SC_V7_LPBIG_OFFBIG, - _SC_SS_REPL_MAX, - _SC_TRACE_EVENT_NAME_MAX, - _SC_TRACE_NAME_MAX, - _SC_TRACE_SYS_MAX, - _SC_TRACE_USER_EVENT_MAX, - _SC_XOPEN_STREAMS, - _SC_THREAD_ROBUST_PRIO_INHERIT, - _SC_THREAD_ROBUST_PRIO_PROTECT -}; -enum + (*c).low += ((*c).bytestream[0] << 9) + ((*c).bytestream[1] << 1); + (*c).low -= (1 << 16) - 1; + (*c).bytestream += 16 / 8; +} +extern const uint8_t ff_h264_norm_shift[512]; +static void refill2(CABACContext *c) { - _CS_PATH, - _CS_V6_WIDTH_RESTRICTED_ENVS, - _CS_GNU_LIBC_VERSION, - _CS_GNU_LIBPTHREAD_VERSION, - _CS_V5_WIDTH_RESTRICTED_ENVS, - _CS_V7_WIDTH_RESTRICTED_ENVS, - _CS_LFS_CFLAGS = 1000, - _CS_LFS_LDFLAGS, - _CS_LFS_LIBS, - _CS_LFS_LINTFLAGS, - _CS_LFS64_CFLAGS, - _CS_LFS64_LDFLAGS, - _CS_LFS64_LIBS, - _CS_LFS64_LINTFLAGS, - _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, - _CS_XBS5_ILP32_OFF32_LDFLAGS, - _CS_XBS5_ILP32_OFF32_LIBS, - _CS_XBS5_ILP32_OFF32_LINTFLAGS, - _CS_XBS5_ILP32_OFFBIG_CFLAGS, - _CS_XBS5_ILP32_OFFBIG_LDFLAGS, - _CS_XBS5_ILP32_OFFBIG_LIBS, - _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, - _CS_XBS5_LP64_OFF64_CFLAGS, - _CS_XBS5_LP64_OFF64_LDFLAGS, - _CS_XBS5_LP64_OFF64_LIBS, - _CS_XBS5_LP64_OFF64_LINTFLAGS, - _CS_XBS5_LPBIG_OFFBIG_CFLAGS, - _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, - _CS_XBS5_LPBIG_OFFBIG_LIBS, - _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, - _CS_POSIX_V6_ILP32_OFF32_CFLAGS, - _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, - _CS_POSIX_V6_ILP32_OFF32_LIBS, - _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, - _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, - _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, - _CS_POSIX_V6_ILP32_OFFBIG_LIBS, - _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, - _CS_POSIX_V6_LP64_OFF64_CFLAGS, - _CS_POSIX_V6_LP64_OFF64_LDFLAGS, - _CS_POSIX_V6_LP64_OFF64_LIBS, - _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, - _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, - _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, - _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, - _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, - _CS_POSIX_V7_ILP32_OFF32_CFLAGS, - _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, - _CS_POSIX_V7_ILP32_OFF32_LIBS, - _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, - _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, - _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, - _CS_POSIX_V7_ILP32_OFFBIG_LIBS, - _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, - _CS_POSIX_V7_LP64_OFF64_CFLAGS, - _CS_POSIX_V7_LP64_OFF64_LDFLAGS, - _CS_POSIX_V7_LP64_OFF64_LIBS, - _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, - _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, - _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, - _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, - _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, - _CS_V6_ENV, - _CS_V7_ENV -}; -extern long int pathconf(__const char *__path, int __name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern long int fpathconf(int __fd, int __name) __attribute__((__nothrow__, __leaf__)); -extern long int sysconf(int __name) __attribute__((__nothrow__, __leaf__)); -extern size_t confstr(int __name, char *__buf, size_t __len) __attribute__((__nothrow__, __leaf__)); -extern __pid_t getpid(void) __attribute__((__nothrow__, __leaf__)); -extern __pid_t getppid(void) __attribute__((__nothrow__, __leaf__)); -extern __pid_t getpgrp(void) __attribute__((__nothrow__, __leaf__)); -extern __pid_t __getpgid(__pid_t __pid) __attribute__((__nothrow__, __leaf__)); -extern __pid_t getpgid(__pid_t __pid) __attribute__((__nothrow__, __leaf__)); -extern int setpgid(__pid_t __pid, __pid_t __pgid) __attribute__((__nothrow__, __leaf__)); -extern int setpgrp(void) __attribute__((__nothrow__, __leaf__)); -extern __pid_t setsid(void) __attribute__((__nothrow__, __leaf__)); -extern __pid_t getsid(__pid_t __pid) __attribute__((__nothrow__, __leaf__)); -extern __uid_t getuid(void) __attribute__((__nothrow__, __leaf__)); -extern __uid_t geteuid(void) __attribute__((__nothrow__, __leaf__)); -extern __gid_t getgid(void) __attribute__((__nothrow__, __leaf__)); -extern __gid_t getegid(void) __attribute__((__nothrow__, __leaf__)); -extern int getgroups(int __size, __gid_t __list[]) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int setuid(__uid_t __uid) __attribute__((__nothrow__, __leaf__)); -extern int setreuid(__uid_t __ruid, __uid_t __euid) __attribute__((__nothrow__, __leaf__)); -extern int seteuid(__uid_t __uid) __attribute__((__nothrow__, __leaf__)); -extern int setgid(__gid_t __gid) __attribute__((__nothrow__, __leaf__)); -extern int setregid(__gid_t __rgid, __gid_t __egid) __attribute__((__nothrow__, __leaf__)); -extern int setegid(__gid_t __gid) __attribute__((__nothrow__, __leaf__)); -extern __pid_t fork(void) __attribute__((__nothrow__)); -extern __pid_t vfork(void) __attribute__((__nothrow__, __leaf__)); -extern char *ttyname(int __fd) __attribute__((__nothrow__, __leaf__)); -extern int ttyname_r(int __fd, char *__buf, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warn_unused_result__)); -extern int isatty(int __fd) __attribute__((__nothrow__, __leaf__)); -extern int ttyslot(void) __attribute__((__nothrow__, __leaf__)); -extern int link(__const char *__from, __const char *__to) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)); -extern int linkat(int __fromfd, __const char *__from, int __tofd, __const char *__to, int __flags) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 4))) __attribute__((__warn_unused_result__)); -extern int symlink(__const char *__from, __const char *__to) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)); -extern ssize_t readlink(__const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)); -extern int symlinkat(__const char *__from, int __tofd, __const char *__to) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 3))) __attribute__((__warn_unused_result__)); -extern ssize_t readlinkat(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)); -extern int unlink(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int unlinkat(int __fd, __const char *__name, int __flag) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int rmdir(__const char *__path) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern __pid_t tcgetpgrp(int __fd) __attribute__((__nothrow__, __leaf__)); -extern int tcsetpgrp(int __fd, __pid_t __pgrp_id) __attribute__((__nothrow__, __leaf__)); -extern char *getlogin(void); -extern int getlogin_r(char *__name, size_t __name_len) __attribute__((__nonnull__(1))); -extern int setlogin(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern char *optarg; -extern int optind; -extern int opterr; -extern int optopt; -extern int getopt(int ___argc, char *const *___argv, const char *__shortopts) __attribute__((__nothrow__, __leaf__)); -extern int gethostname(char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int sethostname(__const char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int sethostid(long int __id) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int getdomainname(char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int setdomainname(__const char *__name, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int vhangup(void) __attribute__((__nothrow__, __leaf__)); -extern int revoke(__const char *__file) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int profil(unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int acct(__const char *__name) __attribute__((__nothrow__, __leaf__)); -extern char *getusershell(void) __attribute__((__nothrow__, __leaf__)); -extern void endusershell(void) __attribute__((__nothrow__, __leaf__)); -extern void setusershell(void) __attribute__((__nothrow__, __leaf__)); -extern int daemon(int __nochdir, int __noclose) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int chroot(__const char *__path) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern char *getpass(__const char *__prompt) __attribute__((__nonnull__(1))); -extern int fsync(int __fd); -extern long int gethostid(void); -extern void sync(void) __attribute__((__nothrow__, __leaf__)); -extern int getpagesize(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int getdtablesize(void) __attribute__((__nothrow__, __leaf__)); -extern int truncate(__const char *__file, __off_t __length) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int ftruncate(int __fd, __off_t __length) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int brk(void *__addr) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void *sbrk(intptr_t __delta) __attribute__((__nothrow__, __leaf__)); -extern long int syscall(long int __sysno, ...) __attribute__((__nothrow__, __leaf__)); -extern int lockf(int __fd, int __cmd, __off_t __len) __attribute__((__warn_unused_result__)); -extern int fdatasync(int __fildes); -extern char *ctermid(char *__s) __attribute__((__nothrow__, __leaf__)); -extern ssize_t __read_chk(int __fd, void *__buf, size_t __nbytes, size_t __buflen) __attribute__((__warn_unused_result__)); -extern ssize_t __read_alias(int __fd, void *__buf, size_t __nbytes) __asm__ ("""read") __attribute__((__warn_unused_result__)); -extern ssize_t __read_chk_warn(int __fd, void *__buf, size_t __nbytes, size_t __buflen) __asm__ ("""__read_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("read called with bigger length than size of ""the destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) ssize_t read(int __fd, void *__buf, size_t __nbytes) + int x; + int i; + x = (*c).low ^ ((*c).low - 1); + i = 7 - ff_h264_norm_shift[x >> (16 - 1)]; + x = -((1 << 16) - 1); + x += ((*c).bytestream[0] << 9) + ((*c).bytestream[1] << 1); + (*c).low += x << i; + (*c).bytestream += 16 / 8; +} +static __inline void renorm_cabac_decoder(CABACContext *c) { - if (__builtin_object_size(__buf, 0) != (size_t) - 1) + while ((*c).range < 256) { - if (!__builtin_constant_p(__nbytes)) - return __read_chk(__fd, __buf, __nbytes, __builtin_object_size(__buf, 0)); - if (__nbytes > __builtin_object_size(__buf, 0)) - return __read_chk_warn(__fd, __buf, __nbytes, __builtin_object_size(__buf, 0)); + { + (*c).range += (*c).range; + (*c).low += (*c).low; + if (!((*c).low & ((1 << 16) - 1))) + { + refill(c); + } + } } - return __read_alias(__fd, __buf, __nbytes); } -extern ssize_t __readlink_chk(__const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)); -extern ssize_t __readlink_alias(__const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("""readlink") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)); -extern ssize_t __readlink_chk_warn(__const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("""__readlink_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("readlink called with bigger length ""than size of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__nonnull__(1, 2))) __attribute__((__warn_unused_result__)) ssize_t __attribute__((__nothrow__, __leaf__)) readlink(__const char *__restrict __path, char *__restrict __buf, size_t __len) +static __inline void renorm_cabac_decoder_once(CABACContext *c) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + int shift = (uint32_t)((*c).range - 256) >> 31; + (*c).range <<= shift; + (*c).low <<= shift; + if (!((*c).low & ((1 << 16) - 1))) { - if (!__builtin_constant_p(__len)) - return __readlink_chk(__path, __buf, __len, __builtin_object_size(__buf, 2 > 1)); - if (__len > __builtin_object_size(__buf, 2 > 1)) - return __readlink_chk_warn(__path, __buf, __len, __builtin_object_size(__buf, 2 > 1)); + refill(c); } - return __readlink_alias(__path, __buf, __len); } -extern ssize_t __readlinkat_chk(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)); -extern ssize_t __readlinkat_alias(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) __asm__ ("""readlinkat") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)); -extern ssize_t __readlinkat_chk_warn(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len, size_t __buflen) __asm__ ("""__readlinkat_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("readlinkat called with bigger ""length than size of destination ""buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__nonnull__(2, 3))) __attribute__((__warn_unused_result__)) ssize_t __attribute__((__nothrow__, __leaf__)) readlinkat(int __fd, __const char *__restrict __path, char *__restrict __buf, size_t __len) +extern uint8_t ff_h264_lps_range[512]; +extern uint8_t ff_h264_mlps_state[256]; +static __inline __attribute__((always_inline)) int get_cabac_inline(CABACContext *c, uint8_t *const state) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + __attribute__((unused)) int lps_mask; + int bit; + int s = *state; + int RangeLPS = ff_h264_lps_range[2 * ((*c).range & 192) + s]; + (*c).range -= RangeLPS; + lps_mask = (((*c).range << (16 + 1)) - (*c).low) >> 31; + (*c).low -= (*c).range << (16 + 1) & lps_mask; + (*c).range += (RangeLPS - (*c).range) & lps_mask; + s ^= lps_mask; + *state = (ff_h264_mlps_state + 128)[s]; + bit = s & 1; + lps_mask = ff_h264_norm_shift[(*c).range]; + (*c).range <<= lps_mask; + (*c).low <<= lps_mask; + if (!((*c).low & ((1 << 16) - 1))) { - if (!__builtin_constant_p(__len)) - return __readlinkat_chk(__fd, __path, __buf, __len, __builtin_object_size(__buf, 2 > 1)); - if (__len > __builtin_object_size(__buf, 2 > 1)) - return __readlinkat_chk_warn(__fd, __path, __buf, __len, __builtin_object_size(__buf, 2 > 1)); + refill2(c); } - return __readlinkat_alias(__fd, __path, __buf, __len); + return bit; } -extern char *__getcwd_chk(char *__buf, size_t __size, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *__getcwd_alias(char *__buf, size_t __size) __asm__ ("""getcwd") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *__getcwd_chk_warn(char *__buf, size_t __size, size_t __buflen) __asm__ ("""__getcwd_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)) __attribute__((__warning__("getcwd caller with bigger length than size of ""destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *__attribute__((__nothrow__, __leaf__)) getcwd(char *__buf, size_t __size) +static __attribute__((noinline)) __attribute__((unused)) int get_cabac_noinline(CABACContext *c, uint8_t *const state) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + return get_cabac_inline(c, state); +} +static __attribute__((unused)) int get_cabac(CABACContext *c, uint8_t *const state) +{ + return get_cabac_inline(c, state); +} +static __attribute__((unused)) int get_cabac_bypass(CABACContext *c) +{ + int range; + (*c).low += (*c).low; + if (!((*c).low & ((1 << 16) - 1))) { - if (!__builtin_constant_p(__size)) - return __getcwd_chk(__buf, __size, __builtin_object_size(__buf, 2 > 1)); - if (__size > __builtin_object_size(__buf, 2 > 1)) - return __getcwd_chk_warn(__buf, __size, __builtin_object_size(__buf, 2 > 1)); + refill(c); } - return __getcwd_alias(__buf, __size); + range = (*c).range << (16 + 1); + if ((*c).low < range) + { + { + return 0; + } + } + else + { + { + (*c).low -= range; + return 1; + } + } } -extern char *__getwd_chk(char *__buf, size_t buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern char *__getwd_warn(char *__buf) __asm__ ("""getwd") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("please use getcwd instead, as getwd ""doesn't specify buffer size"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__nonnull__(1))) __attribute__((__deprecated__)) __attribute__((__warn_unused_result__)) char *__attribute__((__nothrow__, __leaf__)) getwd(char *__buf) +static __inline __attribute__((always_inline)) int get_cabac_bypass_sign(CABACContext *c, int val) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) - return __getwd_chk(__buf, __builtin_object_size(__buf, 2 > 1)); - return __getwd_warn(__buf); + int range; + int mask; + (*c).low += (*c).low; + if (!((*c).low & ((1 << 16) - 1))) + { + refill(c); + } + range = (*c).range << (16 + 1); + (*c).low -= range; + mask = (*c).low >> 31; + range &= mask; + (*c).low += range; + return (val ^ mask) - mask; } -extern size_t __confstr_chk(int __name, char *__buf, size_t __len, size_t __buflen) __attribute__((__nothrow__, __leaf__)); -extern size_t __confstr_alias(int __name, char *__buf, size_t __len) __asm__ ("""confstr") __attribute__((__nothrow__, __leaf__)); -extern size_t __confstr_chk_warn(int __name, char *__buf, size_t __len, size_t __buflen) __asm__ ("""__confstr_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warning__("confstr called with bigger length than size of destination ""buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) size_t __attribute__((__nothrow__, __leaf__)) confstr(int __name, char *__buf, size_t __len) +static __attribute__((unused)) int get_cabac_terminate(CABACContext *c) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + (*c).range -= 2; + if ((*c).low < (*c).range << (16 + 1)) { - if (!__builtin_constant_p(__len)) - return __confstr_chk(__name, __buf, __len, __builtin_object_size(__buf, 2 > 1)); - if (__builtin_object_size(__buf, 2 > 1) < __len) - return __confstr_chk_warn(__name, __buf, __len, __builtin_object_size(__buf, 2 > 1)); + { + renorm_cabac_decoder_once(c); + return 0; + } } - return __confstr_alias(__name, __buf, __len); + else + { + { + return (*c).bytestream - (*c).bytestream_start; + } + } } -extern int __getgroups_chk(int __size, __gid_t __list[], size_t __listlen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int __getgroups_alias(int __size, __gid_t __list[]) __asm__ ("""getgroups") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int __getgroups_chk_warn(int __size, __gid_t __list[], size_t __listlen) __asm__ ("""__getgroups_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)) __attribute__((__warning__("getgroups called with bigger group count than what ""can fit into destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) getgroups(int __size, __gid_t __list[]) +static __inline __attribute__((always_inline)) __attribute__((const)) uint16_t bswap_16(uint16_t x) { - if (__builtin_object_size(__list, 2 > 1) != (size_t) - 1) + __asm__ ("rorw $8, %0" : "+r"(x) : ); + return x; +} +static __inline __attribute__((always_inline)) __attribute__((const)) uint32_t bswap_32(uint32_t x) +{ + __asm__ ("bswap %0" : "+r"(x) : ); + return x; +} +typedef unsigned long int uint64_t; +static __inline __attribute__((const)) uint64_t bswap_64(uint64_t x) +{ + __asm__ ("bswap %0" : "=r"(x) : "0"(x)); + return x; +} +extern const uint8_t ff_log2_tab[256]; +static __inline __attribute__((const)) int av_log2_c(unsigned int v) +{ + int n = 0; + if (v & 4294901760U) { - if (!__builtin_constant_p(__size) || __size < 0) - return __getgroups_chk(__size, __list, __builtin_object_size(__list, 2 > 1)); - if (__size * sizeof(__gid_t) > __builtin_object_size(__list, 2 > 1)) - return __getgroups_chk_warn(__size, __list, __builtin_object_size(__list, 2 > 1)); + { + v >>= 16; + n += 16; + } } - return __getgroups_alias(__size, __list); + if (v & 65280) + { + { + v >>= 8; + n += 8; + } + } + n += ff_log2_tab[v]; + return n; } -extern int __ttyname_r_chk(int __fd, char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int __ttyname_r_alias(int __fd, char *__buf, size_t __buflen) __asm__ ("""ttyname_r") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int __ttyname_r_chk_warn(int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__ttyname_r_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warning__("ttyname_r called with bigger buflen than ""size of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) ttyname_r(int __fd, char *__buf, size_t __buflen) +static __inline __attribute__((const)) int av_log2_16bit_c(unsigned int v) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + int n = 0; + if (v & 65280) { - if (!__builtin_constant_p(__buflen)) - return __ttyname_r_chk(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1)); - if (__buflen > __builtin_object_size(__buf, 2 > 1)) - return __ttyname_r_chk_warn(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1)); + { + v >>= 8; + n += 8; + } } - return __ttyname_r_alias(__fd, __buf, __buflen); + n += ff_log2_tab[v]; + return n; } -extern int __getlogin_r_chk(char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nonnull__(1))); -extern int __getlogin_r_alias(char *__buf, size_t __buflen) __asm__ ("""getlogin_r") __attribute__((__nonnull__(1))); -extern int __getlogin_r_chk_warn(char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__getlogin_r_chk") __attribute__((__nonnull__(1))) __attribute__((__warning__("getlogin_r called with bigger buflen than ""size of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int getlogin_r(char *__buf, size_t __buflen) +static __inline __attribute__((const)) int av_clip(int a, int amin, int amax) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + if (a < amin) { - if (!__builtin_constant_p(__buflen)) - return __getlogin_r_chk(__buf, __buflen, __builtin_object_size(__buf, 2 > 1)); - if (__buflen > __builtin_object_size(__buf, 2 > 1)) - return __getlogin_r_chk_warn(__buf, __buflen, __builtin_object_size(__buf, 2 > 1)); + return amin; } - return __getlogin_r_alias(__buf, __buflen); + else + { + if (a > amax) + { + return amax; + } + else + { + return a; + } + } } -extern int __gethostname_chk(char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int __gethostname_alias(char *__buf, size_t __buflen) __asm__ ("""gethostname") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int __gethostname_chk_warn(char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__gethostname_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warning__("gethostname called with bigger buflen than ""size of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) gethostname(char *__buf, size_t __buflen) +static __inline __attribute__((const)) uint8_t av_clip_uint8(int a) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + if (a & ~255) { - if (!__builtin_constant_p(__buflen)) - return __gethostname_chk(__buf, __buflen, __builtin_object_size(__buf, 2 > 1)); - if (__buflen > __builtin_object_size(__buf, 2 > 1)) - return __gethostname_chk_warn(__buf, __buflen, __builtin_object_size(__buf, 2 > 1)); + return -a >> 31; } - return __gethostname_alias(__buf, __buflen); + else + { + return a; + } } -extern int __getdomainname_chk(char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int __getdomainname_alias(char *__buf, size_t __buflen) __asm__ ("""getdomainname") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int __getdomainname_chk_warn(char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__getdomainname_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)) __attribute__((__warning__("getdomainname called with bigger ""buflen than size of destination ""buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) getdomainname(char *__buf, size_t __buflen) +static __inline __attribute__((const)) uint16_t av_clip_uint16(int a) { - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) + if (a & ~65535) { - if (!__builtin_constant_p(__buflen)) - return __getdomainname_chk(__buf, __buflen, __builtin_object_size(__buf, 2 > 1)); - if (__buflen > __builtin_object_size(__buf, 2 > 1)) - return __getdomainname_chk_warn(__buf, __buflen, __builtin_object_size(__buf, 2 > 1)); + return -a >> 31; } - return __getdomainname_alias(__buf, __buflen); + else + { + return a; + } } -struct _IO_FILE; -typedef struct _IO_FILE FILE; -typedef struct _IO_FILE __FILE; -typedef struct +typedef short int int16_t; +static __inline __attribute__((const)) int16_t av_clip_int16(int a) { - int __count; - union - { - unsigned int __wch; - char __wchb[4]; - } __value; -} __mbstate_t; -typedef struct -{ - __off_t __pos; - __mbstate_t __state; -} _G_fpos_t; -typedef struct -{ - __off64_t __pos; - __mbstate_t __state; -} _G_fpos64_t; -typedef int _G_int16_t __attribute__((__mode__(__HI__))); -typedef int _G_int32_t __attribute__((__mode__(__SI__))); -typedef unsigned int _G_uint16_t __attribute__((__mode__(__HI__))); -typedef unsigned int _G_uint32_t __attribute__((__mode__(__SI__))); -typedef __builtin_va_list __gnuc_va_list; -struct _IO_jump_t; -struct _IO_FILE; -typedef void _IO_lock_t; -struct _IO_marker -{ - struct _IO_marker *_next; - struct _IO_FILE *_sbuf; - int _pos; -}; -enum __codecvt_result -{ - __codecvt_ok, - __codecvt_partial, - __codecvt_error, - __codecvt_noconv -}; -struct _IO_FILE -{ - int _flags; - char *_IO_read_ptr; - char *_IO_read_end; - char *_IO_read_base; - char *_IO_write_base; - char *_IO_write_ptr; - char *_IO_write_end; - char *_IO_buf_base; - char *_IO_buf_end; - char *_IO_save_base; - char *_IO_backup_base; - char *_IO_save_end; - struct _IO_marker *_markers; - struct _IO_FILE *_chain; - int _fileno; - int _flags2; - __off_t _old_offset; - unsigned short _cur_column; - signed char _vtable_offset; - char _shortbuf[1]; - _IO_lock_t *_lock; - __off64_t _offset; - void *__pad1; - void *__pad2; - void *__pad3; - void *__pad4; - size_t __pad5; - int _mode; - char _unused2[15 * sizeof(int) - 4 * sizeof(void *) - sizeof(size_t)]; -}; -typedef struct _IO_FILE _IO_FILE; -struct _IO_FILE_plus; -extern struct _IO_FILE_plus _IO_2_1_stdin_; -extern struct _IO_FILE_plus _IO_2_1_stdout_; -extern struct _IO_FILE_plus _IO_2_1_stderr_; -typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __nbytes); -typedef __ssize_t __io_write_fn(void *__cookie, __const char *__buf, size_t __n); -typedef int __io_seek_fn(void *__cookie, __off64_t *__pos, int __w); -typedef int __io_close_fn(void *__cookie); -extern int __underflow(_IO_FILE *); -extern int __uflow(_IO_FILE *); -extern int __overflow(_IO_FILE *, int); -extern int _IO_getc(_IO_FILE *__fp); -extern int _IO_putc(int __c, _IO_FILE *__fp); -extern int _IO_feof(_IO_FILE *__fp) __attribute__((__nothrow__, __leaf__)); -extern int _IO_ferror(_IO_FILE *__fp) __attribute__((__nothrow__, __leaf__)); -extern int _IO_peekc_locked(_IO_FILE *__fp); -extern void _IO_flockfile(_IO_FILE *) __attribute__((__nothrow__, __leaf__)); -extern void _IO_funlockfile(_IO_FILE *) __attribute__((__nothrow__, __leaf__)); -extern int _IO_ftrylockfile(_IO_FILE *) __attribute__((__nothrow__, __leaf__)); -extern int _IO_vfscanf(_IO_FILE *__restrict , const char *__restrict , __gnuc_va_list, int *__restrict ); -extern int _IO_vfprintf(_IO_FILE *__restrict , const char *__restrict , __gnuc_va_list); -extern __ssize_t _IO_padn(_IO_FILE *, int, __ssize_t); -extern size_t _IO_sgetn(_IO_FILE *, void *, size_t); -extern __off64_t _IO_seekoff(_IO_FILE *, __off64_t, int, int); -extern __off64_t _IO_seekpos(_IO_FILE *, __off64_t, int); -extern void _IO_free_backup_area(_IO_FILE *) __attribute__((__nothrow__, __leaf__)); -typedef __gnuc_va_list va_list; -typedef _G_fpos_t fpos_t; -extern struct _IO_FILE *stdin; -extern struct _IO_FILE *stdout; -extern struct _IO_FILE *stderr; -extern int remove(__const char *__filename) __attribute__((__nothrow__, __leaf__)); -extern int rename(__const char *__old, __const char *__new) __attribute__((__nothrow__, __leaf__)); -extern int renameat(int __oldfd, __const char *__old, int __newfd, __const char *__new) __attribute__((__nothrow__, __leaf__)); -extern FILE *tmpfile(void) __attribute__((__warn_unused_result__)); -extern char *tmpnam(char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *tmpnam_r(char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *tempnam(__const char *__dir, __const char *__pfx) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)); -extern int fclose(FILE *__stream); -extern int fflush(FILE *__stream); -extern int fflush_unlocked(FILE *__stream); -extern FILE *fopen(__const char *__restrict __filename, __const char *__restrict __modes) __attribute__((__warn_unused_result__)); -extern FILE *freopen(__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern FILE *fdopen(int __fd, __const char *__modes) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern FILE *fmemopen(void *__s, size_t __len, __const char *__modes) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern FILE *open_memstream(char **__bufloc, size_t *__sizeloc) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void setbuf(FILE *__restrict __stream, char *__restrict __buf) __attribute__((__nothrow__, __leaf__)); -extern int setvbuf(FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__((__nothrow__, __leaf__)); -extern void setbuffer(FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__((__nothrow__, __leaf__)); -extern void setlinebuf(FILE *__stream) __attribute__((__nothrow__, __leaf__)); -extern int fprintf(FILE *__restrict __stream, __const char *__restrict __format, ...); -extern int printf(__const char *__restrict __format, ...); -extern int sprintf(char *__restrict __s, __const char *__restrict __format, ...) __attribute__((__nothrow__)); -extern int vfprintf(FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); -extern int vprintf(__const char *__restrict __format, __gnuc_va_list __arg); -extern int vsprintf(char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__nothrow__)); -extern int snprintf(char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__((__nothrow__)) __attribute__((__format__(__printf__, 3, 4))); -extern int vsnprintf(char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__nothrow__)) __attribute__((__format__(__printf__, 3, 0))); -extern int vdprintf(int __fd, __const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__((__format__(__printf__, 2, 0))); -extern int dprintf(int __fd, __const char *__restrict __fmt, ...) __attribute__((__format__(__printf__, 2, 3))); -extern int fscanf(FILE *__restrict __stream, __const char *__restrict __format, ...) __attribute__((__warn_unused_result__)); -extern int scanf(__const char *__restrict __format, ...) __attribute__((__warn_unused_result__)); -extern int sscanf(__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__((__nothrow__, __leaf__)); -extern int fscanf(FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("""__isoc99_fscanf") __attribute__((__warn_unused_result__)); -extern int scanf(__const char *__restrict __format, ...) __asm__ ("""__isoc99_scanf") __attribute__((__warn_unused_result__)); -extern int sscanf(__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("""__isoc99_sscanf") __attribute__((__nothrow__, __leaf__)); -extern int vfscanf(FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__format__(__scanf__, 2, 0))) __attribute__((__warn_unused_result__)); -extern int vscanf(__const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__format__(__scanf__, 1, 0))) __attribute__((__warn_unused_result__)); -extern int vsscanf(__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__((__nothrow__, __leaf__)) __attribute__((__format__(__scanf__, 2, 0))); -extern int vfscanf(FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("""__isoc99_vfscanf") __attribute__((__format__(__scanf__, 2, 0))) __attribute__((__warn_unused_result__)); -extern int vscanf(__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("""__isoc99_vscanf") __attribute__((__format__(__scanf__, 1, 0))) __attribute__((__warn_unused_result__)); -extern int vsscanf(__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("""__isoc99_vsscanf") __attribute__((__nothrow__, __leaf__)) __attribute__((__format__(__scanf__, 2, 0))); -extern int fgetc(FILE *__stream); -extern int getc(FILE *__stream); -extern int getchar(void); -extern int getc_unlocked(FILE *__stream); -extern int getchar_unlocked(void); -extern int fgetc_unlocked(FILE *__stream); -extern int fputc(int __c, FILE *__stream); -extern int putc(int __c, FILE *__stream); -extern int putchar(int __c); -extern int fputc_unlocked(int __c, FILE *__stream); -extern int putc_unlocked(int __c, FILE *__stream); -extern int putchar_unlocked(int __c); -extern int getw(FILE *__stream); -extern int putw(int __w, FILE *__stream); -extern char *fgets(char *__restrict __s, int __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern char *gets(char *__s) __attribute__((__warn_unused_result__)); -extern __ssize_t __getdelim(char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern __ssize_t getdelim(char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern __ssize_t getline(char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern int fputs(__const char *__restrict __s, FILE *__restrict __stream); -extern int puts(__const char *__s); -extern int ungetc(int __c, FILE *__stream); -extern size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern size_t fwrite(__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); -extern size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern size_t fwrite_unlocked(__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); -extern int fseek(FILE *__stream, long int __off, int __whence); -extern long int ftell(FILE *__stream) __attribute__((__warn_unused_result__)); -extern void rewind(FILE *__stream); -extern int fseeko(FILE *__stream, __off_t __off, int __whence); -extern __off_t ftello(FILE *__stream) __attribute__((__warn_unused_result__)); -extern int fgetpos(FILE *__restrict __stream, fpos_t *__restrict __pos); -extern int fsetpos(FILE *__stream, __const fpos_t *__pos); -extern void clearerr(FILE *__stream) __attribute__((__nothrow__, __leaf__)); -extern int feof(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int ferror(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void clearerr_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)); -extern int feof_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int ferror_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void perror(__const char *__s); -extern int sys_nerr; -extern __const char *__const sys_errlist[]; -extern int fileno(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int fileno_unlocked(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern FILE *popen(__const char *__command, __const char *__modes) __attribute__((__warn_unused_result__)); -extern int pclose(FILE *__stream); -extern char *ctermid(char *__s) __attribute__((__nothrow__, __leaf__)); -extern void flockfile(FILE *__stream) __attribute__((__nothrow__, __leaf__)); -extern int ftrylockfile(FILE *__stream) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void funlockfile(FILE *__stream) __attribute__((__nothrow__, __leaf__)); -extern __inline __attribute__((__gnu_inline__)) int getchar(void) -{ - return _IO_getc(stdin); + if ((a + 32768) & ~65535) + { + return a >> 31 ^ 32767; + } + else + { + return a; + } } -extern __inline __attribute__((__gnu_inline__)) int fgetc_unlocked(FILE *__fp) -{ - return (__builtin_expect(((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow(__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); -} -extern __inline __attribute__((__gnu_inline__)) int getc_unlocked(FILE *__fp) -{ - return (__builtin_expect(((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow(__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); -} -extern __inline __attribute__((__gnu_inline__)) int getchar_unlocked(void) -{ - return (__builtin_expect(((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow(stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); -} -extern __inline __attribute__((__gnu_inline__)) int putchar(int __c) -{ - return _IO_putc(__c, stdout); -} -extern __inline __attribute__((__gnu_inline__)) int fputc_unlocked(int __c, FILE *__stream) -{ - return (__builtin_expect(((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow(__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); -} -extern __inline __attribute__((__gnu_inline__)) int putc_unlocked(int __c, FILE *__stream) -{ - return (__builtin_expect(((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow(__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); -} -extern __inline __attribute__((__gnu_inline__)) int putchar_unlocked(int __c) -{ - return (__builtin_expect(((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow(stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); -} -extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) feof_unlocked(FILE *__stream) -{ - return (((__stream)->_flags & 0x10) != 0); -} -extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) ferror_unlocked(FILE *__stream) -{ - return (((__stream)->_flags & 0x20) != 0); -} -extern int __sprintf_chk(char *__restrict __s, int __flag, size_t __slen, __const char *__restrict __format, ...) __attribute__((__nothrow__, __leaf__)); -extern int __vsprintf_chk(char *__restrict __s, int __flag, size_t __slen, __const char *__restrict __format, __gnuc_va_list __ap) __attribute__((__nothrow__, __leaf__)); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) sprintf(char *__restrict __s, __const char *__restrict __fmt, ...) -{ - return __builtin___sprintf_chk(__s, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __builtin_va_arg_pack()); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) vsprintf(char *__restrict __s, __const char *__restrict __fmt, __gnuc_va_list __ap) -{ - return __builtin___vsprintf_chk(__s, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __ap); -} -extern int __snprintf_chk(char *__restrict __s, size_t __n, int __flag, size_t __slen, __const char *__restrict __format, ...) __attribute__((__nothrow__, __leaf__)); -extern int __vsnprintf_chk(char *__restrict __s, size_t __n, int __flag, size_t __slen, __const char *__restrict __format, __gnuc_va_list __ap) __attribute__((__nothrow__, __leaf__)); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) snprintf(char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...) -{ - return __builtin___snprintf_chk(__s, __n, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __builtin_va_arg_pack()); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) vsnprintf(char *__restrict __s, size_t __n, __const char *__restrict __fmt, __gnuc_va_list __ap) -{ - return __builtin___vsnprintf_chk(__s, __n, 2 - 1, __builtin_object_size(__s, 2 > 1), __fmt, __ap); -} -extern int __fprintf_chk(FILE *__restrict __stream, int __flag, __const char *__restrict __format, ...); -extern int __printf_chk(int __flag, __const char *__restrict __format, ...); -extern int __vfprintf_chk(FILE *__restrict __stream, int __flag, __const char *__restrict __format, __gnuc_va_list __ap); -extern int __vprintf_chk(int __flag, __const char *__restrict __format, __gnuc_va_list __ap); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int fprintf(FILE *__restrict __stream, __const char *__restrict __fmt, ...) -{ - return __fprintf_chk(__stream, 2 - 1, __fmt, __builtin_va_arg_pack()); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int printf(__const char *__restrict __fmt, ...) -{ - return __printf_chk(2 - 1, __fmt, __builtin_va_arg_pack()); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int vprintf(__const char *__restrict __fmt, __gnuc_va_list __ap) -{ - return __vfprintf_chk(stdout, 2 - 1, __fmt, __ap); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int vfprintf(FILE *__restrict __stream, __const char *__restrict __fmt, __gnuc_va_list __ap) -{ - return __vfprintf_chk(__stream, 2 - 1, __fmt, __ap); -} -extern char *__gets_chk(char *__str, size_t) __attribute__((__warn_unused_result__)); -extern char *__gets_warn(char *__str) __asm__ ("""gets") __attribute__((__warn_unused_result__)) __attribute__((__warning__("please use fgets or getline instead, gets can't ""specify buffer size"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *gets(char *__str) -{ - if (__builtin_object_size(__str, 2 > 1) != (size_t) - 1) - return __gets_chk(__str, __builtin_object_size(__str, 2 > 1)); - return __gets_warn(__str); -} -extern char *__fgets_chk(char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern char *__fgets_alias(char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("""fgets") __attribute__((__warn_unused_result__)); -extern char *__fgets_chk_warn(char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("""__fgets_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("fgets called with bigger size than length ""of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *fgets(char *__restrict __s, int __n, FILE *__restrict __stream) -{ - if (__builtin_object_size(__s, 2 > 1) != (size_t) - 1) - { - if (!__builtin_constant_p(__n) || __n <= 0) - return __fgets_chk(__s, __builtin_object_size(__s, 2 > 1), __n, __stream); - if ((size_t) __n > __builtin_object_size(__s, 2 > 1)) - return __fgets_chk_warn(__s, __builtin_object_size(__s, 2 > 1), __n, __stream); - } - return __fgets_alias(__s, __n, __stream); -} -extern size_t __fread_chk(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern size_t __fread_alias(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""fread") __attribute__((__warn_unused_result__)); -extern size_t __fread_chk_warn(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""__fread_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("fread called with bigger size * nmemb than length ""of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) size_t fread(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) -{ - if (__builtin_object_size(__ptr, 0) != (size_t) - 1) - { - if (!__builtin_constant_p(__size) || !__builtin_constant_p(__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof(size_t) / 2))) - return __fread_chk(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream); - if (__size * __n > __builtin_object_size(__ptr, 0)) - return __fread_chk_warn(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream); - } - return __fread_alias(__ptr, __size, __n, __stream); -} -extern size_t __fread_unlocked_chk(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__((__warn_unused_result__)); -extern size_t __fread_unlocked_alias(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""fread_unlocked") __attribute__((__warn_unused_result__)); -extern size_t __fread_unlocked_chk_warn(void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("""__fread_unlocked_chk") __attribute__((__warn_unused_result__)) __attribute__((__warning__("fread_unlocked called with bigger size * nmemb than ""length of destination buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) size_t fread_unlocked(void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) -{ - if (__builtin_object_size(__ptr, 0) != (size_t) - 1) - { - if (!__builtin_constant_p(__size) || !__builtin_constant_p(__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof(size_t) / 2))) - return __fread_unlocked_chk(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream); - if (__size * __n > __builtin_object_size(__ptr, 0)) - return __fread_unlocked_chk_warn(__ptr, __builtin_object_size(__ptr, 0), __size, __n, __stream); - } - if (__builtin_constant_p(__size) && __builtin_constant_p(__n) && (__size | __n) < (((size_t) 1) << (8 * sizeof(size_t) / 2)) && __size * __n <= 8) - { - size_t __cnt = __size * __n; - char *__cptr = (char *) __ptr; - if (__cnt == 0) - return 0; - for (; - __cnt > 0; - --__cnt) - { - int __c = (__builtin_expect(((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow(__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++); - if (__c == (- 1)) - break; - *__cptr++ = __c; - } - return (__cptr - (char *) __ptr) / __size; - } - return __fread_unlocked_alias(__ptr, __size, __n, __stream); -} -typedef signed char int8_t; -typedef short int int16_t; typedef int int32_t; typedef long int int64_t; -typedef unsigned char uint8_t; -typedef unsigned short int uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long int uint64_t; -typedef signed char int_least8_t; -typedef short int int_least16_t; -typedef int int_least32_t; -typedef long int int_least64_t; -typedef unsigned char uint_least8_t; -typedef unsigned short int uint_least16_t; -typedef unsigned int uint_least32_t; -typedef unsigned long int uint_least64_t; -typedef signed char int_fast8_t; -typedef long int int_fast16_t; -typedef long int int_fast32_t; -typedef long int int_fast64_t; -typedef unsigned char uint_fast8_t; -typedef unsigned long int uint_fast16_t; -typedef unsigned long int uint_fast32_t; -typedef unsigned long int uint_fast64_t; -typedef unsigned long int uintptr_t; -typedef long int intmax_t; -typedef unsigned long int uintmax_t; -typedef long int ptrdiff_t; -typedef int wchar_t; -typedef struct +static __inline __attribute__((const)) int32_t av_clipl_int32(int64_t a) { - void **address; - ptrdiff_t offset; - struct - { - _Bool input : 1; - _Bool output : 1; - _Bool can_rename : 1; - _Bool commutative : 1; - } flags; - size_t size; -} nanos_dependence_internal_t; -typedef enum -{ - NANOS_PRIVATE, - NANOS_SHARED -} nanos_sharing_t; -typedef struct -{ - void *original; - void *privates; - void (*bop)(void *, void *); - void (*vop)(int n, void *, void *); - void (*cleanup)(void *); -} nanos_reduction_t; -typedef struct -{ - uint64_t address; - nanos_sharing_t sharing; - struct - { - _Bool input : 1; - _Bool output : 1; - } flags; - size_t size; -} nanos_copy_data_internal_t; -typedef nanos_dependence_internal_t nanos_dependence_t; -typedef nanos_copy_data_internal_t nanos_copy_data_t; -typedef void *nanos_thread_t; -typedef void *nanos_wd_t; -typedef struct -{ - int nsect; - nanos_wd_t lwd[]; -} nanos_compound_wd_data_t; -typedef struct -{ - int n; -} nanos_repeat_n_info_t; -typedef struct -{ - int lower; - int upper; - int step; - _Bool last; - int chunk; - int stride; - int thid; - void *args; -} nanos_loop_info_t; -typedef void *nanos_ws_t; -typedef void *nanos_ws_info_t; -typedef void *nanos_ws_data_t; -typedef void *nanos_ws_item_t; -typedef struct -{ - int lower_bound; - int upper_bound; - int loop_step; - int chunk_size; -} nanos_ws_info_loop_t; -typedef struct -{ - int lower; - int upper; - _Bool execute : 1; - _Bool last : 1; -} nanos_ws_item_loop_t; -typedef struct nanos_ws_desc -{ - volatile nanos_ws_t ws; - nanos_ws_data_t data; - struct nanos_ws_desc *next; - nanos_thread_t *threads; - int nths; -} nanos_ws_desc_t; -typedef struct -{ - _Bool mandatory_creation : 1; - _Bool tied : 1; - _Bool reserved0 : 1; - _Bool reserved1 : 1; - _Bool reserved2 : 1; - _Bool reserved3 : 1; - _Bool reserved4 : 1; - _Bool reserved5 : 1; -} nanos_wd_props_t; -typedef struct -{ - nanos_thread_t tie_to; - unsigned int priority; -} nanos_wd_dyn_props_t; -typedef struct -{ - void *(*factory)(void *arg); - void *arg; -} nanos_device_t; -typedef enum -{ - NANOS_STATE_START, - NANOS_STATE_END, - NANOS_SUBSTATE_START, - NANOS_SUBSTATE_END, - NANOS_BURST_START, - NANOS_BURST_END, - NANOS_PTP_START, - NANOS_PTP_END, - NANOS_POINT, - EVENT_TYPES -} nanos_event_type_t; -typedef enum -{ - NANOS_NOT_CREATED, - NANOS_NOT_RUNNING, - NANOS_STARTUP, - NANOS_SHUTDOWN, - NANOS_ERROR, - NANOS_IDLE, - NANOS_RUNTIME, - NANOS_RUNNING, - NANOS_SYNCHRONIZATION, - NANOS_SCHEDULING, - NANOS_CREATION, - NANOS_MEM_TRANSFER_IN, - NANOS_MEM_TRANSFER_OUT, - NANOS_MEM_TRANSFER_LOCAL, - NANOS_MEM_TRANSFER_DEVICE_IN, - NANOS_MEM_TRANSFER_DEVICE_OUT, - NANOS_MEM_TRANSFER_DEVICE_LOCAL, - NANOS_CACHE, - NANOS_YIELD, - NANOS_ACQUIRING_LOCK, - NANOS_CONTEXT_SWITCH, - NANOS_DEBUG, - NANOS_EVENT_STATE_TYPES -} nanos_event_state_value_t; -typedef enum -{ - NANOS_WD_DOMAIN, - NANOS_WD_DEPENDENCY, - NANOS_WAIT, - NANOS_WD_REMOTE, - NANOS_XFER_PUT, - NANOS_XFER_GET -} nanos_event_domain_t; -typedef long long nanos_event_id_t; -typedef unsigned int nanos_event_key_t; -typedef unsigned long long nanos_event_value_t; -typedef struct -{ - nanos_event_key_t key; - nanos_event_value_t value; -} nanos_event_burst_t; -typedef struct -{ - nanos_event_state_value_t value; -} nanos_event_state_t; -typedef struct -{ - unsigned int nkvs; - nanos_event_key_t *keys; - nanos_event_value_t *values; -} nanos_event_point_t; -typedef struct -{ - nanos_event_domain_t domain; - nanos_event_id_t id; - unsigned int nkvs; - nanos_event_key_t *keys; - nanos_event_value_t *values; -} nanos_event_ptp_t; -typedef struct -{ - nanos_event_type_t type; - union - { - nanos_event_burst_t burst; - nanos_event_state_t state; - nanos_event_point_t point; - nanos_event_ptp_t ptp; - } info; -} nanos_event_t; -typedef enum -{ - NANOS_LOCK_FREE = 0, - NANOS_LOCK_BUSY = 1 -} nanos_lock_state_t; -typedef struct nanos_lock_t -{ - volatile nanos_lock_state_t _state; -} nanos_lock_t; -typedef void (*nanos_translate_args_t)(void *, nanos_wd_t); -typedef void (nanos_init_func_t)(void *); -typedef struct -{ - nanos_init_func_t *func; - void *data; -} nanos_init_desc_t; -typedef void *nanos_wg_t; -typedef void *nanos_team_t; -typedef void *nanos_sched_t; -typedef void *nanos_slicer_t; -typedef void *nanos_dd_t; -typedef void *nanos_sync_cond_t; -typedef unsigned int nanos_copy_id_t; -typedef struct nanos_const_wd_definition_tag -{ - nanos_wd_props_t props; - size_t data_alignment; - size_t num_copies; - size_t num_devices; -} nanos_const_wd_definition_t; -typedef struct -{ - int nthreads; - void *arch; -} nanos_constraint_t; -typedef enum -{ - NANOS_OK = 0, - NANOS_UNKNOWN_ERR, - NANOS_UNIMPLEMENTED -} nanos_err_t; -typedef struct -{ - void (*outline)(void *); -} nanos_smp_args_t; -extern nanos_wd_t nanos_current_wd_(void); -extern nanos_wd_t nanos_current_wd(void); -extern int nanos_get_wd_id_(nanos_wd_t wd); -extern int nanos_get_wd_id(nanos_wd_t wd); -extern nanos_slicer_t nanos_find_slicer_(const char *slicer); -extern nanos_slicer_t nanos_find_slicer(const char *slicer); -extern nanos_ws_t nanos_find_worksharing_(const char *label); -extern nanos_ws_t nanos_find_worksharing(const char *label); -extern nanos_err_t nanos_create_wd_compact_(nanos_wd_t *wd, nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void **data, nanos_wg_t wg, nanos_copy_data_t **copies); -extern nanos_err_t nanos_create_wd_compact(nanos_wd_t *wd, nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void **data, nanos_wg_t wg, nanos_copy_data_t **copies); -extern nanos_err_t nanos_set_translate_function_(nanos_wd_t wd, nanos_translate_args_t translate_args); -extern nanos_err_t nanos_set_translate_function(nanos_wd_t wd, nanos_translate_args_t translate_args); -extern nanos_err_t nanos_create_sliced_wd_(nanos_wd_t *uwd, size_t num_devices, nanos_device_t *devices, size_t outline_data_size, int outline_data_align, void **outline_data, nanos_wg_t uwg, nanos_slicer_t slicer, nanos_wd_props_t *props, nanos_wd_dyn_props_t *dyn_props, size_t num_copies, nanos_copy_data_t **copies); -extern nanos_err_t nanos_create_sliced_wd(nanos_wd_t *uwd, size_t num_devices, nanos_device_t *devices, size_t outline_data_size, int outline_data_align, void **outline_data, nanos_wg_t uwg, nanos_slicer_t slicer, nanos_wd_props_t *props, nanos_wd_dyn_props_t *dyn_props, size_t num_copies, nanos_copy_data_t **copies); -extern nanos_err_t nanos_submit_(nanos_wd_t wd, size_t num_deps, nanos_dependence_t *deps, nanos_team_t team); -extern nanos_err_t nanos_submit(nanos_wd_t wd, size_t num_deps, nanos_dependence_t *deps, nanos_team_t team); -extern nanos_err_t nanos_create_wd_and_run_compact_(nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void *data, size_t num_deps, nanos_dependence_t *deps, nanos_copy_data_t *copies, nanos_translate_args_t translate_args); -extern nanos_err_t nanos_create_wd_and_run_compact(nanos_const_wd_definition_t *const_data, nanos_wd_dyn_props_t *dyn_props, size_t data_size, void *data, size_t num_deps, nanos_dependence_t *deps, nanos_copy_data_t *copies, nanos_translate_args_t translate_args); -extern nanos_err_t nanos_create_for_(void); -extern nanos_err_t nanos_create_for(void); -extern nanos_err_t nanos_set_internal_wd_data_(nanos_wd_t wd, void *data); -extern nanos_err_t nanos_set_internal_wd_data(nanos_wd_t wd, void *data); -extern nanos_err_t nanos_get_internal_wd_data_(nanos_wd_t wd, void **data); -extern nanos_err_t nanos_get_internal_wd_data(nanos_wd_t wd, void **data); -extern nanos_err_t nanos_yield_(void); -extern nanos_err_t nanos_yield(void); -extern nanos_err_t nanos_slicer_get_specific_data_(nanos_slicer_t slicer, void **data); -extern nanos_err_t nanos_slicer_get_specific_data(nanos_slicer_t slicer, void **data); -extern nanos_err_t nanos_create_team_(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, nanos_constraint_t *constraints, _Bool reuse, nanos_thread_t *info); -extern nanos_err_t nanos_create_team(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, nanos_constraint_t *constraints, _Bool reuse, nanos_thread_t *info); -extern nanos_err_t nanos_create_team_mapped_(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, unsigned int *mapping); -extern nanos_err_t nanos_create_team_mapped(nanos_team_t *team, nanos_sched_t sg, unsigned int *nthreads, unsigned int *mapping); -extern nanos_err_t nanos_leave_team_(); -extern nanos_err_t nanos_leave_team(); -extern nanos_err_t nanos_end_team_(nanos_team_t team); -extern nanos_err_t nanos_end_team(nanos_team_t team); -extern nanos_err_t nanos_team_barrier_(void); -extern nanos_err_t nanos_team_barrier(void); -extern nanos_err_t nanos_single_guard_(_Bool *); -extern nanos_err_t nanos_single_guard(_Bool *); -extern nanos_err_t nanos_enter_sync_init_(_Bool *b); -extern nanos_err_t nanos_enter_sync_init(_Bool *b); -extern nanos_err_t nanos_wait_sync_init_(void); -extern nanos_err_t nanos_wait_sync_init(void); -extern nanos_err_t nanos_release_sync_init_(void); -extern nanos_err_t nanos_release_sync_init(void); -extern nanos_err_t nanos_team_get_num_starring_threads_(int *n); -extern nanos_err_t nanos_team_get_num_starring_threads(int *n); -extern nanos_err_t nanos_team_get_starring_threads_(int *n, nanos_thread_t *list_of_threads); -extern nanos_err_t nanos_team_get_starring_threads(int *n, nanos_thread_t *list_of_threads); -extern nanos_err_t nanos_team_get_num_supporting_threads_(int *n); -extern nanos_err_t nanos_team_get_num_supporting_threads(int *n); -extern nanos_err_t nanos_team_get_supporting_threads_(int *n, nanos_thread_t *list_of_threads); -extern nanos_err_t nanos_team_get_supporting_threads(int *n, nanos_thread_t *list_of_threads); -extern nanos_err_t nanos_register_reduction_(nanos_reduction_t *red); -extern nanos_err_t nanos_register_reduction(nanos_reduction_t *red); -extern nanos_err_t nanos_reduction_get_private_data_(void **copy, void *sink); -extern nanos_err_t nanos_reduction_get_private_data(void **copy, void *sink); -extern nanos_err_t nanos_worksharing_create_(nanos_ws_desc_t **wsd, nanos_ws_t ws, nanos_ws_info_t *info, _Bool *b); -extern nanos_err_t nanos_worksharing_create(nanos_ws_desc_t **wsd, nanos_ws_t ws, nanos_ws_info_t *info, _Bool *b); -extern nanos_err_t nanos_worksharing_next_item_(nanos_ws_desc_t *wsd, nanos_ws_item_t *wsi); -extern nanos_err_t nanos_worksharing_next_item(nanos_ws_desc_t *wsd, nanos_ws_item_t *wsi); -extern nanos_err_t nanos_wg_wait_completion_(nanos_wg_t wg, _Bool avoid_flush); -extern nanos_err_t nanos_wg_wait_completion(nanos_wg_t wg, _Bool avoid_flush); -extern nanos_err_t nanos_create_int_sync_cond_(nanos_sync_cond_t *sync_cond, volatile int *p, int condition); -extern nanos_err_t nanos_create_int_sync_cond(nanos_sync_cond_t *sync_cond, volatile int *p, int condition); -extern nanos_err_t nanos_create_bool_sync_cond_(nanos_sync_cond_t *sync_cond, volatile _Bool *p, _Bool condition); -extern nanos_err_t nanos_create_bool_sync_cond(nanos_sync_cond_t *sync_cond, volatile _Bool *p, _Bool condition); -extern nanos_err_t nanos_sync_cond_wait_(nanos_sync_cond_t *sync_cond); -extern nanos_err_t nanos_sync_cond_wait(nanos_sync_cond_t *sync_cond); -extern nanos_err_t nanos_sync_cond_signal_(nanos_sync_cond_t *sync_cond); -extern nanos_err_t nanos_sync_cond_signal(nanos_sync_cond_t *sync_cond); -extern nanos_err_t nanos_destroy_sync_cond_(nanos_sync_cond_t *sync_cond); -extern nanos_err_t nanos_destroy_sync_cond(nanos_sync_cond_t *sync_cond); -extern nanos_err_t nanos_wait_on_(size_t num_deps, nanos_dependence_t *deps); -extern nanos_err_t nanos_wait_on(size_t num_deps, nanos_dependence_t *deps); -extern nanos_err_t nanos_init_lock_(nanos_lock_t **lock); -extern nanos_err_t nanos_init_lock(nanos_lock_t **lock); -extern nanos_err_t nanos_set_lock_(nanos_lock_t *lock); -extern nanos_err_t nanos_set_lock(nanos_lock_t *lock); -extern nanos_err_t nanos_unset_lock_(nanos_lock_t *lock); -extern nanos_err_t nanos_unset_lock(nanos_lock_t *lock); -extern nanos_err_t nanos_try_lock_(nanos_lock_t *lock, _Bool *result); -extern nanos_err_t nanos_try_lock(nanos_lock_t *lock, _Bool *result); -extern nanos_err_t nanos_destroy_lock_(nanos_lock_t *lock); -extern nanos_err_t nanos_destroy_lock(nanos_lock_t *lock); -extern nanos_err_t nanos_get_addr_(nanos_copy_id_t copy_id, void **addr, nanos_wd_t cwd); -extern nanos_err_t nanos_get_addr(nanos_copy_id_t copy_id, void **addr, nanos_wd_t cwd); -extern nanos_err_t nanos_copy_value_(void *dst, nanos_copy_id_t copy_id, nanos_wd_t cwd); -extern nanos_err_t nanos_copy_value(void *dst, nanos_copy_id_t copy_id, nanos_wd_t cwd); -extern nanos_err_t nanos_get_num_running_tasks_(int *num); -extern nanos_err_t nanos_get_num_running_tasks(int *num); -extern nanos_err_t nanos_start_scheduler_(); -extern nanos_err_t nanos_start_scheduler(); -extern nanos_err_t nanos_stop_scheduler_(); -extern nanos_err_t nanos_stop_scheduler(); -extern nanos_err_t nanos_scheduler_enabled_(_Bool *res); -extern nanos_err_t nanos_scheduler_enabled(_Bool *res); -extern nanos_err_t nanos_wait_until_threads_paused_(); -extern nanos_err_t nanos_wait_until_threads_paused(); -extern nanos_err_t nanos_wait_until_threads_unpaused_(); -extern nanos_err_t nanos_wait_until_threads_unpaused(); -extern nanos_err_t nanos_delay_start_(); -extern nanos_err_t nanos_delay_start(); -extern nanos_err_t nanos_start_(); -extern nanos_err_t nanos_start(); -extern nanos_err_t nanos_finish_(); -extern nanos_err_t nanos_finish(); -extern nanos_err_t nanos_malloc_(void **p, size_t size, const char *file, int line); -extern nanos_err_t nanos_malloc(void **p, size_t size, const char *file, int line); -extern nanos_err_t nanos_free_(void *p); -extern nanos_err_t nanos_free(void *p); -extern void nanos_handle_error_(nanos_err_t err); -extern void nanos_handle_error(nanos_err_t err); -extern void *nanos_smp_factory_(void *args); -extern void *nanos_smp_factory(void *args); -extern nanos_err_t nanos_instrument_register_key_(nanos_event_key_t *event_key, const char *key, const char *description, _Bool abort_when_registered); -extern nanos_err_t nanos_instrument_register_key(nanos_event_key_t *event_key, const char *key, const char *description, _Bool abort_when_registered); -extern nanos_err_t nanos_instrument_register_value_(nanos_event_value_t *event_value, const char *key, const char *value, const char *description, _Bool abort_when_registered); -extern nanos_err_t nanos_instrument_register_value(nanos_event_value_t *event_value, const char *key, const char *value, const char *description, _Bool abort_when_registered); -extern nanos_err_t nanos_instrument_register_value_with_val_(nanos_event_value_t val, const char *key, const char *value, const char *description, _Bool abort_when_registered); -extern nanos_err_t nanos_instrument_register_value_with_val(nanos_event_value_t val, const char *key, const char *value, const char *description, _Bool abort_when_registered); -extern nanos_err_t nanos_instrument_get_key_(const char *key, nanos_event_key_t *event_key); -extern nanos_err_t nanos_instrument_get_key(const char *key, nanos_event_key_t *event_key); -extern nanos_err_t nanos_instrument_get_value_(const char *key, const char *value, nanos_event_value_t *event_value); -extern nanos_err_t nanos_instrument_get_value(const char *key, const char *value, nanos_event_value_t *event_value); -extern nanos_err_t nanos_instrument_events_(unsigned int num_events, nanos_event_t events[]); -extern nanos_err_t nanos_instrument_events(unsigned int num_events, nanos_event_t events[]); -extern nanos_err_t nanos_instrument_enter_state_(nanos_event_state_value_t state); -extern nanos_err_t nanos_instrument_enter_state(nanos_event_state_value_t state); -extern nanos_err_t nanos_instrument_leave_state_(void); -extern nanos_err_t nanos_instrument_leave_state(void); -extern nanos_err_t nanos_instrument_enter_burst_(nanos_event_key_t key, nanos_event_value_t value); -extern nanos_err_t nanos_instrument_enter_burst(nanos_event_key_t key, nanos_event_value_t value); -extern nanos_err_t nanos_instrument_leave_burst_(nanos_event_key_t key); -extern nanos_err_t nanos_instrument_leave_burst(nanos_event_key_t key); -extern nanos_err_t nanos_instrument_point_event_(unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values); -extern nanos_err_t nanos_instrument_point_event(unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values); -extern nanos_err_t nanos_instrument_ptp_start_(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values); -extern nanos_err_t nanos_instrument_ptp_start(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values); -extern nanos_err_t nanos_instrument_ptp_end_(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values); -extern nanos_err_t nanos_instrument_ptp_end(nanos_event_domain_t domain, nanos_event_id_t id, unsigned int nkvs, nanos_event_key_t *keys, nanos_event_value_t *values); -extern nanos_err_t nanos_instrument_disable_state_events_(nanos_event_state_value_t state); -extern nanos_err_t nanos_instrument_disable_state_events(nanos_event_state_value_t state); -extern nanos_err_t nanos_instrument_enable_state_events_(void); -extern nanos_err_t nanos_instrument_enable_state_events(void); -extern nanos_err_t nanos_instrument_close_user_fun_event_(); -extern nanos_err_t nanos_instrument_close_user_fun_event(); -extern nanos_err_t nanos_instrument_enable_(void); -extern nanos_err_t nanos_instrument_enable(void); -extern nanos_err_t nanos_instrument_disable_(void); -extern nanos_err_t nanos_instrument_disable(void); -void nanos_reduction_int_vop(int, void *, void *); -void nanos_reduction_bop_add_char(void *arg1, void *arg2); -void nanos_reduction_vop_add_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_add_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_schar(void *arg1, void *arg2); -void nanos_reduction_vop_add_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_short(void *arg1, void *arg2); -void nanos_reduction_vop_add_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_add_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_int(void *arg1, void *arg2); -void nanos_reduction_vop_add_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_uint(void *arg1, void *arg2); -void nanos_reduction_vop_add_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_long(void *arg1, void *arg2); -void nanos_reduction_vop_add_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_add_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_add_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_add_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_add__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_float(void *arg1, void *arg2); -void nanos_reduction_vop_add_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_double(void *arg1, void *arg2); -void nanos_reduction_vop_add_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_add_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_add_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_char(void *arg1, void *arg2); -void nanos_reduction_vop_sub_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_sub_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_schar(void *arg1, void *arg2); -void nanos_reduction_vop_sub_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_short(void *arg1, void *arg2); -void nanos_reduction_vop_sub_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_sub_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_int(void *arg1, void *arg2); -void nanos_reduction_vop_sub_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_uint(void *arg1, void *arg2); -void nanos_reduction_vop_sub_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_long(void *arg1, void *arg2); -void nanos_reduction_vop_sub_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_sub_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_sub_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_sub_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_sub__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_float(void *arg1, void *arg2); -void nanos_reduction_vop_sub_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_double(void *arg1, void *arg2); -void nanos_reduction_vop_sub_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_sub_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_sub_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_char(void *arg1, void *arg2); -void nanos_reduction_vop_prod_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_prod_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_schar(void *arg1, void *arg2); -void nanos_reduction_vop_prod_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_short(void *arg1, void *arg2); -void nanos_reduction_vop_prod_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_prod_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_int(void *arg1, void *arg2); -void nanos_reduction_vop_prod_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_uint(void *arg1, void *arg2); -void nanos_reduction_vop_prod_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_long(void *arg1, void *arg2); -void nanos_reduction_vop_prod_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_prod_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_prod_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_prod_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_prod__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_float(void *arg1, void *arg2); -void nanos_reduction_vop_prod_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_double(void *arg1, void *arg2); -void nanos_reduction_vop_prod_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_prod_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_prod_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_char(void *arg1, void *arg2); -void nanos_reduction_vop_and_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_and_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_schar(void *arg1, void *arg2); -void nanos_reduction_vop_and_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_short(void *arg1, void *arg2); -void nanos_reduction_vop_and_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_and_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_int(void *arg1, void *arg2); -void nanos_reduction_vop_and_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_uint(void *arg1, void *arg2); -void nanos_reduction_vop_and_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_long(void *arg1, void *arg2); -void nanos_reduction_vop_and_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_and_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_and_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_and_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_and__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_and__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_char(void *arg1, void *arg2); -void nanos_reduction_vop_or_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_or_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_schar(void *arg1, void *arg2); -void nanos_reduction_vop_or_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_short(void *arg1, void *arg2); -void nanos_reduction_vop_or_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_or_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_int(void *arg1, void *arg2); -void nanos_reduction_vop_or_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_uint(void *arg1, void *arg2); -void nanos_reduction_vop_or_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_long(void *arg1, void *arg2); -void nanos_reduction_vop_or_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_or_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_or_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_or_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_or__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_or__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_char(void *arg1, void *arg2); -void nanos_reduction_vop_xor_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_xor_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_schar(void *arg1, void *arg2); -void nanos_reduction_vop_xor_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_short(void *arg1, void *arg2); -void nanos_reduction_vop_xor_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_xor_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_int(void *arg1, void *arg2); -void nanos_reduction_vop_xor_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_uint(void *arg1, void *arg2); -void nanos_reduction_vop_xor_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_long(void *arg1, void *arg2); -void nanos_reduction_vop_xor_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_xor_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_xor_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_xor_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_xor__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_xor__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_char(void *arg1, void *arg2); -void nanos_reduction_vop_land_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_land_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_schar(void *arg1, void *arg2); -void nanos_reduction_vop_land_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_short(void *arg1, void *arg2); -void nanos_reduction_vop_land_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_land_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_int(void *arg1, void *arg2); -void nanos_reduction_vop_land_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_uint(void *arg1, void *arg2); -void nanos_reduction_vop_land_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_long(void *arg1, void *arg2); -void nanos_reduction_vop_land_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_land_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_land_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_land_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_land__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_float(void *arg1, void *arg2); -void nanos_reduction_vop_land_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_double(void *arg1, void *arg2); -void nanos_reduction_vop_land_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_land_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_land_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_char(void *arg1, void *arg2); -void nanos_reduction_vop_lor_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_lor_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_schar(void *arg1, void *arg2); -void nanos_reduction_vop_lor_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_short(void *arg1, void *arg2); -void nanos_reduction_vop_lor_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_lor_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_int(void *arg1, void *arg2); -void nanos_reduction_vop_lor_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_uint(void *arg1, void *arg2); -void nanos_reduction_vop_lor_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_long(void *arg1, void *arg2); -void nanos_reduction_vop_lor_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_lor_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_lor_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_lor_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_lor__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_float(void *arg1, void *arg2); -void nanos_reduction_vop_lor_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_double(void *arg1, void *arg2); -void nanos_reduction_vop_lor_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_lor_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_lor_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_char(void *arg1, void *arg2); -void nanos_reduction_vop_max_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_max_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_schar(void *arg1, void *arg2); -void nanos_reduction_vop_max_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_short(void *arg1, void *arg2); -void nanos_reduction_vop_max_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_max_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_int(void *arg1, void *arg2); -void nanos_reduction_vop_max_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_uint(void *arg1, void *arg2); -void nanos_reduction_vop_max_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_long(void *arg1, void *arg2); -void nanos_reduction_vop_max_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_max_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_max_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_max_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_max__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_float(void *arg1, void *arg2); -void nanos_reduction_vop_max_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_double(void *arg1, void *arg2); -void nanos_reduction_vop_max_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_max_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_max_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_char(void *arg1, void *arg2); -void nanos_reduction_vop_min_char(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_uchar(void *arg1, void *arg2); -void nanos_reduction_vop_min_uchar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_schar(void *arg1, void *arg2); -void nanos_reduction_vop_min_schar(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_short(void *arg1, void *arg2); -void nanos_reduction_vop_min_short(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_ushort(void *arg1, void *arg2); -void nanos_reduction_vop_min_ushort(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_int(void *arg1, void *arg2); -void nanos_reduction_vop_min_int(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_uint(void *arg1, void *arg2); -void nanos_reduction_vop_min_uint(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_long(void *arg1, void *arg2); -void nanos_reduction_vop_min_long(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_ulong(void *arg1, void *arg2); -void nanos_reduction_vop_min_ulong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_longlong(void *arg1, void *arg2); -void nanos_reduction_vop_min_longlong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_ulonglong(void *arg1, void *arg2); -void nanos_reduction_vop_min_ulonglong(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min__Bool(void *arg1, void *arg2); -void nanos_reduction_vop_min__Bool(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_float(void *arg1, void *arg2); -void nanos_reduction_vop_min_float(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_double(void *arg1, void *arg2); -void nanos_reduction_vop_min_double(int i, void *arg1, void *arg2); -void nanos_reduction_bop_min_longdouble(void *arg1, void *arg2); -void nanos_reduction_vop_min_longdouble(int i, void *arg1, void *arg2); -void nanos_reduction_default_cleanup_char(void *r); -void nanos_reduction_default_cleanup_uchar(void *r); -void nanos_reduction_default_cleanup_schar(void *r); -void nanos_reduction_default_cleanup_short(void *r); -void nanos_reduction_default_cleanup_ushort(void *r); -void nanos_reduction_default_cleanup_int(void *r); -void nanos_reduction_default_cleanup_uint(void *r); -void nanos_reduction_default_cleanup_long(void *r); -void nanos_reduction_default_cleanup_ulong(void *r); -void nanos_reduction_default_cleanup_longlong(void *r); -void nanos_reduction_default_cleanup_ulonglong(void *r); -void nanos_reduction_default_cleanup__Bool(void *r); -void nanos_reduction_default_cleanup_float(void *r); -void nanos_reduction_default_cleanup_double(void *r); -void nanos_reduction_default_cleanup_longdouble(void *r); -typedef void *omp_lock_t; -typedef void *omp_nest_lock_t; -typedef enum omp_sched_t -{ - omp_sched_static = 1, - omp_sched_dynamic = 2, - omp_sched_guided = 3, - omp_sched_auto = 4 -} omp_sched_t; -extern void omp_set_num_threads(int num_threads); -extern int omp_get_num_threads(void); -extern int omp_get_max_threads(void); -extern int omp_get_thread_num(void); -extern int omp_get_num_procs(void); -extern int omp_in_parallel(void); -extern void omp_set_dynamic(int dynamic_threads); -extern int omp_get_dynamic(void); -extern void omp_set_nested(int nested); -extern int omp_get_nested(void); -extern int omp_get_thread_limit(void); -extern void omp_set_max_active_levels(int max_active_levels); -extern int omp_get_max_active_levels(void); -extern void omp_set_schedule(omp_sched_t kind, int modifier); -extern void omp_get_schedule(omp_sched_t *kind, int *modifier); -extern int omp_get_level(void); -extern int omp_get_ancestor_thread_num(int level); -extern int omp_get_team_size(int level); -extern int omp_get_active_level(void); -extern void omp_init_lock(omp_lock_t *lock); -extern void omp_destroy_lock(omp_lock_t *lock); -extern void omp_set_lock(omp_lock_t *lock); -extern void omp_unset_lock(omp_lock_t *lock); -extern int omp_test_lock(omp_lock_t *lock); -extern void omp_init_nest_lock(omp_nest_lock_t *lock); -extern void omp_destroy_nest_lock(omp_nest_lock_t *lock); -extern void omp_set_nest_lock(omp_nest_lock_t *lock); -extern void omp_unset_nest_lock(omp_nest_lock_t *lock); -extern int omp_test_nest_lock(omp_nest_lock_t *lock); -extern double omp_get_wtime(void); -extern double omp_get_wtick(void); -extern int omp_in_final(void); -nanos_err_t nanos_omp_single(_Bool *); -nanos_err_t nanos_omp_barrier(void); -void nanos_omp_set_interface(void *); -nanos_err_t nanos_omp_set_implicit(nanos_wd_t uwd); -int nanos_omp_get_max_threads(void); -nanos_ws_t nanos_omp_find_worksharing(omp_sched_t kind); -nanos_err_t nanos_omp_get_schedule(omp_sched_t *kind, int *modifier); -typedef __time_t time_t; -struct timespec -{ - __time_t tv_sec; - long int tv_nsec; -}; -struct sched_param -{ - int __sched_priority; -}; -struct __sched_param -{ - int __sched_priority; -}; -typedef unsigned long int __cpu_mask; -typedef struct -{ - __cpu_mask __bits[1024 / (8 * sizeof(__cpu_mask))]; -} cpu_set_t; -extern int __sched_cpucount(size_t __setsize, const cpu_set_t *__setp) __attribute__((__nothrow__, __leaf__)); -extern cpu_set_t *__sched_cpualloc(size_t __count) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void __sched_cpufree(cpu_set_t *__set) __attribute__((__nothrow__, __leaf__)); -extern int sched_setparam(__pid_t __pid, __const struct sched_param *__param) __attribute__((__nothrow__, __leaf__)); -extern int sched_getparam(__pid_t __pid, struct sched_param *__param) __attribute__((__nothrow__, __leaf__)); -extern int sched_setscheduler(__pid_t __pid, int __policy, __const struct sched_param *__param) __attribute__((__nothrow__, __leaf__)); -extern int sched_getscheduler(__pid_t __pid) __attribute__((__nothrow__, __leaf__)); -extern int sched_yield(void) __attribute__((__nothrow__, __leaf__)); -extern int sched_get_priority_max(int __algorithm) __attribute__((__nothrow__, __leaf__)); -extern int sched_get_priority_min(int __algorithm) __attribute__((__nothrow__, __leaf__)); -extern int sched_rr_get_interval(__pid_t __pid, struct timespec *__t) __attribute__((__nothrow__, __leaf__)); -typedef __clock_t clock_t; -typedef __clockid_t clockid_t; -typedef __timer_t timer_t; -struct tm -{ - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; - long int tm_gmtoff; - __const char *tm_zone; -}; -struct itimerspec -{ - struct timespec it_interval; - struct timespec it_value; -}; -struct sigevent; -extern clock_t clock(void) __attribute__((__nothrow__, __leaf__)); -extern time_t time(time_t *__timer) __attribute__((__nothrow__, __leaf__)); -extern double difftime(time_t __time1, time_t __time0) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern time_t mktime(struct tm *__tp) __attribute__((__nothrow__, __leaf__)); -extern size_t strftime(char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) __attribute__((__nothrow__, __leaf__)); -typedef struct __locale_struct -{ - struct __locale_data *__locales[13]; - const unsigned short int *__ctype_b; - const int *__ctype_tolower; - const int *__ctype_toupper; - const char *__names[13]; -} *__locale_t; -typedef __locale_t locale_t; -extern size_t strftime_l(char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp, __locale_t __loc) __attribute__((__nothrow__, __leaf__)); -extern struct tm *gmtime(__const time_t *__timer) __attribute__((__nothrow__, __leaf__)); -extern struct tm *localtime(__const time_t *__timer) __attribute__((__nothrow__, __leaf__)); -extern struct tm *gmtime_r(__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__((__nothrow__, __leaf__)); -extern struct tm *localtime_r(__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__((__nothrow__, __leaf__)); -extern char *asctime(__const struct tm *__tp) __attribute__((__nothrow__, __leaf__)); -extern char *ctime(__const time_t *__timer) __attribute__((__nothrow__, __leaf__)); -extern char *asctime_r(__const struct tm *__restrict __tp, char *__restrict __buf) __attribute__((__nothrow__, __leaf__)); -extern char *ctime_r(__const time_t *__restrict __timer, char *__restrict __buf) __attribute__((__nothrow__, __leaf__)); -extern char *__tzname[2]; -extern int __daylight; -extern long int __timezone; -extern char *tzname[2]; -extern void tzset(void) __attribute__((__nothrow__, __leaf__)); -extern int daylight; -extern long int timezone; -extern int stime(__const time_t *__when) __attribute__((__nothrow__, __leaf__)); -extern time_t timegm(struct tm *__tp) __attribute__((__nothrow__, __leaf__)); -extern time_t timelocal(struct tm *__tp) __attribute__((__nothrow__, __leaf__)); -extern int dysize(int __year) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int nanosleep(__const struct timespec *__requested_time, struct timespec *__remaining); -extern int clock_getres(clockid_t __clock_id, struct timespec *__res) __attribute__((__nothrow__, __leaf__)); -extern int clock_gettime(clockid_t __clock_id, struct timespec *__tp) __attribute__((__nothrow__, __leaf__)); -extern int clock_settime(clockid_t __clock_id, __const struct timespec *__tp) __attribute__((__nothrow__, __leaf__)); -extern int clock_nanosleep(clockid_t __clock_id, int __flags, __const struct timespec *__req, struct timespec *__rem); -extern int clock_getcpuclockid(pid_t __pid, clockid_t *__clock_id) __attribute__((__nothrow__, __leaf__)); -extern int timer_create(clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __attribute__((__nothrow__, __leaf__)); -extern int timer_delete(timer_t __timerid) __attribute__((__nothrow__, __leaf__)); -extern int timer_settime(timer_t __timerid, int __flags, __const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __attribute__((__nothrow__, __leaf__)); -extern int timer_gettime(timer_t __timerid, struct itimerspec *__value) __attribute__((__nothrow__, __leaf__)); -extern int timer_getoverrun(timer_t __timerid) __attribute__((__nothrow__, __leaf__)); -typedef unsigned long int pthread_t; -typedef union -{ - char __size[56]; - long int __align; -} pthread_attr_t; -typedef struct __pthread_internal_list -{ - struct __pthread_internal_list *__prev; - struct __pthread_internal_list *__next; -} __pthread_list_t; -typedef union -{ - struct __pthread_mutex_s - { - int __lock; - unsigned int __count; - int __owner; - unsigned int __nusers; - int __kind; - int __spins; - __pthread_list_t __list; - } __data; - char __size[40]; - long int __align; -} pthread_mutex_t; -typedef union -{ - char __size[4]; - int __align; -} pthread_mutexattr_t; -typedef union -{ - struct - { - int __lock; - unsigned int __futex; - __extension__ - unsigned long long int __total_seq; - __extension__ - unsigned long long int __wakeup_seq; - __extension__ - unsigned long long int __woken_seq; - void *__mutex; - unsigned int __nwaiters; - unsigned int __broadcast_seq; - } __data; - char __size[48]; - __extension__ - long long int __align; -} pthread_cond_t; -typedef union -{ - char __size[4]; - int __align; -} pthread_condattr_t; -typedef unsigned int pthread_key_t; -typedef int pthread_once_t; -typedef union -{ - struct - { - int __lock; - unsigned int __nr_readers; - unsigned int __readers_wakeup; - unsigned int __writer_wakeup; - unsigned int __nr_readers_queued; - unsigned int __nr_writers_queued; - int __writer; - int __shared; - unsigned long int __pad1; - unsigned long int __pad2; - unsigned int __flags; - } __data; - char __size[56]; - long int __align; -} pthread_rwlock_t; -typedef union -{ - char __size[8]; - long int __align; -} pthread_rwlockattr_t; -typedef volatile int pthread_spinlock_t; -typedef union -{ - char __size[32]; - long int __align; -} pthread_barrier_t; -typedef union -{ - char __size[4]; - int __align; -} pthread_barrierattr_t; -typedef long int __jmp_buf[8]; -enum -{ - PTHREAD_CREATE_JOINABLE, - PTHREAD_CREATE_DETACHED -}; -enum -{ - PTHREAD_MUTEX_TIMED_NP, - PTHREAD_MUTEX_RECURSIVE_NP, - PTHREAD_MUTEX_ERRORCHECK_NP, - PTHREAD_MUTEX_ADAPTIVE_NP, - PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, - PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, - PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, - PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL -}; -enum -{ - PTHREAD_MUTEX_STALLED, - PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, - PTHREAD_MUTEX_ROBUST, - PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST -}; -enum -{ - PTHREAD_RWLOCK_PREFER_READER_NP, - PTHREAD_RWLOCK_PREFER_WRITER_NP, - PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, - PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP -}; -enum -{ - PTHREAD_INHERIT_SCHED, - PTHREAD_EXPLICIT_SCHED -}; -enum -{ - PTHREAD_SCOPE_SYSTEM, - PTHREAD_SCOPE_PROCESS -}; -enum -{ - PTHREAD_PROCESS_PRIVATE, - PTHREAD_PROCESS_SHARED -}; -struct _pthread_cleanup_buffer -{ - void (*__routine)(void *); - void *__arg; - int __canceltype; - struct _pthread_cleanup_buffer *__prev; -}; -enum -{ - PTHREAD_CANCEL_ENABLE, - PTHREAD_CANCEL_DISABLE -}; -enum -{ - PTHREAD_CANCEL_DEFERRED, - PTHREAD_CANCEL_ASYNCHRONOUS -}; -extern int pthread_create(pthread_t *__restrict __newthread, __const pthread_attr_t *__restrict __attr, void *(*__start_routine)(void *), void *__restrict __arg) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 3))); -extern void pthread_exit(void *__retval) __attribute__((__noreturn__)); -extern int pthread_join(pthread_t __th, void **__thread_return); -extern int pthread_detach(pthread_t __th) __attribute__((__nothrow__, __leaf__)); -extern pthread_t pthread_self(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int pthread_equal(pthread_t __thread1, pthread_t __thread2) __attribute__((__nothrow__, __leaf__)); -extern int pthread_attr_init(pthread_attr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_destroy(pthread_attr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getdetachstate(__const pthread_attr_t *__attr, int *__detachstate) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setdetachstate(pthread_attr_t *__attr, int __detachstate) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getguardsize(__const pthread_attr_t *__attr, size_t *__guardsize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setguardsize(pthread_attr_t *__attr, size_t __guardsize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getschedparam(__const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setschedparam(pthread_attr_t *__restrict __attr, __const struct sched_param *__restrict __param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_getschedpolicy(__const pthread_attr_t *__restrict __attr, int *__restrict __policy) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setschedpolicy(pthread_attr_t *__attr, int __policy) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getinheritsched(__const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setinheritsched(pthread_attr_t *__attr, int __inherit) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getscope(__const pthread_attr_t *__restrict __attr, int *__restrict __scope) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setscope(pthread_attr_t *__attr, int __scope) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getstackaddr(__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))) __attribute__((__deprecated__)); -extern int pthread_attr_setstackaddr(pthread_attr_t *__attr, void *__stackaddr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__deprecated__)); -extern int pthread_attr_getstacksize(__const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_attr_setstacksize(pthread_attr_t *__attr, size_t __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_attr_getstack(__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2, 3))); -extern int pthread_attr_setstack(pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_setschedparam(pthread_t __target_thread, int __policy, __const struct sched_param *__param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3))); -extern int pthread_getschedparam(pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))); -extern int pthread_setschedprio(pthread_t __target_thread, int __prio) __attribute__((__nothrow__, __leaf__)); -extern int pthread_once(pthread_once_t *__once_control, void (*__init_routine)(void)) __attribute__((__nonnull__(1, 2))); -extern int pthread_setcancelstate(int __state, int *__oldstate); -extern int pthread_setcanceltype(int __type, int *__oldtype); -extern int pthread_cancel(pthread_t __th); -extern void pthread_testcancel(void); -typedef struct -{ - struct - { - __jmp_buf __cancel_jmp_buf; - int __mask_was_saved; - } __cancel_jmp_buf[1]; - void *__pad[4]; -} __pthread_unwind_buf_t __attribute__((__aligned__)); -struct __pthread_cleanup_frame -{ - void (*__cancel_routine)(void *); - void *__cancel_arg; - int __do_it; - int __cancel_type; -}; -extern void __pthread_register_cancel(__pthread_unwind_buf_t *__buf); -extern void __pthread_unregister_cancel(__pthread_unwind_buf_t *__buf); -extern void __pthread_unwind_next(__pthread_unwind_buf_t *__buf) __attribute__((__noreturn__)) __attribute__((__weak__)); -struct __jmp_buf_tag; -extern int __sigsetjmp(struct __jmp_buf_tag *__env, int __savemask) __attribute__((__nothrow__, __leaf__)); -extern int pthread_mutex_init(pthread_mutex_t *__mutex, __const pthread_mutexattr_t *__mutexattr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutex_destroy(pthread_mutex_t *__mutex) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutex_trylock(pthread_mutex_t *__mutex) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_mutex_lock(pthread_mutex_t *__mutex) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_mutex_timedlock(pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutex_unlock(pthread_mutex_t *__mutex) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_mutex_getprioceiling(__const pthread_mutex_t *__restrict __mutex, int *__restrict __prioceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutex_setprioceiling(pthread_mutex_t *__restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 3))); -extern int pthread_mutex_consistent(pthread_mutex_t *__mutex) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_getpshared(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_gettype(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, int __kind) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_getprotocol(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __protocol) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr, int __protocol) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_getprioceiling(__const pthread_mutexattr_t *__restrict __attr, int *__restrict __prioceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr, int __prioceiling) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_mutexattr_getrobust(__const pthread_mutexattr_t *__attr, int *__robustness) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_mutexattr_setrobust(pthread_mutexattr_t *__attr, int __robustness) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_init(pthread_rwlock_t *__restrict __rwlock, __const pthread_rwlockattr_t *__restrict __attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_tryrdlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_timedrdlock(pthread_rwlock_t *__restrict __rwlock, __const struct timespec *__restrict __abstime) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_rwlock_wrlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlock_timedwrlock(pthread_rwlock_t *__restrict __rwlock, __const struct timespec *__restrict __abstime) __attribute__((__nothrow__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_rwlock_unlock(pthread_rwlock_t *__rwlock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlockattr_init(pthread_rwlockattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlockattr_destroy(pthread_rwlockattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlockattr_getpshared(__const pthread_rwlockattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_rwlockattr_getkind_np(__const pthread_rwlockattr_t *__restrict __attr, int *__restrict __pref) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *__attr, int __pref) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_cond_init(pthread_cond_t *__restrict __cond, __const pthread_condattr_t *__restrict __cond_attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_cond_destroy(pthread_cond_t *__cond) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_cond_signal(pthread_cond_t *__cond) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_cond_broadcast(pthread_cond_t *__cond) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_cond_wait(pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex) __attribute__((__nonnull__(1, 2))); -extern int pthread_cond_timedwait(pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime) __attribute__((__nonnull__(1, 2, 3))); -extern int pthread_condattr_init(pthread_condattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_condattr_destroy(pthread_condattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_condattr_getpshared(__const pthread_condattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_condattr_setpshared(pthread_condattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_condattr_getclock(__const pthread_condattr_t *__restrict __attr, __clockid_t *__restrict __clock_id) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_condattr_setclock(pthread_condattr_t *__attr, __clockid_t __clock_id) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_spin_init(pthread_spinlock_t *__lock, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_spin_destroy(pthread_spinlock_t *__lock) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_spin_lock(pthread_spinlock_t *__lock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_spin_trylock(pthread_spinlock_t *__lock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_spin_unlock(pthread_spinlock_t *__lock) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_barrier_init(pthread_barrier_t *__restrict __barrier, __const pthread_barrierattr_t *__restrict __attr, unsigned int __count) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_barrier_destroy(pthread_barrier_t *__barrier) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_barrier_wait(pthread_barrier_t *__barrier) __attribute__((__nothrow__)) __attribute__((__nonnull__(1))); -extern int pthread_barrierattr_init(pthread_barrierattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_barrierattr_destroy(pthread_barrierattr_t *__attr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_barrierattr_getpshared(__const pthread_barrierattr_t *__restrict __attr, int *__restrict __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int pthread_barrierattr_setpshared(pthread_barrierattr_t *__attr, int __pshared) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_key_create(pthread_key_t *__key, void (*__destr_function)(void *)) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int pthread_key_delete(pthread_key_t __key) __attribute__((__nothrow__, __leaf__)); -extern void *pthread_getspecific(pthread_key_t __key) __attribute__((__nothrow__, __leaf__)); -extern int pthread_setspecific(pthread_key_t __key, __const void *__pointer) __attribute__((__nothrow__, __leaf__)); -extern int pthread_getcpuclockid(pthread_t __thread_id, __clockid_t *__clock_id) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int pthread_atfork(void (*__prepare)(void), void (*__parent)(void), void (*__child)(void)) __attribute__((__nothrow__, __leaf__)); -extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) pthread_equal(pthread_t __thread1, pthread_t __thread2) -{ - return __thread1 == __thread2; -} -extern int *__errno_location(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -void *av_malloc(unsigned int size) __attribute__((__malloc__)); -void *av_realloc(void *ptr, unsigned int size); -void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size); -void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size); -void av_free(void *ptr); -void *av_mallocz(unsigned int size) __attribute__((__malloc__)); -char *av_strdup(const char *s) __attribute__((__malloc__)); -void av_freep(void *ptr); -static __attribute__((always_inline)) inline uint32_t pack16to32(int a, int b) -{ - return (a & 0xFFFF) + (b << 16); -} -static __attribute__((always_inline)) inline uint16_t pack8to16(int a, int b) -{ - return (a & 0xFF) + (b << 8); -} -typedef short DCTELEM; -enum AVColorPrimaries -{ - AVCOL_PRI_BT709 = 1, - AVCOL_PRI_UNSPECIFIED = 2, - AVCOL_PRI_BT470M = 4, - AVCOL_PRI_BT470BG = 5, - AVCOL_PRI_SMPTE170M = 6, - AVCOL_PRI_SMPTE240M = 7, - AVCOL_PRI_FILM = 8, - AVCOL_PRI_NB -}; -enum AVColorTransferCharacteristic -{ - AVCOL_TRC_BT709 = 1, - AVCOL_TRC_UNSPECIFIED = 2, - AVCOL_TRC_GAMMA22 = 4, - AVCOL_TRC_GAMMA28 = 5, - AVCOL_TRC_NB -}; -enum AVColorSpace -{ - AVCOL_SPC_RGB = 0, - AVCOL_SPC_BT709 = 1, - AVCOL_SPC_UNSPECIFIED = 2, - AVCOL_SPC_FCC = 4, - AVCOL_SPC_BT470BG = 5, - AVCOL_SPC_SMPTE170M = 6, - AVCOL_SPC_SMPTE240M = 7, - AVCOL_SPC_NB -}; -enum AVColorRange -{ - AVCOL_RANGE_UNSPECIFIED = 0, - AVCOL_RANGE_MPEG = 1, - AVCOL_RANGE_JPEG = 2, - AVCOL_RANGE_NB -}; -typedef enum MMCOOpcode -{ - MMCO_END = 0, - MMCO_SHORT2UNUSED, - MMCO_LONG2UNUSED, - MMCO_SHORT2LONG, - MMCO_SET_MAX_LONG, - MMCO_RESET, - MMCO_LONG -} MMCOOpcode; -enum -{ - NAL_SLICE = 1, - NAL_DPA, - NAL_DPB, - NAL_DPC, - NAL_IDR_SLICE, - NAL_SEI, - NAL_SPS, - NAL_PPS, - NAL_AUD, - NAL_END_SEQUENCE, - NAL_END_STREAM, - NAL_FILLER_DATA, - NAL_SPS_EXT, - NAL_AUXILIARY_SLICE = 19 -}; -typedef enum -{ - SEI_BUFFERING_PERIOD = 0, - SEI_TYPE_PIC_TIMING = 1, - SEI_TYPE_USER_DATA_UNREGISTERED = 5, - SEI_TYPE_RECOVERY_POINT = 6 -} SEI_Type; -typedef enum -{ - SEI_PIC_STRUCT_FRAME = 0, - SEI_PIC_STRUCT_TOP_FIELD = 1, - SEI_PIC_STRUCT_BOTTOM_FIELD = 2, - SEI_PIC_STRUCT_TOP_BOTTOM = 3, - SEI_PIC_STRUCT_BOTTOM_TOP = 4, - SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, - SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, - SEI_PIC_STRUCT_FRAME_DOUBLING = 7, - SEI_PIC_STRUCT_FRAME_TRIPLING = 8 -} SEI_PicStructType; -typedef struct SPS -{ - int profile_idc; - int level_idc; - int chroma_format_idc; - int transform_bypass; - int log2_max_frame_num; - int poc_type; - int log2_max_poc_lsb; - int delta_pic_order_always_zero_flag; - int offset_for_non_ref_pic; - int offset_for_top_to_bottom_field; - int poc_cycle_length; - int ref_frame_count; - int gaps_in_frame_num_allowed_flag; - int mb_width; - int mb_height; - int frame_mbs_only_flag; - int mb_aff; - int direct_8x8_inference_flag; - int crop; - unsigned int crop_left; - unsigned int crop_right; - unsigned int crop_top; - unsigned int crop_bottom; - int vui_parameters_present_flag; - int num, den; - int video_signal_type_present_flag; - int full_range; - int colour_description_present_flag; - enum AVColorPrimaries color_primaries; - enum AVColorTransferCharacteristic color_trc; - enum AVColorSpace colorspace; - int timing_info_present_flag; - uint32_t num_units_in_tick; - uint32_t time_scale; - int fixed_frame_rate_flag; - short offset_for_ref_frame[256]; - int bitstream_restriction_flag; - int num_reorder_frames; - int scaling_matrix_present; - uint8_t scaling_matrix4[6][16]; - uint8_t scaling_matrix8[2][64]; - int nal_hrd_parameters_present_flag; - int vcl_hrd_parameters_present_flag; - int pic_struct_present_flag; - int time_offset_length; - int cpb_cnt; - int initial_cpb_removal_delay_length; - int cpb_removal_delay_length; - int dpb_output_delay_length; - int bit_depth_luma; - int bit_depth_chroma; - int residual_color_transform_flag; -} SPS; -typedef struct PPS -{ - unsigned int sps_id; - int cabac; - int pic_order_present; - int slice_group_count; - int mb_slice_group_map_type; - unsigned int ref_count[2]; - int weighted_pred; - int weighted_bipred_idc; - int init_qp; - int init_qs; - int chroma_qp_index_offset[2]; - int deblocking_filter_parameters_present; - int constrained_intra_pred; - int redundant_pic_cnt_present; - int transform_8x8_mode; - uint8_t scaling_matrix4[6][16]; - uint8_t scaling_matrix8[2][64]; - uint8_t chroma_qp_table[2][64]; - int chroma_qp_diff; -} PPS; -typedef struct TopBorder -{ - uint8_t unfiltered_y[16]; - uint8_t unfiltered_cb[8]; - uint8_t unfiltered_cr[8]; - uint8_t top_borders_y[16 * 4]; - uint8_t top_borders_cb[8 * 2]; - uint8_t top_borders_cr[8 * 2]; -} TopBorder; -typedef struct LeftBorder -{ - uint8_t unfiltered_y[17]; - uint8_t unfiltered_cb[9]; - uint8_t unfiltered_cr[9]; -} LeftBorder; -typedef struct H264Mb -{ - int16_t mb_x, mb_y; - int32_t mb_type; - uint16_t cbp; - int8_t qscale_mb_xy; - int8_t qscale_left_mb_xy; - int8_t qscale_top_mb_xy; - uint16_t __attribute__((aligned(8))) sub_mb_type[4]; - uint8_t __attribute__((aligned(8))) non_zero_count[24]; - int16_t __attribute__((aligned(16))) mb[16 * 24]; - union - { - struct - { - int8_t __attribute__((aligned(8))) ref_index[2][4]; - int16_t __attribute__((aligned(16))) mvd[2][16][2]; - }; - struct - { - int8_t __attribute__((aligned(8))) intra4x4_pred_mode[16]; - int8_t chroma_pred_mode; - int8_t intra16x16_pred_mode; - }; - }; - uint8_t __attribute__((aligned(8))) top_border[16 + 2 * 8]; - uint8_t __attribute__((aligned(8))) top_border_next[8]; - uint8_t __attribute__((aligned(8))) left_border[17 + 2 * 9]; - int8_t intra4x4_pred_mode_left[4]; -} H264Mb; -typedef struct RawFrame -{ - uint8_t *data; - int size; - unsigned int data_size; - int64_t pos; - int state; -} RawFrame; -typedef struct PictureInfo -{ - int ref_poc[2][16]; - int ref_count[2]; - int poc; - int frame_num; - int pic_id; - int long_ref; - int cpn; - int slice_type_nos; - int reference; -} PictureInfo; -typedef struct DecodedPicture -{ - int16_t (*motion_val[2])[2]; - int16_t (*motion_val_base[2])[2]; - int8_t *ref_index[2]; - uint32_t *mb_type; - uint32_t *mb_type_base; - int8_t *intra4x4_pred_mode; - int8_t *non_zero_count; - uint8_t *data[3]; - int linesize[3]; - uint8_t *base[3]; - int cpn; - int poc; - int reference; - int key_frame; - int mmco_reset; -} DecodedPicture; -extern void __assert_fail(__const char *__assertion, __const char *__file, unsigned int __line, __const char *__function) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); -extern void __assert_perror_fail(int __errnum, __const char *__file, unsigned int __line, __const char *__function) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); -extern void __assert(const char *__assertion, const char *__file, int __line) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); -typedef int64_t x86_reg; -typedef struct CABACContext -{ - int low; - int range; - int outstanding_count; - const uint8_t *bytestream_start; - const uint8_t *bytestream; - const uint8_t *bytestream_end; - uint8_t cabac_state[460]; -} CABACContext; -extern uint8_t ff_h264_mlps_state[4 * 64]; -extern uint8_t ff_h264_lps_range[4 * 2 * 64]; -extern uint8_t ff_h264_mps_state[2 * 64]; -extern uint8_t ff_h264_lps_state[2 * 64]; -extern const uint8_t ff_h264_norm_shift[512]; -void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size); -void ff_init_cabac_states(void); -static void refill(CABACContext *c) -{ - c->low += (c->bytestream[0] << 9) + (c->bytestream[1] << 1); - c->low -= ((1 << 16) - 1); - c->bytestream += 16 / 8; -} -static void refill2(CABACContext *c) -{ - int i, x; - x = c->low ^ (c->low - 1); - i = 7 - ff_h264_norm_shift[x >> (16 - 1)]; - x = - ((1 << 16) - 1); - x += (c->bytestream[0] << 9) + (c->bytestream[1] << 1); - c->low += x << i; - c->bytestream += 16 / 8; -} -static inline void renorm_cabac_decoder(CABACContext *c) -{ - while (c->range < 0x100) + if ((a + 2147483648U) & ~4294967295LU) { - c->range += c->range; - c->low += c->low; - if (!(c->low & ((1 << 16) - 1))) - refill(c); + return a >> 63 ^ 2147483647; + } + else + { + return a; } } -static inline void renorm_cabac_decoder_once(CABACContext *c) +static __inline __attribute__((const)) float av_clipf(float a, float amin, float amax) { - int shift = (uint32_t) (c->range - 0x100) >> 31; - c->range <<= shift; - c->low <<= shift; - if (!(c->low & ((1 << 16) - 1))) - refill(c); -} -static __attribute__((always_inline)) inline int get_cabac_inline(CABACContext *c, uint8_t *const state) -{ - int s = *state; - int RangeLPS = ff_h264_lps_range[2 * (c->range & 0xC0) + s]; - int bit, lps_mask __attribute__((unused)); - c->range -= RangeLPS; - lps_mask = ((c->range << (16 + 1)) - c->low) >> 31; - c->low -= (c->range << (16 + 1)) & lps_mask; - c->range += (RangeLPS - c->range) & lps_mask; - s ^= lps_mask; - *state = (ff_h264_mlps_state + 128)[s]; - bit = s & 1; - lps_mask = ff_h264_norm_shift[c->range]; - c->range <<= lps_mask; - c->low <<= lps_mask; - if (!(c->low & ((1 << 16) - 1))) - refill2(c); - return bit; -} -static int __attribute__((noinline)) __attribute__((unused)) get_cabac_noinline(CABACContext *c, uint8_t *const state) -{ - return get_cabac_inline(c, state); -} -static int __attribute__((unused)) get_cabac(CABACContext *c, uint8_t *const state) -{ - return get_cabac_inline(c, state); -} -static int __attribute__((unused)) get_cabac_bypass(CABACContext *c) -{ - int range; - c->low += c->low; - if (!(c->low & ((1 << 16) - 1))) - refill(c); - range = c->range << (16 + 1); - if (c->low < range) + if (a < amin) { - return 0; + return amin; } - else + else { - c->low -= range; - return 1; + if (a > amax) + { + return amax; + } + else + { + return a; + } } } -static __attribute__((always_inline)) inline int get_cabac_bypass_sign(CABACContext *c, int val) +static __inline __attribute__((const)) int av_ceil_log2(int x) { - int range, mask; - c->low += c->low; - if (!(c->low & ((1 << 16) - 1))) - refill(c); - range = c->range << (16 + 1); - c->low -= range; - mask = c->low >> 31; - range &= mask; - c->low += range; - return (val ^ mask) - mask; + return av_log2_c((x - 1) << 1); } -static int __attribute__((unused)) get_cabac_terminate(CABACContext *c) +static __inline __attribute__((always_inline)) void AV_COPY64(void *d, const void *s) { - c->range -= 2; - if (c->low < c->range << (16 + 1)) + __asm__ ("movq %1, %%mm0 \n\t""movq %%mm0, %0 \n\t" : "=m"(*((uint64_t *)d)) : "m"(*((const uint64_t *)s)) : "mm0"); +} +static __inline __attribute__((always_inline)) void AV_SWAP64(void *a, void *b) +{ + __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"); +} +static __inline __attribute__((always_inline)) void AV_ZERO64(void *d) +{ + __asm__ ("pxor %%mm0, %%mm0 \n\t""movq %%mm0, %0 \n\t" : "=m"(*((uint64_t *)d)) : : "mm0"); +} +static __inline __attribute__((always_inline)) void AV_COPY128(void *d, const void *s) +{ + struct v; + struct v + { + uint64_t v[2]; + }; + __asm__ ("movaps %1, %%xmm0 \n\t""movaps %%xmm0, %0 \n\t" : "=m"(*((struct v *)d)) : "m"(*((const struct v *)s)) : "xmm0"); +} +static __inline __attribute__((always_inline)) void AV_ZERO128(void *d) +{ + struct v; + struct v + { + uint64_t v[2]; + }; + __asm__ ("pxor %%xmm0, %%xmm0 \n\t""movdqa %%xmm0, %0 \n\t" : "=m"(*((struct v *)d)) : : "xmm0"); +} +static __inline uint32_t rnd_avg32(uint32_t a, uint32_t b) +{ + return (a | b) - (((a ^ b) & ~(1 * 16843009LU)) >> 1); +} +static __inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b) +{ + return (a & b) + (((a ^ b) & ~(1 * 16843009LU)) >> 1); +} +static __inline void emms(void) +{ + __asm__ volatile("emms;" : : : "memory"); +} +static __inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { - renorm_cabac_decoder_once(c); - return 0; - } - else - { - return c->bytestream - c->bytestream_start; - } -} -static __attribute__((always_inline)) inline __attribute__((const)) uint16_t bswap_16(uint16_t x) -{ - __asm__ ("rorw $8, %0": "+r" (x): ); - return x; -} -static __attribute__((always_inline)) inline __attribute__((const)) uint32_t bswap_32(uint32_t x) -{ - __asm__ ("bswap %0": "+r" (x): ); - return x; -} -static inline uint64_t __attribute__((const)) bswap_64(uint64_t x) -{ - __asm__ ("bswap %0": "=r" (x): "0" (x)); - return x; -} -enum -{ - _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), - _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), - _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), - _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), - _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), - _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), - _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), - _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), - _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), - _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), - _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), - _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) -}; -extern __const unsigned short int **__ctype_b_loc(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const)); -extern __const __int32_t **__ctype_tolower_loc(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const)); -extern __const __int32_t **__ctype_toupper_loc(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__const)); -extern int isalnum(int) __attribute__((__nothrow__, __leaf__)); -extern int isalpha(int) __attribute__((__nothrow__, __leaf__)); -extern int iscntrl(int) __attribute__((__nothrow__, __leaf__)); -extern int isdigit(int) __attribute__((__nothrow__, __leaf__)); -extern int islower(int) __attribute__((__nothrow__, __leaf__)); -extern int isgraph(int) __attribute__((__nothrow__, __leaf__)); -extern int isprint(int) __attribute__((__nothrow__, __leaf__)); -extern int ispunct(int) __attribute__((__nothrow__, __leaf__)); -extern int isspace(int) __attribute__((__nothrow__, __leaf__)); -extern int isupper(int) __attribute__((__nothrow__, __leaf__)); -extern int isxdigit(int) __attribute__((__nothrow__, __leaf__)); -extern int tolower(int __c) __attribute__((__nothrow__, __leaf__)); -extern int toupper(int __c) __attribute__((__nothrow__, __leaf__)); -extern int isblank(int) __attribute__((__nothrow__, __leaf__)); -extern int isascii(int __c) __attribute__((__nothrow__, __leaf__)); -extern int toascii(int __c) __attribute__((__nothrow__, __leaf__)); -extern int _toupper(int) __attribute__((__nothrow__, __leaf__)); -extern int _tolower(int) __attribute__((__nothrow__, __leaf__)); -extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) tolower(int __c) -{ - return __c >= - 128 && __c < 256 ? (*__ctype_tolower_loc())[__c] : __c; -} -extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) toupper(int __c) -{ - return __c >= - 128 && __c < 256 ? (*__ctype_toupper_loc())[__c] : __c; -} -extern int isalnum_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isalpha_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int iscntrl_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isdigit_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int islower_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isgraph_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isprint_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int ispunct_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isspace_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isupper_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isxdigit_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int isblank_l(int, __locale_t) __attribute__((__nothrow__, __leaf__)); -extern int __tolower_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__)); -extern int tolower_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__)); -extern int __toupper_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__)); -extern int toupper_l(int __c, __locale_t __l) __attribute__((__nothrow__, __leaf__)); -typedef int __gwchar_t; -typedef struct -{ - long int quot; - long int rem; -} imaxdiv_t; -extern intmax_t imaxabs(intmax_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern intmax_t strtoimax(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)); -extern uintmax_t strtoumax(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)); -extern intmax_t wcstoimax(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)); -extern uintmax_t wcstoumax(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)); -extern long int __strtol_internal(__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern __inline __attribute__((__gnu_inline__)) intmax_t __attribute__((__nothrow__, __leaf__)) strtoimax(__const char *__restrict nptr, char **__restrict endptr, int base) -{ - return __strtol_internal(nptr, endptr, base, 0); -} -extern unsigned long int __strtoul_internal(__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern __inline __attribute__((__gnu_inline__)) uintmax_t __attribute__((__nothrow__, __leaf__)) strtoumax(__const char *__restrict nptr, char **__restrict endptr, int base) -{ - return __strtoul_internal(nptr, endptr, base, 0); -} -extern long int __wcstol_internal(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern __inline __attribute__((__gnu_inline__)) intmax_t __attribute__((__nothrow__, __leaf__)) wcstoimax(__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) -{ - return __wcstol_internal(nptr, endptr, base, 0); -} -extern unsigned long int __wcstoul_internal(__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern __inline __attribute__((__gnu_inline__)) uintmax_t __attribute__((__nothrow__, __leaf__)) wcstoumax(__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) -{ - return __wcstoul_internal(nptr, endptr, base, 0); -} -typedef float float_t; -typedef double double_t; -extern double acos(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __acos(double __x) __attribute__((__nothrow__, __leaf__)); -extern double asin(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __asin(double __x) __attribute__((__nothrow__, __leaf__)); -extern double atan(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __atan(double __x) __attribute__((__nothrow__, __leaf__)); -extern double atan2(double __y, double __x) __attribute__((__nothrow__, __leaf__)); -extern double __atan2(double __y, double __x) __attribute__((__nothrow__, __leaf__)); -extern double cos(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __cos(double __x) __attribute__((__nothrow__, __leaf__)); -extern double sin(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __sin(double __x) __attribute__((__nothrow__, __leaf__)); -extern double tan(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __tan(double __x) __attribute__((__nothrow__, __leaf__)); -extern double cosh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __cosh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double sinh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __sinh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double tanh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __tanh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double acosh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __acosh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double asinh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __asinh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double atanh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __atanh(double __x) __attribute__((__nothrow__, __leaf__)); -extern double exp(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __exp(double __x) __attribute__((__nothrow__, __leaf__)); -extern double frexp(double __x, int *__exponent) __attribute__((__nothrow__, __leaf__)); -extern double __frexp(double __x, int *__exponent) __attribute__((__nothrow__, __leaf__)); -extern double ldexp(double __x, int __exponent) __attribute__((__nothrow__, __leaf__)); -extern double __ldexp(double __x, int __exponent) __attribute__((__nothrow__, __leaf__)); -extern double log(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __log(double __x) __attribute__((__nothrow__, __leaf__)); -extern double log10(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __log10(double __x) __attribute__((__nothrow__, __leaf__)); -extern double modf(double __x, double *__iptr) __attribute__((__nothrow__, __leaf__)); -extern double __modf(double __x, double *__iptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern double expm1(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __expm1(double __x) __attribute__((__nothrow__, __leaf__)); -extern double log1p(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __log1p(double __x) __attribute__((__nothrow__, __leaf__)); -extern double logb(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __logb(double __x) __attribute__((__nothrow__, __leaf__)); -extern double exp2(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __exp2(double __x) __attribute__((__nothrow__, __leaf__)); -extern double log2(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __log2(double __x) __attribute__((__nothrow__, __leaf__)); -extern double pow(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __pow(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double sqrt(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __sqrt(double __x) __attribute__((__nothrow__, __leaf__)); -extern double hypot(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __hypot(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double cbrt(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __cbrt(double __x) __attribute__((__nothrow__, __leaf__)); -extern double ceil(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __ceil(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double fabs(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __fabs(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double floor(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __floor(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double fmod(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __fmod(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern int __isinf(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __finite(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int isinf(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int finite(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double drem(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __drem(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double significand(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __significand(double __x) __attribute__((__nothrow__, __leaf__)); -extern double copysign(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __copysign(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double nan(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __nan(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __isnan(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int isnan(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double j0(double) __attribute__((__nothrow__, __leaf__)); -extern double __j0(double) __attribute__((__nothrow__, __leaf__)); -extern double j1(double) __attribute__((__nothrow__, __leaf__)); -extern double __j1(double) __attribute__((__nothrow__, __leaf__)); -extern double jn(int, double) __attribute__((__nothrow__, __leaf__)); -extern double __jn(int, double) __attribute__((__nothrow__, __leaf__)); -extern double y0(double) __attribute__((__nothrow__, __leaf__)); -extern double __y0(double) __attribute__((__nothrow__, __leaf__)); -extern double y1(double) __attribute__((__nothrow__, __leaf__)); -extern double __y1(double) __attribute__((__nothrow__, __leaf__)); -extern double yn(int, double) __attribute__((__nothrow__, __leaf__)); -extern double __yn(int, double) __attribute__((__nothrow__, __leaf__)); -extern double erf(double) __attribute__((__nothrow__, __leaf__)); -extern double __erf(double) __attribute__((__nothrow__, __leaf__)); -extern double erfc(double) __attribute__((__nothrow__, __leaf__)); -extern double __erfc(double) __attribute__((__nothrow__, __leaf__)); -extern double lgamma(double) __attribute__((__nothrow__, __leaf__)); -extern double __lgamma(double) __attribute__((__nothrow__, __leaf__)); -extern double tgamma(double) __attribute__((__nothrow__, __leaf__)); -extern double __tgamma(double) __attribute__((__nothrow__, __leaf__)); -extern double gamma(double) __attribute__((__nothrow__, __leaf__)); -extern double __gamma(double) __attribute__((__nothrow__, __leaf__)); -extern double lgamma_r(double, int *__signgamp) __attribute__((__nothrow__, __leaf__)); -extern double __lgamma_r(double, int *__signgamp) __attribute__((__nothrow__, __leaf__)); -extern double rint(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __rint(double __x) __attribute__((__nothrow__, __leaf__)); -extern double nextafter(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __nextafter(double __x, double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double nexttoward(double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __nexttoward(double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double remainder(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __remainder(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double scalbn(double __x, int __n) __attribute__((__nothrow__, __leaf__)); -extern double __scalbn(double __x, int __n) __attribute__((__nothrow__, __leaf__)); -extern int ilogb(double __x) __attribute__((__nothrow__, __leaf__)); -extern int __ilogb(double __x) __attribute__((__nothrow__, __leaf__)); -extern double scalbln(double __x, long int __n) __attribute__((__nothrow__, __leaf__)); -extern double __scalbln(double __x, long int __n) __attribute__((__nothrow__, __leaf__)); -extern double nearbyint(double __x) __attribute__((__nothrow__, __leaf__)); -extern double __nearbyint(double __x) __attribute__((__nothrow__, __leaf__)); -extern double round(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __round(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double trunc(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double __trunc(double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double remquo(double __x, double __y, int *__quo) __attribute__((__nothrow__, __leaf__)); -extern double __remquo(double __x, double __y, int *__quo) __attribute__((__nothrow__, __leaf__)); -extern long int lrint(double __x) __attribute__((__nothrow__, __leaf__)); -extern long int __lrint(double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int llrint(double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int __llrint(double __x) __attribute__((__nothrow__, __leaf__)); -extern long int lround(double __x) __attribute__((__nothrow__, __leaf__)); -extern long int __lround(double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int llround(double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int __llround(double __x) __attribute__((__nothrow__, __leaf__)); -extern double fdim(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __fdim(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double fmax(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __fmax(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double fmin(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern double __fmin(double __x, double __y) __attribute__((__nothrow__, __leaf__)); -extern int __fpclassify(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __signbit(double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern double fma(double __x, double __y, double __z) __attribute__((__nothrow__, __leaf__)); -extern double __fma(double __x, double __y, double __z) __attribute__((__nothrow__, __leaf__)); -extern double scalb(double __x, double __n) __attribute__((__nothrow__, __leaf__)); -extern double __scalb(double __x, double __n) __attribute__((__nothrow__, __leaf__)); -extern float acosf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __acosf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float asinf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __asinf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float atanf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __atanf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float atan2f(float __y, float __x) __attribute__((__nothrow__, __leaf__)); -extern float __atan2f(float __y, float __x) __attribute__((__nothrow__, __leaf__)); -extern float cosf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __cosf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float sinf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __sinf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float tanf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __tanf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float coshf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __coshf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float sinhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __sinhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float tanhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __tanhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float acoshf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __acoshf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float asinhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __asinhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float atanhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __atanhf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float expf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __expf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float frexpf(float __x, int *__exponent) __attribute__((__nothrow__, __leaf__)); -extern float __frexpf(float __x, int *__exponent) __attribute__((__nothrow__, __leaf__)); -extern float ldexpf(float __x, int __exponent) __attribute__((__nothrow__, __leaf__)); -extern float __ldexpf(float __x, int __exponent) __attribute__((__nothrow__, __leaf__)); -extern float logf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __logf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float log10f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __log10f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float modff(float __x, float *__iptr) __attribute__((__nothrow__, __leaf__)); -extern float __modff(float __x, float *__iptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern float expm1f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __expm1f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float log1pf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __log1pf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float logbf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __logbf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float exp2f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __exp2f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float log2f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __log2f(float __x) __attribute__((__nothrow__, __leaf__)); -extern float powf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __powf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float sqrtf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __sqrtf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float hypotf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __hypotf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float cbrtf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __cbrtf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float ceilf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __ceilf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float fabsf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __fabsf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float floorf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __floorf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float fmodf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __fmodf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern int __isinff(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __finitef(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int isinff(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int finitef(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float dremf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __dremf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float significandf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __significandf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float copysignf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __copysignf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float nanf(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __nanf(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __isnanf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int isnanf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float j0f(float) __attribute__((__nothrow__, __leaf__)); -extern float __j0f(float) __attribute__((__nothrow__, __leaf__)); -extern float j1f(float) __attribute__((__nothrow__, __leaf__)); -extern float __j1f(float) __attribute__((__nothrow__, __leaf__)); -extern float jnf(int, float) __attribute__((__nothrow__, __leaf__)); -extern float __jnf(int, float) __attribute__((__nothrow__, __leaf__)); -extern float y0f(float) __attribute__((__nothrow__, __leaf__)); -extern float __y0f(float) __attribute__((__nothrow__, __leaf__)); -extern float y1f(float) __attribute__((__nothrow__, __leaf__)); -extern float __y1f(float) __attribute__((__nothrow__, __leaf__)); -extern float ynf(int, float) __attribute__((__nothrow__, __leaf__)); -extern float __ynf(int, float) __attribute__((__nothrow__, __leaf__)); -extern float erff(float) __attribute__((__nothrow__, __leaf__)); -extern float __erff(float) __attribute__((__nothrow__, __leaf__)); -extern float erfcf(float) __attribute__((__nothrow__, __leaf__)); -extern float __erfcf(float) __attribute__((__nothrow__, __leaf__)); -extern float lgammaf(float) __attribute__((__nothrow__, __leaf__)); -extern float __lgammaf(float) __attribute__((__nothrow__, __leaf__)); -extern float tgammaf(float) __attribute__((__nothrow__, __leaf__)); -extern float __tgammaf(float) __attribute__((__nothrow__, __leaf__)); -extern float gammaf(float) __attribute__((__nothrow__, __leaf__)); -extern float __gammaf(float) __attribute__((__nothrow__, __leaf__)); -extern float lgammaf_r(float, int *__signgamp) __attribute__((__nothrow__, __leaf__)); -extern float __lgammaf_r(float, int *__signgamp) __attribute__((__nothrow__, __leaf__)); -extern float rintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __rintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float nextafterf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __nextafterf(float __x, float __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float nexttowardf(float __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __nexttowardf(float __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float remainderf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __remainderf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float scalbnf(float __x, int __n) __attribute__((__nothrow__, __leaf__)); -extern float __scalbnf(float __x, int __n) __attribute__((__nothrow__, __leaf__)); -extern int ilogbf(float __x) __attribute__((__nothrow__, __leaf__)); -extern int __ilogbf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float scalblnf(float __x, long int __n) __attribute__((__nothrow__, __leaf__)); -extern float __scalblnf(float __x, long int __n) __attribute__((__nothrow__, __leaf__)); -extern float nearbyintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float __nearbyintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float roundf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __roundf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float truncf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float __truncf(float __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float remquof(float __x, float __y, int *__quo) __attribute__((__nothrow__, __leaf__)); -extern float __remquof(float __x, float __y, int *__quo) __attribute__((__nothrow__, __leaf__)); -extern long int lrintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long int __lrintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long long int llrintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long long int __llrintf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long int lroundf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long int __lroundf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long long int llroundf(float __x) __attribute__((__nothrow__, __leaf__)); -extern long long int __llroundf(float __x) __attribute__((__nothrow__, __leaf__)); -extern float fdimf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __fdimf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float fmaxf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __fmaxf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float fminf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern float __fminf(float __x, float __y) __attribute__((__nothrow__, __leaf__)); -extern int __fpclassifyf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __signbitf(float __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern float fmaf(float __x, float __y, float __z) __attribute__((__nothrow__, __leaf__)); -extern float __fmaf(float __x, float __y, float __z) __attribute__((__nothrow__, __leaf__)); -extern float scalbf(float __x, float __n) __attribute__((__nothrow__, __leaf__)); -extern float __scalbf(float __x, float __n) __attribute__((__nothrow__, __leaf__)); -extern long double acosl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __acosl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double asinl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __asinl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double atanl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __atanl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double atan2l(long double __y, long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __atan2l(long double __y, long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double cosl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __cosl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double sinl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __sinl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double tanl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __tanl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double coshl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __coshl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double sinhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __sinhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double tanhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __tanhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double acoshl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __acoshl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double asinhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __asinhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double atanhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __atanhl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double expl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __expl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double frexpl(long double __x, int *__exponent) __attribute__((__nothrow__, __leaf__)); -extern long double __frexpl(long double __x, int *__exponent) __attribute__((__nothrow__, __leaf__)); -extern long double ldexpl(long double __x, int __exponent) __attribute__((__nothrow__, __leaf__)); -extern long double __ldexpl(long double __x, int __exponent) __attribute__((__nothrow__, __leaf__)); -extern long double logl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __logl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double log10l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __log10l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double modfl(long double __x, long double *__iptr) __attribute__((__nothrow__, __leaf__)); -extern long double __modfl(long double __x, long double *__iptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern long double expm1l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __expm1l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double log1pl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __log1pl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double logbl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __logbl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double exp2l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __exp2l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double log2l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __log2l(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double powl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __powl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double sqrtl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __sqrtl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double hypotl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __hypotl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double cbrtl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __cbrtl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double ceill(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __ceill(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double fabsl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __fabsl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double floorl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __floorl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double fmodl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __fmodl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern int __isinfl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __finitel(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int isinfl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int finitel(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double dreml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __dreml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double significandl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __significandl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double copysignl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __copysignl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double nanl(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __nanl(__const char *__tagb) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __isnanl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int isnanl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double j0l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __j0l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double j1l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __j1l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double jnl(int, long double) __attribute__((__nothrow__, __leaf__)); -extern long double __jnl(int, long double) __attribute__((__nothrow__, __leaf__)); -extern long double y0l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __y0l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double y1l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __y1l(long double) __attribute__((__nothrow__, __leaf__)); -extern long double ynl(int, long double) __attribute__((__nothrow__, __leaf__)); -extern long double __ynl(int, long double) __attribute__((__nothrow__, __leaf__)); -extern long double erfl(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __erfl(long double) __attribute__((__nothrow__, __leaf__)); -extern long double erfcl(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __erfcl(long double) __attribute__((__nothrow__, __leaf__)); -extern long double lgammal(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __lgammal(long double) __attribute__((__nothrow__, __leaf__)); -extern long double tgammal(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __tgammal(long double) __attribute__((__nothrow__, __leaf__)); -extern long double gammal(long double) __attribute__((__nothrow__, __leaf__)); -extern long double __gammal(long double) __attribute__((__nothrow__, __leaf__)); -extern long double lgammal_r(long double, int *__signgamp) __attribute__((__nothrow__, __leaf__)); -extern long double __lgammal_r(long double, int *__signgamp) __attribute__((__nothrow__, __leaf__)); -extern long double rintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __rintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double nextafterl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __nextafterl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double nexttowardl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __nexttowardl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double remainderl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __remainderl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double scalbnl(long double __x, int __n) __attribute__((__nothrow__, __leaf__)); -extern long double __scalbnl(long double __x, int __n) __attribute__((__nothrow__, __leaf__)); -extern int ilogbl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern int __ilogbl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double scalblnl(long double __x, long int __n) __attribute__((__nothrow__, __leaf__)); -extern long double __scalblnl(long double __x, long int __n) __attribute__((__nothrow__, __leaf__)); -extern long double nearbyintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double __nearbyintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double roundl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __roundl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double truncl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double __truncl(long double __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double remquol(long double __x, long double __y, int *__quo) __attribute__((__nothrow__, __leaf__)); -extern long double __remquol(long double __x, long double __y, int *__quo) __attribute__((__nothrow__, __leaf__)); -extern long int lrintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long int __lrintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int llrintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int __llrintl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long int lroundl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long int __lroundl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int llroundl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long long int __llroundl(long double __x) __attribute__((__nothrow__, __leaf__)); -extern long double fdiml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __fdiml(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double fmaxl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __fmaxl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double fminl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern long double __fminl(long double __x, long double __y) __attribute__((__nothrow__, __leaf__)); -extern int __fpclassifyl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int __signbitl(long double __value) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern long double fmal(long double __x, long double __y, long double __z) __attribute__((__nothrow__, __leaf__)); -extern long double __fmal(long double __x, long double __y, long double __z) __attribute__((__nothrow__, __leaf__)); -extern long double scalbl(long double __x, long double __n) __attribute__((__nothrow__, __leaf__)); -extern long double __scalbl(long double __x, long double __n) __attribute__((__nothrow__, __leaf__)); -extern int signgam; -enum -{ - FP_NAN, - FP_INFINITE, - FP_ZERO, - FP_SUBNORMAL, - FP_NORMAL -}; -typedef enum -{ - _IEEE_ = - 1, - _SVID_, - _XOPEN_, - _POSIX_, - _ISOC_ -} _LIB_VERSION_TYPE; -extern _LIB_VERSION_TYPE _LIB_VERSION; -struct exception -{ - int type; - char *name; - double arg1; - double arg2; - double retval; -}; -extern int matherr(struct exception *__exc); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) __signbitf(float __x) -{ - int __m; - __asm ("pmovmskb %1, %0": "=r" (__m): "x" (__x)); - return __m & 0x8; -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) __signbit(double __x) -{ - int __m; - __asm ("pmovmskb %1, %0": "=r" (__m): "x" (__x)); - return __m & 0x80; -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) __signbitl(long double __x) -{ - __extension__ - union - { - long double __l; - int __i[3]; - } __u = {__l:__x}; - return (__u.__i[2] & 0x8000) != 0; -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long int __attribute__((__nothrow__, __leaf__)) lrintf(float __x) -{ - long int __res; - __asm ("cvtss2si %1, %0": "=r" (__res): "xm" (__x)); - return __res; -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long int __attribute__((__nothrow__, __leaf__)) lrint(double __x) -{ - long int __res; - __asm ("cvtsd2si %1, %0": "=r" (__res): "xm" (__x)); - return __res; -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long long int __attribute__((__nothrow__, __leaf__)) llrintf(float __x) -{ - long long int __res; - __asm ("cvtss2si %1, %0": "=r" (__res): "xm" (__x)); - return __res; -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) long long int __attribute__((__nothrow__, __leaf__)) llrint(double __x) -{ - long long int __res; - __asm ("cvtsd2si %1, %0": "=r" (__res): "xm" (__x)); - return __res; -} -union wait -{ - int w_status; - struct - { - unsigned int __w_termsig : 7; - unsigned int __w_coredump : 1; - unsigned int __w_retcode : 8; - unsigned int : 16; - } __wait_terminated; - struct - { - unsigned int __w_stopval : 8; - unsigned int __w_stopsig : 8; - unsigned int : 16; - } __wait_stopped; -}; -typedef union -{ - union wait *__uptr; - int *__iptr; -} __WAIT_STATUS __attribute__((__transparent_union__)); -typedef struct -{ - int quot; - int rem; -} div_t; -typedef struct -{ - long int quot; - long int rem; -} ldiv_t; -__extension__ -typedef struct -{ - long long int quot; - long long int rem; -} lldiv_t; -extern size_t __ctype_get_mb_cur_max(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern double atof(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int atoi(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern long int atol(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -__extension__ -extern long long int atoll(__const char *__nptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern double strtod(__const char *__restrict __nptr, char **__restrict __endptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern float strtof(__const char *__restrict __nptr, char **__restrict __endptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern long double strtold(__const char *__restrict __nptr, char **__restrict __endptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern long int strtol(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern unsigned long int strtoul(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -__extension__ -extern long long int strtoq(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -__extension__ -extern unsigned long long int strtouq(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -__extension__ -extern long long int strtoll(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -__extension__ -extern unsigned long long int strtoull(__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern __inline __attribute__((__gnu_inline__)) double __attribute__((__nothrow__, __leaf__)) atof(__const char *__nptr) -{ - return strtod(__nptr, (char **) ((void *) 0)); -} -extern __inline __attribute__((__gnu_inline__)) int __attribute__((__nothrow__, __leaf__)) atoi(__const char *__nptr) -{ - return (int) strtol(__nptr, (char **) ((void *) 0), 10); -} -extern __inline __attribute__((__gnu_inline__)) long int __attribute__((__nothrow__, __leaf__)) atol(__const char *__nptr) -{ - return strtol(__nptr, (char **) ((void *) 0), 10); -} -__extension__ -extern __inline __attribute__((__gnu_inline__)) long long int __attribute__((__nothrow__, __leaf__)) atoll(__const char *__nptr) -{ - return strtoll(__nptr, (char **) ((void *) 0), 10); -} -extern char *l64a(long int __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern long int a64l(__const char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -typedef __u_char u_char; -typedef __u_short u_short; -typedef __u_int u_int; -typedef __u_long u_long; -typedef __quad_t quad_t; -typedef __u_quad_t u_quad_t; -typedef __fsid_t fsid_t; -typedef __loff_t loff_t; -typedef __ino_t ino_t; -typedef __dev_t dev_t; -typedef __mode_t mode_t; -typedef __nlink_t nlink_t; -typedef __id_t id_t; -typedef __daddr_t daddr_t; -typedef __caddr_t caddr_t; -typedef __key_t key_t; -typedef unsigned long int ulong; -typedef unsigned short int ushort; -typedef unsigned int uint; -typedef unsigned int u_int8_t __attribute__((__mode__(__QI__))); -typedef unsigned int u_int16_t __attribute__((__mode__(__HI__))); -typedef unsigned int u_int32_t __attribute__((__mode__(__SI__))); -typedef unsigned int u_int64_t __attribute__((__mode__(__DI__))); -typedef int register_t __attribute__((__mode__(__word__))); -typedef int __sig_atomic_t; -typedef struct -{ - unsigned long int __val[(1024 / (8 * sizeof(unsigned long int)))]; -} __sigset_t; -typedef __sigset_t sigset_t; -struct timeval -{ - __time_t tv_sec; - __suseconds_t tv_usec; -}; -typedef __suseconds_t suseconds_t; -typedef long int __fd_mask; -typedef struct -{ - __fd_mask __fds_bits[1024 / (8 * (int) sizeof(__fd_mask))]; -} fd_set; -typedef __fd_mask fd_mask; -extern int select(int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); -extern int pselect(int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); -extern unsigned long int __fdelt_chk(unsigned long int __d); -extern unsigned long int __fdelt_warn(unsigned long int __d) __attribute__((__warning__("bit outside of fd_set selected"))); -__extension__ -extern unsigned int gnu_dev_major(unsigned long long int __dev) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -__extension__ -extern unsigned int gnu_dev_minor(unsigned long long int __dev) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -__extension__ -extern unsigned long long int gnu_dev_makedev(unsigned int __major, unsigned int __minor) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -__extension__ -extern __inline __attribute__((__gnu_inline__)) __attribute__((__const__)) unsigned int __attribute__((__nothrow__, __leaf__)) gnu_dev_major(unsigned long long int __dev) -{ - return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); -} -__extension__ -extern __inline __attribute__((__gnu_inline__)) __attribute__((__const__)) unsigned int __attribute__((__nothrow__, __leaf__)) gnu_dev_minor(unsigned long long int __dev) -{ - return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); -} -__extension__ -extern __inline __attribute__((__gnu_inline__)) __attribute__((__const__)) unsigned long long int __attribute__((__nothrow__, __leaf__)) gnu_dev_makedev(unsigned int __major, unsigned int __minor) -{ - return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); -} -typedef __blksize_t blksize_t; -typedef __blkcnt_t blkcnt_t; -typedef __fsblkcnt_t fsblkcnt_t; -typedef __fsfilcnt_t fsfilcnt_t; -extern long int random(void) __attribute__((__nothrow__, __leaf__)); -extern void srandom(unsigned int __seed) __attribute__((__nothrow__, __leaf__)); -extern char *initstate(unsigned int __seed, char *__statebuf, size_t __statelen) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern char *setstate(char *__statebuf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -struct random_data -{ - int32_t *fptr; - int32_t *rptr; - int32_t *state; - int rand_type; - int rand_deg; - int rand_sep; - int32_t *end_ptr; -}; -extern int random_r(struct random_data *__restrict __buf, int32_t *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int srandom_r(unsigned int __seed, struct random_data *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int initstate_r(unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 4))); -extern int setstate_r(char *__restrict __statebuf, struct random_data *__restrict __buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int rand(void) __attribute__((__nothrow__, __leaf__)); -extern void srand(unsigned int __seed) __attribute__((__nothrow__, __leaf__)); -extern int rand_r(unsigned int *__seed) __attribute__((__nothrow__, __leaf__)); -extern double drand48(void) __attribute__((__nothrow__, __leaf__)); -extern double erand48(unsigned short int __xsubi[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern long int lrand48(void) __attribute__((__nothrow__, __leaf__)); -extern long int nrand48(unsigned short int __xsubi[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern long int mrand48(void) __attribute__((__nothrow__, __leaf__)); -extern long int jrand48(unsigned short int __xsubi[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern void srand48(long int __seedval) __attribute__((__nothrow__, __leaf__)); -extern unsigned short int *seed48(unsigned short int __seed16v[3]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern void lcong48(unsigned short int __param[7]) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -struct drand48_data -{ - unsigned short int __x[3]; - unsigned short int __old_x[3]; - unsigned short int __c; - unsigned short int __init; - unsigned long long int __a; -}; -extern int drand48_r(struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int erand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int lrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int nrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int mrand48_r(struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int jrand48_r(unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int srand48_r(long int __seedval, struct drand48_data *__buffer) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int seed48_r(unsigned short int __seed16v[3], struct drand48_data *__buffer) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int lcong48_r(unsigned short int __param[7], struct drand48_data *__buffer) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern void *malloc(size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)); -extern void *calloc(size_t __nmemb, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)); -extern void *realloc(void *__ptr, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern void free(void *__ptr) __attribute__((__nothrow__, __leaf__)); -extern void cfree(void *__ptr) __attribute__((__nothrow__, __leaf__)); -extern void *alloca(size_t __size) __attribute__((__nothrow__, __leaf__)); -extern void *valloc(size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__warn_unused_result__)); -extern int posix_memalign(void **__memptr, size_t __alignment, size_t __size) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern void abort(void) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); -extern int atexit(void (*__func)(void)) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int on_exit(void (*__func)(int __status, void *__arg), void *__arg) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern void exit(int __status) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); -extern void _Exit(int __status) __attribute__((__nothrow__, __leaf__)) __attribute__((__noreturn__)); -extern char *getenv(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern char *__secure_getenv(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int putenv(char *__string) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int setenv(__const char *__name, __const char *__value, int __replace) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int unsetenv(__const char *__name) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int clearenv(void) __attribute__((__nothrow__, __leaf__)); -extern char *mktemp(char *__template) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int mkstemp(char *__template) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int mkstemps(char *__template, int __suffixlen) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern char *mkdtemp(char *__template) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int system(__const char *__command) __attribute__((__warn_unused_result__)); -extern char *realpath(__const char *__restrict __name, char *__restrict __resolved) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -typedef int (*__compar_fn_t)(__const void *, __const void *); -extern void *bsearch(__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__((__nonnull__(1, 2, 5))) __attribute__((__warn_unused_result__)); -extern void qsort(void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__((__nonnull__(1, 4))); -extern int abs(int __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__)); -extern long int labs(long int __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__)); -__extension__ -extern long long int llabs(long long int __x) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__)); -extern div_t div(int __numer, int __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__)); -extern ldiv_t ldiv(long int __numer, long int __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__)); -__extension__ -extern lldiv_t lldiv(long long int __numer, long long int __denom) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)) __attribute__((__warn_unused_result__)); -extern char *ecvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__)); -extern char *fcvt(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__)); -extern char *gcvt(double __value, int __ndigit, char *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3))) __attribute__((__warn_unused_result__)); -extern char *qecvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__)); -extern char *qfcvt(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4))) __attribute__((__warn_unused_result__)); -extern char *qgcvt(long double __value, int __ndigit, char *__buf) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3))) __attribute__((__warn_unused_result__)); -extern int ecvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5))); -extern int fcvt_r(double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5))); -extern int qecvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5))); -extern int qfcvt_r(long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(3, 4, 5))); -extern int mblen(__const char *__s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int mbtowc(wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int wctomb(char *__s, wchar_t __wchar) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern size_t mbstowcs(wchar_t *__restrict __pwcs, __const char *__restrict __s, size_t __n) __attribute__((__nothrow__, __leaf__)); -extern size_t wcstombs(char *__restrict __s, __const wchar_t *__restrict __pwcs, size_t __n) __attribute__((__nothrow__, __leaf__)); -extern int rpmatch(__const char *__response) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))) __attribute__((__warn_unused_result__)); -extern int getsubopt(char **__restrict __optionp, char *__const *__restrict __tokens, char **__restrict __valuep) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2, 3))) __attribute__((__warn_unused_result__)); -extern int getloadavg(double __loadavg[], int __nelem) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern char *__realpath_chk(__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *__realpath_alias(__const char *__restrict __name, char *__restrict __resolved) __asm__ ("""realpath") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern char *__realpath_chk_warn(__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __asm__ ("""__realpath_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)) __attribute__((__warning__("second argument of realpath must be either NULL or at ""least PATH_MAX bytes long buffer"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) char *__attribute__((__nothrow__, __leaf__)) realpath(__const char *__restrict __name, char *__restrict __resolved) -{ - if (__builtin_object_size(__resolved, 2 > 1) != (size_t) - 1) - { - if (__builtin_object_size(__resolved, 2 > 1) < 4096) - return __realpath_chk_warn(__name, __resolved, __builtin_object_size(__resolved, 2 > 1)); - return __realpath_chk(__name, __resolved, __builtin_object_size(__resolved, 2 > 1)); - } - return __realpath_alias(__name, __resolved); -} -extern int __ptsname_r_chk(int __fd, char *__buf, size_t __buflen, size_t __nreal) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int __ptsname_r_alias(int __fd, char *__buf, size_t __buflen) __asm__ ("""ptsname_r") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int __ptsname_r_chk_warn(int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("""__ptsname_r_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))) __attribute__((__warning__("ptsname_r called with buflen bigger than ""size of buf"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) int __attribute__((__nothrow__, __leaf__)) ptsname_r(int __fd, char *__buf, size_t __buflen) -{ - if (__builtin_object_size(__buf, 2 > 1) != (size_t) - 1) - { - if (!__builtin_constant_p(__buflen)) - return __ptsname_r_chk(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1)); - if (__buflen > __builtin_object_size(__buf, 2 > 1)) - return __ptsname_r_chk_warn(__fd, __buf, __buflen, __builtin_object_size(__buf, 2 > 1)); - } - return __ptsname_r_alias(__fd, __buf, __buflen); -} -extern int __wctomb_chk(char *__s, wchar_t __wchar, size_t __buflen) __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern int __wctomb_alias(char *__s, wchar_t __wchar) __asm__ ("""wctomb") __attribute__((__nothrow__, __leaf__)) __attribute__((__warn_unused_result__)); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) __attribute__((__warn_unused_result__)) int __attribute__((__nothrow__, __leaf__)) wctomb(char *__s, wchar_t __wchar) -{ - if (__builtin_object_size(__s, 2 > 1) != (size_t) - 1 && 16 > __builtin_object_size(__s, 2 > 1)) - return __wctomb_chk(__s, __wchar, __builtin_object_size(__s, 2 > 1)); - return __wctomb_alias(__s, __wchar); -} -extern size_t __mbstowcs_chk(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) __attribute__((__nothrow__, __leaf__)); -extern size_t __mbstowcs_alias(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) __asm__ ("""mbstowcs") __attribute__((__nothrow__, __leaf__)); -extern size_t __mbstowcs_chk_warn(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("""__mbstowcs_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warning__("mbstowcs called with dst buffer smaller than len ""* sizeof (wchar_t)"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) size_t __attribute__((__nothrow__, __leaf__)) mbstowcs(wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) -{ - if (__builtin_object_size(__dst, 2 > 1) != (size_t) - 1) - { - if (!__builtin_constant_p(__len)) - return __mbstowcs_chk(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1) / sizeof(wchar_t)); - if (__len > __builtin_object_size(__dst, 2 > 1) / sizeof(wchar_t)) - return __mbstowcs_chk_warn(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1) / sizeof(wchar_t)); - } - return __mbstowcs_alias(__dst, __src, __len); -} -extern size_t __wcstombs_chk(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __attribute__((__nothrow__, __leaf__)); -extern size_t __wcstombs_alias(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) __asm__ ("""wcstombs") __attribute__((__nothrow__, __leaf__)); -extern size_t __wcstombs_chk_warn(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("""__wcstombs_chk") __attribute__((__nothrow__, __leaf__)) __attribute__((__warning__("wcstombs called with dst buffer smaller than len"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) size_t __attribute__((__nothrow__, __leaf__)) wcstombs(char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) -{ - if (__builtin_object_size(__dst, 2 > 1) != (size_t) - 1) - { - if (!__builtin_constant_p(__len)) - return __wcstombs_chk(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1)); - if (__len > __builtin_object_size(__dst, 2 > 1)) - return __wcstombs_chk_warn(__dst, __src, __len, __builtin_object_size(__dst, 2 > 1)); - } - return __wcstombs_alias(__dst, __src, __len); -} -extern void *memcpy(void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern void *memmove(void *__dest, __const void *__src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern void *memccpy(void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern void *memset(void *__s, int __c, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int memcmp(__const void *__s1, __const void *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern void *memchr(__const void *__s, int __c, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern char *strcpy(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *strncpy(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *strcat(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *strncat(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern int strcmp(__const char *__s1, __const char *__s2) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern int strncmp(__const char *__s1, __const char *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern int strcoll(__const char *__s1, __const char *__s2) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern size_t strxfrm(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern int strcoll_l(__const char *__s1, __const char *__s2, __locale_t __l) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2, 3))); -extern size_t strxfrm_l(char *__dest, __const char *__src, size_t __n, __locale_t __l) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 4))); -extern char *strdup(__const char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__nonnull__(1))); -extern char *strndup(__const char *__string, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)) __attribute__((__nonnull__(1))); -extern char *strchr(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern char *strrchr(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern size_t strcspn(__const char *__s, __const char *__reject) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern size_t strspn(__const char *__s, __const char *__accept) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern char *strpbrk(__const char *__s, __const char *__accept) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern char *strstr(__const char *__haystack, __const char *__needle) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern char *strtok(char *__restrict __s, __const char *__restrict __delim) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern char *__strtok_r(char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))); -extern char *strtok_r(char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2, 3))); -extern size_t strlen(__const char *__s) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern size_t strnlen(__const char *__string, size_t __maxlen) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern char *strerror(int __errnum) __attribute__((__nothrow__, __leaf__)); -extern int strerror_r(int __errnum, char *__buf, size_t __buflen) __asm__ ("""__xpg_strerror_r") __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(2))); -extern char *strerror_l(int __errnum, __locale_t __l) __attribute__((__nothrow__, __leaf__)); -extern void __bzero(void *__s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern void bcopy(__const void *__src, void *__dest, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern void bzero(void *__s, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1))); -extern int bcmp(__const void *__s1, __const void *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern char *index(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern char *rindex(__const char *__s, int __c) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1))); -extern int ffs(int __i) __attribute__((__nothrow__, __leaf__)) __attribute__((__const__)); -extern int strcasecmp(__const char *__s1, __const char *__s2) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern int strncasecmp(__const char *__s1, __const char *__s2, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__pure__)) __attribute__((__nonnull__(1, 2))); -extern char *strsep(char **__restrict __stringp, __const char *__restrict __delim) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *strsignal(int __sig) __attribute__((__nothrow__, __leaf__)); -extern char *__stpcpy(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *stpcpy(char *__restrict __dest, __const char *__restrict __src) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *__stpncpy(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern char *stpncpy(char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__nonnull__(1, 2))); -extern void *__rawmemchr(const void *__s, int __c); -extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c1(__const char *__s, int __reject); -extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c1(__const char *__s, int __reject) -{ - register size_t __result = 0; - while (__s[__result] != '\0' && __s[__result] != __reject) - ++__result; - return __result; -} -extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c2(__const char *__s, int __reject1, int __reject2); -extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c2(__const char *__s, int __reject1, int __reject2) -{ - register size_t __result = 0; - while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) - ++__result; - return __result; -} -extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c3(__const char *__s, int __reject1, int __reject2, int __reject3); -extern __inline __attribute__((__gnu_inline__)) size_t __strcspn_c3(__const char *__s, int __reject1, int __reject2, int __reject3) -{ - register size_t __result = 0; - while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) - ++__result; - return __result; -} -extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c1(__const char *__s, int __accept); -extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c1(__const char *__s, int __accept) -{ - register size_t __result = 0; - while (__s[__result] == __accept) - ++__result; - return __result; -} -extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c2(__const char *__s, int __accept1, int __accept2); -extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c2(__const char *__s, int __accept1, int __accept2) -{ - register size_t __result = 0; - while (__s[__result] == __accept1 || __s[__result] == __accept2) - ++__result; - return __result; -} -extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c3(__const char *__s, int __accept1, int __accept2, int __accept3); -extern __inline __attribute__((__gnu_inline__)) size_t __strspn_c3(__const char *__s, int __accept1, int __accept2, int __accept3) -{ - register size_t __result = 0; - while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) - ++__result; - return __result; -} -extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c2(__const char *__s, int __accept1, int __accept2); -extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c2(__const char *__s, int __accept1, int __accept2) -{ - while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) - ++__s; - return *__s == '\0' ? ((void *) 0) : (char *) (size_t) __s; -} -extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c3(__const char *__s, int __accept1, int __accept2, int __accept3); -extern __inline __attribute__((__gnu_inline__)) char *__strpbrk_c3(__const char *__s, int __accept1, int __accept2, int __accept3) -{ - while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) - ++__s; - return *__s == '\0' ? ((void *) 0) : (char *) (size_t) __s; -} -extern __inline __attribute__((__gnu_inline__)) char *__strtok_r_1c(char *__s, char __sep, char **__nextp); -extern __inline __attribute__((__gnu_inline__)) char *__strtok_r_1c(char *__s, char __sep, char **__nextp) -{ - char *__result; - if (__s == ((void *) 0)) - __s = *__nextp; - while (*__s == __sep) - ++__s; - __result = ((void *) 0); - if (*__s != '\0') - { - __result = __s++; - while (*__s != '\0') - if (*__s++ == __sep) + { + do + { { - __s[- 1] = '\0'; - break; + ((uint8_t *)dst)[0] = ((const uint8_t *)src)[1] << 8 | ((const uint8_t *)src)[0]; + ((uint8_t *)dst)[1] = (((const uint8_t *)src)[1] << 8 | ((const uint8_t *)src)[0]) >> 8; } - } - *__nextp = __s; - return __result; -} -extern char *__strsep_g(char **__stringp, __const char *__delim); -extern __inline __attribute__((__gnu_inline__)) char *__strsep_1c(char **__s, char __reject); -extern __inline __attribute__((__gnu_inline__)) char *__strsep_1c(char **__s, char __reject) -{ - register char *__retval = *__s; - if (__retval != ((void *) 0) && (*__s = (__extension__ (__builtin_constant_p(__reject) && !__builtin_constant_p(__retval) && (__reject) == '\0' ? (char *) __rawmemchr(__retval, __reject) : __builtin_strchr(__retval, __reject)))) != ((void *) 0)) - *(*__s)++ = '\0'; - return __retval; -} -extern __inline __attribute__((__gnu_inline__)) char *__strsep_2c(char **__s, char __reject1, char __reject2); -extern __inline __attribute__((__gnu_inline__)) char *__strsep_2c(char **__s, char __reject1, char __reject2) -{ - register char *__retval = *__s; - if (__retval != ((void *) 0)) - { - register char *__cp = __retval; - while (1) - { - if (*__cp == '\0') - { - __cp = ((void *) 0); - break; - } - if (*__cp == __reject1 || *__cp == __reject2) - { - *__cp++ = '\0'; - break; - } - ++__cp; - } - *__s = __cp; - } - return __retval; -} -extern __inline __attribute__((__gnu_inline__)) char *__strsep_3c(char **__s, char __reject1, char __reject2, char __reject3); -extern __inline __attribute__((__gnu_inline__)) char *__strsep_3c(char **__s, char __reject1, char __reject2, char __reject3) -{ - register char *__retval = *__s; - if (__retval != ((void *) 0)) - { - register char *__cp = __retval; - while (1) - { - if (*__cp == '\0') - { - __cp = ((void *) 0); - break; - } - if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) - { - *__cp++ = '\0'; - break; - } - ++__cp; - } - *__s = __cp; - } - return __retval; -} -extern char *__strdup(__const char *__string) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)); -extern char *__strndup(__const char *__string, size_t __n) __attribute__((__nothrow__, __leaf__)) __attribute__((__malloc__)); -extern void __warn_memset_zero_len(void) __attribute__((__warning__("memset used with constant zero length parameter; this could be due to transposed parameters"))); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void *__attribute__((__nothrow__, __leaf__)) memcpy(void *__restrict __dest, __const void *__restrict __src, size_t __len) -{ - return __builtin___memcpy_chk(__dest, __src, __len, __builtin_object_size(__dest, 0)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void *__attribute__((__nothrow__, __leaf__)) memmove(void *__dest, __const void *__src, size_t __len) -{ - return __builtin___memmove_chk(__dest, __src, __len, __builtin_object_size(__dest, 0)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void *__attribute__((__nothrow__, __leaf__)) memset(void *__dest, int __ch, size_t __len) -{ - if (__builtin_constant_p(__len) && __len == 0 && (!__builtin_constant_p(__ch) || __ch != 0)) - { - __warn_memset_zero_len(); - return __dest; - } - return __builtin___memset_chk(__dest, __ch, __len, __builtin_object_size(__dest, 0)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void __attribute__((__nothrow__, __leaf__)) bcopy(__const void *__src, void *__dest, size_t __len) -{ - (void) __builtin___memmove_chk(__dest, __src, __len, __builtin_object_size(__dest, 0)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) void __attribute__((__nothrow__, __leaf__)) bzero(void *__dest, size_t __len) -{ - (void) __builtin___memset_chk(__dest, '\0', __len, __builtin_object_size(__dest, 0)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strcpy(char *__restrict __dest, __const char *__restrict __src) -{ - return __builtin___strcpy_chk(__dest, __src, __builtin_object_size(__dest, 2 > 1)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strncpy(char *__restrict __dest, __const char *__restrict __src, size_t __len) -{ - return __builtin___strncpy_chk(__dest, __src, __len, __builtin_object_size(__dest, 2 > 1)); -} -extern char *__stpncpy_chk(char *__dest, __const char *__src, size_t __n, size_t __destlen) __attribute__((__nothrow__, __leaf__)); -extern char *__stpncpy_alias(char *__dest, __const char *__src, size_t __n) __asm__ ("""stpncpy") __attribute__((__nothrow__, __leaf__)); -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) stpncpy(char *__dest, __const char *__src, size_t __n) -{ - if (__builtin_object_size(__dest, 2 > 1) != (size_t) - 1 && (!__builtin_constant_p(__n) || __n <= __builtin_object_size(__dest, 2 > 1))) - return __stpncpy_chk(__dest, __src, __n, __builtin_object_size(__dest, 2 > 1)); - return __stpncpy_alias(__dest, __src, __n); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strcat(char *__restrict __dest, __const char *__restrict __src) -{ - return __builtin___strcat_chk(__dest, __src, __builtin_object_size(__dest, 2 > 1)); -} -extern __inline __attribute__((__always_inline__)) __attribute__((__gnu_inline__, __artificial__)) char *__attribute__((__nothrow__, __leaf__)) strncat(char *__restrict __dest, __const char *__restrict __src, size_t __len) -{ - return __builtin___strncat_chk(__dest, __src, __len, __builtin_object_size(__dest, 2 > 1)); -} -extern const uint8_t ff_log2_tab[256]; -static inline __attribute__((const)) int av_log2_c(unsigned int v) -{ - int n = 0; - if (v & 0xffff0000) - { - v >>= 16; - n += 16; - } - if (v & 0xff00) - { - v >>= 8; - n += 8; - } - n += ff_log2_tab[v]; - return n; -} -static inline __attribute__((const)) int av_log2_16bit_c(unsigned int v) -{ - int n = 0; - if (v & 0xff00) - { - v >>= 8; - n += 8; - } - n += ff_log2_tab[v]; - return n; -} -static inline __attribute__((const)) int av_clip(int a, int amin, int amax) -{ - if (a < amin) - return amin; - else - if (a > amax) - return amax; - else - return a; -} -static inline __attribute__((const)) uint8_t av_clip_uint8(int a) -{ - if (a & (~0xFF)) - return (- a) >> 31; - else - return a; -} -static inline __attribute__((const)) uint16_t av_clip_uint16(int a) -{ - if (a & (~0xFFFF)) - return (- a) >> 31; - else - return a; -} -static inline __attribute__((const)) int16_t av_clip_int16(int a) -{ - if ((a + 0x8000) & ~0xFFFF) - return (a >> 31) ^ 0x7FFF; - else - return a; -} -static inline __attribute__((const)) int32_t av_clipl_int32(int64_t a) -{ - if ((a + 0x80000000u) & ~0xFFFFFFFFUL) - return (a >> 63) ^ 0x7FFFFFFF; - else - return a; -} -static inline __attribute__((const)) float av_clipf(float a, float amin, float amax) -{ - if (a < amin) - return amin; - else - if (a > amax) - return amax; - else - return a; -} -static inline __attribute__((const)) int av_ceil_log2(int x) -{ - return av_log2_c((x - 1) << 1); -} -typedef union -{ - uint64_t u64; - uint32_t u32[2]; - uint16_t u16[4]; - uint8_t u8[8]; - double f64; - float f32[2]; -} __attribute__((__may_alias__)) av_alias64; -typedef union -{ - uint32_t u32; - uint16_t u16[2]; - uint8_t u8[4]; - float f32; -} __attribute__((__may_alias__)) av_alias32; -typedef union -{ - uint16_t u16; - uint8_t u8[2]; -} __attribute__((__may_alias__)) av_alias16; -static __attribute__((always_inline)) inline void AV_COPY64(void *d, const void *s) -{ - __asm__ ("movq %1, %%mm0 \n\t""movq %%mm0, %0 \n\t": "=m" (*(uint64_t *) d): "m" (*(const uint64_t *) s): "mm0"); -} -static __attribute__((always_inline)) inline void AV_SWAP64(void *a, void *b) -{ - __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"); -} -static __attribute__((always_inline)) inline void AV_ZERO64(void *d) -{ - __asm__ ("pxor %%mm0, %%mm0 \n\t""movq %%mm0, %0 \n\t": "=m" (*(uint64_t *) d): : "mm0"); -} -static __attribute__((always_inline)) inline void AV_COPY128(void *d, const void *s) -{ - struct v - { - uint64_t v[2]; - }; - __asm__ ("movaps %1, %%xmm0 \n\t""movaps %%xmm0, %0 \n\t": "=m" (*(struct v *) d): "m" (*(const struct v *) s): "xmm0"); -} -static __attribute__((always_inline)) inline void AV_ZERO128(void *d) -{ - struct v - { - uint64_t v[2]; - }; - __asm__ ("pxor %%xmm0, %%xmm0 \n\t""movdqa %%xmm0, %0 \n\t": "=m" (*(struct v *) d): : "xmm0"); -} -void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride); -void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride); -void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride); -void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride); -void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block); -void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block); -void ff_h264_idct_add16_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); -void ff_h264_idct_add16intra_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); -void ff_h264_idct8_add4_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); -void ff_h264_idct_add8_c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); -void h264_luma_dc_dequant_idct_c(DCTELEM *block, int qmul); -void chroma_dc_dequant_idct_c(DCTELEM *block, int qmul); -void ff_vector_fmul_window_c(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len); -void ff_float_to_int16_c(int16_t *dst, const float *src, long len); -void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels); -extern const uint8_t ff_alternate_horizontal_scan[64]; -extern const uint8_t ff_alternate_vertical_scan[64]; -extern const uint8_t ff_zigzag_direct[64]; -extern const uint8_t ff_zigzag248_direct[64]; -extern uint32_t ff_squareTbl[512]; -extern uint8_t ff_cropTbl[256 + 2 * 1024]; -void ff_vp3_idct_c(DCTELEM *block); -void ff_vp3_idct_put_c(uint8_t *dest, int line_size, DCTELEM *block); -void ff_vp3_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block); -void ff_vp3_idct_dc_add_c(uint8_t *dest, int line_size, const DCTELEM *block); -void ff_vp3_v_loop_filter_c(uint8_t *src, int stride, int *bounding_values); -void ff_vp3_h_loop_filter_c(uint8_t *src, int stride, int *bounding_values); -void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, const int16_t *h_weights, const int16_t *v_weights); -void ff_bink_idct_c(DCTELEM *block); -void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block); -void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); -void ff_put_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd); -void ff_avg_vc1_mspel_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int rnd); -void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); -void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); -void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); -void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); -void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); -void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); -typedef void (*op_pixels_func)(uint8_t *block, const uint8_t *pixels, int line_size, int h); -typedef void (*tpel_mc_func)(uint8_t *block, const uint8_t *pixels, int line_size, int w, int h); -typedef void (*qpel_mc_func)(uint8_t *dst, uint8_t *src, int stride); -typedef void (*h264_chroma_mc_func)(uint8_t *dst, uint8_t *src, int srcStride, int h, int x, int y); -typedef void (*op_fill_func)(uint8_t *block, uint8_t value, int line_size, int h); -void ff_put_qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel16_mc11_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel16_mc31_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel16_mc12_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel16_mc32_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel16_mc13_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel16_mc33_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel8_mc11_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel8_mc31_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel8_mc12_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel8_mc32_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel8_mc13_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_put_no_rnd_qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride); -void ff_avg_qpel8_mc33_old_c(uint8_t *dst, uint8_t *src, int stride); -typedef int (*me_cmp_func)(void *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); -typedef struct ScanTable -{ - const uint8_t *scantable; - uint8_t permutated[64]; - uint8_t raster_end[64]; -} ScanTable; -void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); -void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, int src_x, int src_y, int w, int h); -typedef struct DSPContext -{ - void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size); - void (*diff_pixels)(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride); - void (*put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); - void (*put_signed_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); - void (*put_pixels_nonclamped)(const DCTELEM *block, uint8_t *pixels, int line_size); - void (*add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); - void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size); - void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size); - void (*clear_block)(DCTELEM *block); - void (*clear_blocks)(DCTELEM *blocks); - op_pixels_func put_pixels_tab[4][4]; - op_pixels_func avg_pixels_tab[4][4]; - op_pixels_func put_no_rnd_pixels_tab[4][4]; - op_pixels_func avg_no_rnd_pixels_tab[4][4]; - void (*put_no_rnd_pixels_l2[2])(uint8_t *block, const uint8_t *a, const uint8_t *b, int line_size, int h); - qpel_mc_func put_qpel_pixels_tab[2][16]; - qpel_mc_func avg_qpel_pixels_tab[2][16]; - qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16]; - qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16]; - qpel_mc_func put_mspel_pixels_tab[8]; - h264_chroma_mc_func put_h264_chroma_pixels_tab[3]; - h264_chroma_mc_func avg_h264_chroma_pixels_tab[3]; - h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3]; - h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3]; - qpel_mc_func put_h264_qpel_pixels_tab[4][16]; - qpel_mc_func avg_h264_qpel_pixels_tab[4][16]; - qpel_mc_func put_2tap_qpel_pixels_tab[4][16]; - qpel_mc_func avg_2tap_qpel_pixels_tab[4][16]; - void (*fdct)(DCTELEM *block); - void (*fdct248)(DCTELEM *block); - void (*idct)(DCTELEM *block); - void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); - void (*idct_add)(uint8_t *dest, int line_size, DCTELEM *block); - void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w); - void (*prefetch)(void *mem, int stride, int h); -} DSPContext; -void dsputil_static_init(void); -void dsputil_init(DSPContext *p); -int ff_check_alignment(void); -void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last); -void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type); -static inline uint32_t rnd_avg32(uint32_t a, uint32_t b) -{ - return (a | b) - (((a ^ b) & ~((0x01) * 0x01010101UL)) >> 1); -} -static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b) -{ - return (a & b) + (((a ^ b) & ~((0x01) * 0x01010101UL)) >> 1); -} -int mm_support(void); -extern int mm_flags; -void dsputil_init_arm(DSPContext *c); -void dsputil_init_mmx(DSPContext *c); -void dsputil_init_ppc(DSPContext *c); -void ff_dsputil_init_dwt(DSPContext *c); -static inline void emms(void) -{ - __asm__ volatile("emms;": : : "memory"); -} -static inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) -{ - int i; - for (i = 0; - i < h; - i++) - { - do - { - ((uint8_t *) (dst))[0] = (((((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])); - ((uint8_t *) (dst))[1] = (((((const uint8_t *) (src))[1] << 8) | ((const uint8_t *) (src))[0])) >> 8; - } + } while (0); dst += dstStride; src += srcStride; + } } } -static inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) +static __inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { - int i; - for (i = 0; - i < h; - i++) + int i; + for (i = 0; i < h; i++) { + { do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); dst += dstStride; src += srcStride; + } } } -static inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) +static __inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { - int i; - for (i = 0; - i < h; - i++) + int i; + for (i = 0; i < h; i++) { + { do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); dst += dstStride; src += srcStride; + } } } -static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) +static __inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { - int i; - for (i = 0; - i < h; - i++) + int i; + for (i = 0; i < h; i++) { + { do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); dst[8] = src[8]; dst += dstStride; src += srcStride; + } } } -static inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) +static __inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { - int i; - for (i = 0; - i < h; - i++) + int i; + for (i = 0; i < h; i++) { + { do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); dst += dstStride; src += srcStride; + } } } -static inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) +static __inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { - int i; - for (i = 0; - i < h; - i++) + int i; + for (i = 0; i < h; i++) { + { do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); do - { - ((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])); - ((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; - ((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; - ((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; - } + { + { + ((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]; + ((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; + ((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; + ((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; + } + } while (0); dst[16] = src[16]; dst += dstStride; src += srcStride; + } } } -typedef void (*h264_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int offset); -typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset); -typedef struct H264DSPContext +static __inline uint64_t read_time(void) { - h264_weight_func weight_h264_pixels_tab[10]; - h264_biweight_func biweight_h264_pixels_tab[10]; - void (*h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); - void (*h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); - void (*h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta); - void (*h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta); - void (*h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); - void (*h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0); - void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta); - void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta); - void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field); - void (*h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride); - void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride); - void (*h264_idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride); - void (*h264_idct8_dc_add)(uint8_t *dst, DCTELEM *block, int stride); - void (*h264_dct)(DCTELEM block[4][4]); - void (*h264_idct_add16)(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); - void (*h264_idct8_add4)(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); - void (*h264_idct_add8)(uint8_t **dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); - void (*h264_idct_add16intra)(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); - qpel_mc_func (*qpel_put)[16]; - qpel_mc_func (*qpel_avg)[16]; -} H264DSPContext; -void ff_h264dsp_init(H264DSPContext *c); -void ff_h264dsp_init_arm(H264DSPContext *c); -void ff_h264dsp_init_ppc(H264DSPContext *c); -void ff_h264dsp_init_x86(H264DSPContext *c); -typedef struct H264PredContext + uint32_t a; + uint32_t d; + __asm__ volatile("rdtsc" : "=a"(a), "=d"(d) : ); + return ((uint64_t)d << 32) + a; +} +typedef signed char int8_t; +static __inline int32_t NEG_SSR32(int32_t a, int8_t s) { - void (*pred4x4[9 + 3 + 3])(uint8_t *src, uint8_t *topright, int stride); - void (*pred8x8l[9 + 3])(uint8_t *src, int topleft, int topright, int stride); - void (*pred8x8[4 + 3 + 4])(uint8_t *src, int stride); - void (*pred16x16[4 + 3])(uint8_t *src, int stride); - void (*pred4x4_add[2])(uint8_t *pix, const DCTELEM *block, int stride); - void (*pred8x8l_add[2])(uint8_t *pix, const DCTELEM *block, int stride); - void (*pred8x8_add[3])(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride); - void (*pred16x16_add[3])(uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride); -} H264PredContext; -void ff_h264_pred_init(H264PredContext *h); -void ff_h264_pred_init_arm(H264PredContext *h); -typedef struct + __asm__ ("sarl %1, %0\n\t" : "+r"(a) : "ic"((uint8_t) -s)); + return a; +} +static __inline uint32_t NEG_USR32(uint32_t a, int8_t s) { - const char *class_name; - const char *(*item_name)(void *ctx); - const struct AVOption *option; - int version; -} AVClass; -void av_log(int level, const char *fmt, ...); -void av_vlog(int level, const char *fmt, va_list); -int av_log_get_level(void); -void av_log_set_level(int); -void av_log_set_callback(void (*)(int, const char *, va_list)); -void av_log_default_callback(int level, const char *fmt, va_list vl); -static inline uint64_t read_time(void) + __asm__ ("shrl %1, %0\n\t" : "+r"(a) : "ic"((uint8_t) -s)); + return a; +} +static __inline __attribute__((always_inline)) int MULH(int a, int b) { - uint32_t a, d; - __asm__ volatile("rdtsc": "=a" (a), "=d" (d): ); - return ((uint64_t) d << 32) + a; + return (int64_t)a * (int64_t)b >> 32; } -static inline int32_t NEG_SSR32(int32_t a, int8_t s) +static __inline __attribute__((always_inline)) unsigned int UMULH(unsigned int a, unsigned int b) { - __asm__ ("sarl %1, %0\n\t": "+r" (a): "ic" ((uint8_t) (- s))); - return a; + return (uint64_t)a * (uint64_t)b >> 32; } -static inline uint32_t NEG_USR32(uint32_t a, int8_t s) +static __inline __attribute__((const)) int mid_pred(int a, int b, int c) { - __asm__ ("shrl %1, %0\n\t": "+r" (a): "ic" ((uint8_t) (- s))); - return a; + if (a > b) + { + { + if (c > b) + { + { + if (c > a) + { + b = a; + } + else + { + b = c; + } + } + } + } + } + else + { + { + if (b > c) + { + { + if (c > a) + { + b = c; + } + else + { + b = a; + } + } + } + } + } + return b; } -static __attribute__((always_inline)) inline int MULH(int a, int b) +static __inline __attribute__((const)) int sign_extend(int val, unsigned int bits) { - return ((int64_t) (a) * (int64_t) (b)) >> 32; + return val << (8 * sizeof(int) - bits) >> (8 * sizeof(int) - bits); } -static __attribute__((always_inline)) inline unsigned UMULH(unsigned a, unsigned b) +static __inline __attribute__((const)) unsigned int zero_extend(unsigned int val, unsigned int bits) { - return ((uint64_t) (a) * (uint64_t) (b)) >> 32; + return val << (8 * sizeof(int) - bits) >> (8 * sizeof(int) - bits); } -static inline __attribute__((const)) int mid_pred(int a, int b, int c) +struct GetBitContext; +typedef struct GetBitContext GetBitContext; +struct GetBitContext { - if (a > b) + uint8_t *rbsp; + unsigned int rbsp_size; + uint8_t *raw; + const uint8_t *buffer; + const uint8_t *buffer_end; + unsigned int alloc_size; + unsigned int buf_size; + uint32_t *buffer_ptr; + uint32_t cache0; + uint32_t cache1; + int bit_count; + int size_in_bits; +}; +static __inline int get_bits_count(const GetBitContext *s) +{ + return ((uint8_t *)(*s).buffer_ptr - (*s).buffer) * 8 - 32 + (*s).bit_count; +} +static __inline void skip_bits_long(GetBitContext *s, int n) +{ + int re_bit_count = (*s).bit_count; + uint32_t re_cache0 = (*s).cache0; + uint32_t re_cache1 = (*s).cache1; + uint32_t *re_buffer_ptr = (*s).buffer_ptr; + re_bit_count += n; + re_buffer_ptr += re_bit_count >> 5; + re_bit_count &= 31; + re_cache0 = bswap_32(re_buffer_ptr[ -1]) << re_bit_count; + re_cache1 = 0; + if (re_bit_count > 0) { - if (c > b) - { - if (c > a) - b = a; - else - b = c; - } - } - else - { - if (b > c) - { - if (c > a) - b = c; - else - b = a; - } - } - return b; -} -static inline __attribute__((const)) int sign_extend(int val, unsigned bits) -{ - return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); -} -static inline __attribute__((const)) unsigned zero_extend(unsigned val, unsigned bits) -{ - return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); -} -typedef struct GetBitContext -{ - uint8_t *rbsp; - unsigned int rbsp_size; - uint8_t *raw; - const uint8_t *buffer, *buffer_end; - unsigned int alloc_size; - unsigned int buf_size; - uint32_t *buffer_ptr; - uint32_t cache0; - uint32_t cache1; - int bit_count; - int size_in_bits; -} GetBitContext; -static inline int get_bits_count(const GetBitContext *s) -{ - return ((uint8_t *) s->buffer_ptr - s->buffer) * 8 - 32 + s->bit_count; -} -static inline void skip_bits_long(GetBitContext *s, int n) -{ - int re_bit_count = (s)->bit_count; - uint32_t re_cache0 = (s)->cache0; - uint32_t re_cache1 = (s)->cache1; - uint32_t *re_buffer_ptr = (s)->buffer_ptr; - re_bit_count += n; - re_buffer_ptr += re_bit_count >> 5; - re_bit_count &= 31; - re_cache0 = bswap_32(re_buffer_ptr[- 1]) << re_bit_count; - re_cache1 = 0; - if (re_bit_count > 0) - { + { const uint32_t next = bswap_32(*re_buffer_ptr); re_cache0 |= NEG_USR32(next, re_bit_count); re_cache1 |= next << re_bit_count; re_buffer_ptr++; re_bit_count -= 32; + } } - (s)->bit_count = re_bit_count; - (s)->cache0 = re_cache0; - (s)->cache1 = re_cache1; - (s)->buffer_ptr = re_buffer_ptr; + (*s).bit_count = re_bit_count; + (*s).cache0 = re_cache0; + (*s).cache1 = re_cache1; + (*s).buffer_ptr = re_buffer_ptr; } -static inline int get_xbits(GetBitContext *s, int n) +static __inline int get_xbits(GetBitContext *s, int n) { - register int sign; - register int32_t cache; - int re_bit_count = (s)->bit_count; - uint32_t re_cache0 = (s)->cache0; - uint32_t re_cache1 = (s)->cache1; - uint32_t *re_buffer_ptr = (s)->buffer_ptr; - if (re_bit_count > 0) + register int32_t cache; + register int sign; + int re_bit_count = (*s).bit_count; + uint32_t re_cache0 = (*s).cache0; + uint32_t re_cache1 = (*s).cache1; + uint32_t *re_buffer_ptr = (*s).buffer_ptr; + if (re_bit_count > 0) { + { const uint32_t next = bswap_32(*re_buffer_ptr); re_cache0 |= NEG_USR32(next, re_bit_count); re_cache1 |= next << re_bit_count; re_buffer_ptr++; re_bit_count -= 32; + } } - cache = (re_cache0); - sign = (~cache) >> 31; + cache = re_cache0; + sign = ~cache >> 31; + { + __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n)); + re_bit_count += n; + } + (*s).bit_count = re_bit_count; + (*s).cache0 = re_cache0; + (*s).cache1 = re_cache1; + (*s).buffer_ptr = re_buffer_ptr; + return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; +} +static __inline int get_sbits(GetBitContext *s, int n) +{ + register int tmp; + int re_bit_count = (*s).bit_count; + uint32_t re_cache0 = (*s).cache0; + uint32_t re_cache1 = (*s).cache1; + uint32_t *re_buffer_ptr = (*s).buffer_ptr; + if (re_bit_count > 0) { - __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); - re_bit_count += (n); - } - (s)->bit_count = re_bit_count; - (s)->cache0 = re_cache0; - (s)->cache1 = re_cache1; - (s)->buffer_ptr = re_buffer_ptr; - return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; -} -static inline int get_sbits(GetBitContext *s, int n) -{ - register int tmp; - int re_bit_count = (s)->bit_count; - uint32_t re_cache0 = (s)->cache0; - uint32_t re_cache1 = (s)->cache1; - uint32_t *re_buffer_ptr = (s)->buffer_ptr; - if (re_bit_count > 0) - { + { const uint32_t next = bswap_32(*re_buffer_ptr); re_cache0 |= NEG_USR32(next, re_bit_count); re_cache1 |= next << re_bit_count; re_buffer_ptr++; re_bit_count -= 32; + } } - tmp = NEG_SSR32(re_cache0, n); + tmp = NEG_SSR32(re_cache0, n); + { + __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n)); + re_bit_count += n; + } + (*s).bit_count = re_bit_count; + (*s).cache0 = re_cache0; + (*s).cache1 = re_cache1; + (*s).buffer_ptr = re_buffer_ptr; + return tmp; +} +static __inline unsigned int get_bits(GetBitContext *s, int n) +{ + register int tmp; + int re_bit_count = (*s).bit_count; + uint32_t re_cache0 = (*s).cache0; + uint32_t re_cache1 = (*s).cache1; + uint32_t *re_buffer_ptr = (*s).buffer_ptr; + if (re_bit_count > 0) { - __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); - re_bit_count += (n); - } - (s)->bit_count = re_bit_count; - (s)->cache0 = re_cache0; - (s)->cache1 = re_cache1; - (s)->buffer_ptr = re_buffer_ptr; - return tmp; -} -static inline unsigned int get_bits(GetBitContext *s, int n) -{ - register int tmp; - int re_bit_count = (s)->bit_count; - uint32_t re_cache0 = (s)->cache0; - uint32_t re_cache1 = (s)->cache1; - uint32_t *re_buffer_ptr = (s)->buffer_ptr; - if (re_bit_count > 0) - { + { const uint32_t next = bswap_32(*re_buffer_ptr); re_cache0 |= NEG_USR32(next, re_bit_count); re_cache1 |= next << re_bit_count; re_buffer_ptr++; re_bit_count -= 32; + } } - tmp = NEG_USR32(re_cache0, n); + tmp = NEG_USR32(re_cache0, n); + { + __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n)); + re_bit_count += n; + } + (*s).bit_count = re_bit_count; + (*s).cache0 = re_cache0; + (*s).cache1 = re_cache1; + (*s).buffer_ptr = re_buffer_ptr; + return tmp; +} +static __inline unsigned int show_bits(GetBitContext *s, int n) +{ + register int tmp; + int re_bit_count = (*s).bit_count; + uint32_t re_cache0 = (*s).cache0; + uint32_t re_cache1 = (*s).cache1; + uint32_t *re_buffer_ptr = (*s).buffer_ptr; + if (re_bit_count > 0) { - __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); - re_bit_count += (n); - } - (s)->bit_count = re_bit_count; - (s)->cache0 = re_cache0; - (s)->cache1 = re_cache1; - (s)->buffer_ptr = re_buffer_ptr; - return tmp; -} -static inline unsigned int show_bits(GetBitContext *s, int n) -{ - register int tmp; - int re_bit_count = (s)->bit_count; - uint32_t re_cache0 = (s)->cache0; - uint32_t re_cache1 = (s)->cache1; - uint32_t *re_buffer_ptr = (s)->buffer_ptr; - if (re_bit_count > 0) - { + { const uint32_t next = bswap_32(*re_buffer_ptr); re_cache0 |= NEG_USR32(next, re_bit_count); re_cache1 |= next << re_bit_count; re_buffer_ptr++; re_bit_count -= 32; + } } - tmp = NEG_USR32(re_cache0, n); - return tmp; + tmp = NEG_USR32(re_cache0, n); + return tmp; } -static inline void skip_bits(GetBitContext *s, int n) +static __inline void skip_bits(GetBitContext *s, int n) { - int re_bit_count = (s)->bit_count; - uint32_t re_cache0 = (s)->cache0; - uint32_t re_cache1 = (s)->cache1; - uint32_t *re_buffer_ptr = (s)->buffer_ptr; - if (re_bit_count > 0) + int re_bit_count = (*s).bit_count; + uint32_t re_cache0 = (*s).cache0; + uint32_t re_cache1 = (*s).cache1; + uint32_t *re_buffer_ptr = (*s).buffer_ptr; + if (re_bit_count > 0) { + { const uint32_t next = bswap_32(*re_buffer_ptr); re_cache0 |= NEG_USR32(next, re_bit_count); re_cache1 |= next << re_bit_count; re_buffer_ptr++; re_bit_count -= 32; + } } + { + __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t" : "+r"(re_cache0), "+r"(re_cache1) : "Ic"((uint8_t)n)); + re_bit_count += n; + } + (*s).bit_count = re_bit_count; + (*s).cache0 = re_cache0; + (*s).cache1 = re_cache1; + (*s).buffer_ptr = re_buffer_ptr; +} +static __inline unsigned int get_bits1(GetBitContext *s) +{ + return get_bits(s, 1); +} +static __inline unsigned int show_bits1(GetBitContext *s) +{ + return show_bits(s, 1); +} +static __inline void skip_bits1(GetBitContext *s) +{ + skip_bits(s, 1); +} +static __inline unsigned int get_bits_long(GetBitContext *s, int n) +{ + if (n <= 32) { - __asm__ ("shldl %2, %1, %0 \n\t""shll %2, %1 \n\t": "+r" (re_cache0), "+r" (re_cache1): "Ic" ((uint8_t) (n))); - re_bit_count += (n); + return get_bits(s, n); } - (s)->bit_count = re_bit_count; - (s)->cache0 = re_cache0; - (s)->cache1 = re_cache1; - (s)->buffer_ptr = re_buffer_ptr; -} -static inline unsigned int get_bits1(GetBitContext *s) -{ - return get_bits(s, 1); -} -static inline unsigned int show_bits1(GetBitContext *s) -{ - return show_bits(s, 1); -} -static inline void skip_bits1(GetBitContext *s) -{ - skip_bits(s, 1); -} -static inline unsigned int get_bits_long(GetBitContext *s, int n) -{ - if (n <= 32) - return get_bits(s, n); - else + else { + { int ret = get_bits(s, 16) << (n - 16); return ret | get_bits(s, n - 16); + } } } -static inline int get_sbits_long(GetBitContext *s, int n) +static __inline int get_sbits_long(GetBitContext *s, int n) { - return sign_extend(get_bits_long(s, n), n); + return sign_extend(get_bits_long(s, n), n); } -static inline unsigned int show_bits_long(GetBitContext *s, int n) +static __inline unsigned int show_bits_long(GetBitContext *s, int n) { - if (n <= 32) - return show_bits(s, n); - else + if (n <= 32) { + return show_bits(s, n); + } + else + { + { GetBitContext gb = *s; return get_bits_long(&gb, n); + } } } -static inline int check_marker(GetBitContext *s, const char *msg) +void av_log(int level, const char *fmt, ...); +static __inline int check_marker(GetBitContext *s, const char *msg) { - int bit = get_bits1(s); - if (!bit) - av_log(32, "Marker bit missing %s\n", msg); - return bit; + int bit = get_bits1(s); + if (!bit) + { + av_log(32, "Marker bit missing %s\n", msg); + } + return bit; } -static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size) +typedef long int __intptr_t; +typedef __intptr_t intptr_t; +static __inline void init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size) { - int buffer_size = (bit_size + 7) >> 3; - if (buffer_size < 0 || bit_size < 0) + int buffer_size = (bit_size + 7) >> 3; + if (buffer_size < 0 || bit_size < 0) { + { buffer_size = bit_size = 0; - buffer = ((void *) 0); + buffer = (void *)0; + } } - s->buffer = buffer; - s->size_in_bits = bit_size; - s->buffer_end = buffer + buffer_size; - s->buffer_ptr = (uint32_t *) ((intptr_t) buffer & (~3)); - s->bit_count = 32 + 8 * ((intptr_t) buffer & 3); - skip_bits_long(s, 0); + (*s).buffer = buffer; + (*s).size_in_bits = bit_size; + (*s).buffer_end = buffer + buffer_size; + (*s).buffer_ptr = (uint32_t *)((intptr_t)buffer & ~3); + (*s).bit_count = 32 + 8 * ((intptr_t)buffer & 3); + skip_bits_long(s, 0); } -static inline void align_get_bits(GetBitContext *s) +static __inline void align_get_bits(GetBitContext *s) { - int n = (- get_bits_count(s)) & 7; - if (n) - skip_bits(s, n); + int n = -get_bits_count(s) & 7; + if (n) + { + skip_bits(s, n); + } } -static inline int get_bits_left(GetBitContext *gb) +static __inline int get_bits_left(GetBitContext *gb) { - return gb->size_in_bits - get_bits_count(gb); + return (*gb).size_in_bits - get_bits_count(gb); } -enum +struct H264Slice; +typedef struct H264Slice H264Slice; +struct PPS { - PARSE = 0, - ENTROPY, - REORDER, - REORDER2, - MBDEC, - OUTPUT, - STAGES + unsigned int sps_id; + int cabac; + int pic_order_present; + int slice_group_count; + int mb_slice_group_map_type; + unsigned int ref_count[2]; + int weighted_pred; + int weighted_bipred_idc; + int init_qp; + int init_qs; + int chroma_qp_index_offset[2]; + int deblocking_filter_parameters_present; + int constrained_intra_pred; + int redundant_pic_cnt_present; + int transform_8x8_mode; + uint8_t scaling_matrix4[6][16]; + uint8_t scaling_matrix8[2][64]; + uint8_t chroma_qp_table[2][64]; + int chroma_qp_diff; }; -enum +typedef struct PPS PPS; +struct PictureInfo; +typedef struct PictureInfo PictureInfo; +struct DecodedPicture; +typedef struct DecodedPicture DecodedPicture; +struct H264Slice { - TOTAL = 0, - FRONT, - ED, - REC, - PROFILE_STAGES + PPS pps; + PictureInfo *current_picture_info; + DecodedPicture *curr_pic; + int slice_num; + int release_ref_cpn[66]; + int release_cnt; + int qp_thresh; + int use_weight; + int use_weight_chroma; + int luma_log2_weight_denom; + int chroma_log2_weight_denom; + int16_t luma_weight[16][2][2]; + int16_t chroma_weight[16][2][2][2]; + int16_t implicit_weight[16][16][2]; + int ref_list_cpn[2][16]; + PictureInfo *ref_list[2][16]; + DecodedPicture *dp_ref_list[2][16]; + int ref_count[2]; + int slice_type; + int slice_type_nos; + int slice_alpha_c0_offset; + int slice_beta_offset; + int direct_8x8_inference_flag; + uint8_t list_count; + uint32_t coded_pic_num; + int poc; + int key_frame; + int mmco_reset; + int ip_id; + int transform_bypass; + int direct_spatial_mv_pred; + int map_col_to_list0[2][16]; + int dist_scale_factor[16]; + int cabac_init_idc; + int nal_ref_idc; + int nal_unit_type; + int ref2frm[2][64]; + int qscale; }; -typedef struct ParserContext +static __inline int get_chroma_qp(H264Slice *s, int t, int qscale) { - int ifile; - int ofile; - int buffer_size; - int eof_reached; - uint8_t *data; - int size; - uint8_t *cur_ptr; - int cur_len; - int64_t frame_offset; - int64_t cur_offset; - int64_t next_frame_offset; - int pict_type; - int repeat_pict; - int key_frame; - int64_t pos; - int64_t last_pos; - int final_frame; - uint8_t overread[5]; - int overread_cnt; - int index; - int last_index; - int frame_start_found; - uint32_t state; -} ParserContext; -typedef struct NalContext + return (*s).pps.chroma_qp_table[t][qscale]; +} +struct H264Context; +typedef struct H264Context H264Context; +struct ParserContext; +typedef struct ParserContext ParserContext; +struct NalContext; +typedef struct NalContext NalContext; +struct mcc_struct_anon_54; +typedef struct mcc_struct_anon_54 SliceBufferEntry; +struct H264Mb; +typedef struct H264Mb H264Mb; +struct mcc_struct_anon_54 { - SPS *sps_buffers[32]; - PPS *pps_buffers[256]; - SPS sps; - PictureInfo picture[16 + 1]; - PictureInfo *release_ref[66]; - PictureInfo *short_ref[32]; - PictureInfo *long_ref[32]; - int long_ref_count; - int short_ref_count; - uint32_t coded_pic_num; - int poc_lsb; - int poc_msb; - uint32_t poc_offset; - int delta_poc; - int frame_num; - int prev_poc_msb; - int prev_poc_lsb; - int frame_num_offset; - int prev_frame_num_offset; - int prev_frame_num; - int max_pic_num; - int redundant_pic_count; - int outputed_poc; - int ip_id; - int b4_stride; - int mb_stride; - int mb_width; - int mb_height; - int width; - int height; - int has_b_frames; - SEI_PicStructType sei_pic_struct; - int sei_ct_type; - int sei_dpb_output_delay; - int sei_cpb_removal_delay; - int sei_recovery_frame_cnt; - int sei_buffering_period_present; - int initial_cpb_removal_delay[32]; -} NalContext; -typedef struct EntropyContext + H264Slice slice; + H264Mb *mbs; + DecodedPicture *dp; + GetBitContext gb; + int lines_taken; + int lines_total; + int state; + int initialized; +}; +void init_sb_entry(H264Context *h, SliceBufferEntry *sbe); +struct __pthread_internal_list; +struct __pthread_internal_list { - CABACContext c; - H264Mb *m; - int top_cbp; - int left_cbp; - int neighbor_transform_size; - uint32_t top_type; - uint32_t left_type; - uint32_t topright_type; - uint32_t topleft_type; - int curr_qscale; - int chroma_qp[2]; - int last_qscale_diff; - uint32_t dequant4_buffer[6][52][16]; - uint32_t dequant8_buffer[2][52][64]; - uint32_t (*dequant4_coeff[6])[16]; - uint32_t (*dequant8_coeff[2])[64]; - uint8_t (*non_zero_count_top)[8]; - uint8_t (*non_zero_count)[8]; - uint8_t (*non_zero_count_row[2])[8]; - uint8_t __attribute__((aligned(8))) non_zero_count_left[8]; - uint8_t (*mvd_top[2])[2]; - uint8_t (*mvd[2])[2]; - uint8_t (*mvd_table[2][2])[2]; - uint8_t *direct_top; - uint8_t *direct; - uint8_t *direct_table[2]; - uint8_t *chroma_pred_mode_top; - uint8_t *chroma_pred_mode; - uint8_t *chroma_pred_mode_table[2]; - uint16_t *cbp_top; - uint16_t *cbp; - uint16_t *cbp_table[2]; - int8_t *qscale_top; - int8_t *qscale; - int8_t *qscale_table[2]; - int8_t *ref_index_top[2]; - int8_t *ref_index[2]; - int8_t *ref_index_table[2][2]; - uint32_t *mb_type_top; - uint32_t *mb_type; - uint32_t *mb_type_table[2]; - int b_stride; - int mb_stride; - int mb_width; - int mb_height; - uint8_t *zigzag_scan; - uint8_t *zigzag_scan8x8; - uint8_t direct_cache[5 * 8]; - int8_t __attribute__((aligned(8))) intra4x4_pred_mode_cache[5 * 8]; - int16_t __attribute__((aligned(16))) mv_cache[2][5 * 8][2]; - int8_t __attribute__((aligned(8))) ref_cache[2][5 * 8]; - uint8_t __attribute__((aligned(8))) non_zero_count_cache[6 * 8]; - uint8_t __attribute__((aligned(16))) mvd_cache[2][5 * 8][2]; -} EntropyContext; -typedef struct H264Slice + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +}; +typedef struct __pthread_internal_list __pthread_list_t; +struct __pthread_mutex_s { - PPS pps; - PictureInfo *current_picture_info; - DecodedPicture *curr_pic; - int slice_num; - int release_ref_cpn[66]; - int release_cnt; - int qp_thresh; - int use_weight; - int use_weight_chroma; - int luma_log2_weight_denom; - int chroma_log2_weight_denom; - int16_t luma_weight[16][2][2]; - int16_t chroma_weight[16][2][2][2]; - int16_t implicit_weight[16][16][2]; - int ref_list_cpn[2][16]; - PictureInfo *ref_list[2][16]; - DecodedPicture *dp_ref_list[2][16]; - int ref_count[2]; - int slice_type; - int slice_type_nos; - int slice_alpha_c0_offset; - int slice_beta_offset; - int direct_8x8_inference_flag; - uint8_t list_count; - uint32_t coded_pic_num; - int poc; - int key_frame; - int mmco_reset; - int ip_id; - int transform_bypass; - int direct_spatial_mv_pred; - int map_col_to_list0[2][16]; - int dist_scale_factor[16]; - int cabac_init_idc; - int nal_ref_idc; - int nal_unit_type; - int ref2frm[2][64]; - int qscale; -} H264Slice; -typedef struct + int __lock; + unsigned int __count; + int __owner; + unsigned int __nusers; + int __kind; + int __spins; + __pthread_list_t __list; +}; +union mcc_union_anon_26 { - H264Slice slice; - H264Mb *mbs; - DecodedPicture *dp; - GetBitContext gb; - int lines_taken; - int lines_total; - int state; - int initialized; -} SliceBufferEntry; -typedef struct RingLineEntry + struct __pthread_mutex_s __data; + char __size[40]; + long int __align; +}; +typedef union mcc_union_anon_26 pthread_mutex_t; +struct mcc_struct_anon_29 { - union - { - volatile int32_t __attribute__((aligned(64))) mb_cnt; - int32_t __attribute__((aligned(64))) pad[16]; - }; - SliceBufferEntry *sbe; - int id; - int line; - TopBorder *top; - struct RingLineEntry *prev_line; -} RingLineEntry; -typedef struct SuperMBTask + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; +}; +union mcc_union_anon_28 { - int smb_x; - int smb_y; -} SuperMBTask; -typedef struct SuperMBContext + struct mcc_struct_anon_29 __data; + char __size[48]; + __extension__ long long int __align; +}; +typedef union mcc_union_anon_28 pthread_cond_t; +struct mcc_struct_anon_56 { - int nsmb_width; - int nsmb_height; - int nsmb_3dheight; - int smb_width; - int smb_height; - int refcount; - int index; - SuperMBTask *smbs[2]; -} SuperMBContext; -typedef struct MBRecState + pthread_mutex_t lock; + pthread_cond_t cond; + SliceBufferEntry **queue; + int size; + int cnt; + int fi; + int fo; +}; +typedef struct mcc_struct_anon_56 SliceBufferQueue; +struct RingLineEntry; +typedef struct RingLineEntry RingLineEntry; +struct mcc_struct_anon_57 { - int8_t *ref_index_top[2]; - int8_t *ref_index[2]; - int16_t (*motion_val_top[2])[2]; - int16_t (*motion_val[2])[2]; - uint32_t *mb_type_top; - uint32_t *mb_type; - int8_t *list1_ref_index[2]; - int16_t (*list1_motion_val[2])[2]; - uint32_t *list1_mb_type; - int8_t *intra4x4_pred_mode_top; - int8_t *intra4x4_pred_mode; - int8_t *non_zero_count_top; - int8_t *non_zero_count; - unsigned int topleft_samples_available; - unsigned int topright_samples_available; - unsigned int top_samples_available; - unsigned int left_samples_available; - int top_type; - int left_type; - int8_t __attribute__((aligned(8))) intra4x4_pred_mode_cache[5 * 8]; - int16_t __attribute__((aligned(16))) mv_cache[2][5 * 8][2]; - int8_t __attribute__((aligned(8))) ref_cache[2][5 * 8]; - uint8_t __attribute__((aligned(8))) non_zero_count_cache[6 * 8]; - uint8_t __attribute__((aligned(16))) mvd_cache[2][5 * 8][2]; - int16_t __attribute__((aligned(8))) bS[2][4][4]; - uint8_t edges[2]; -} MBRecState; -typedef struct MBRecContext + pthread_mutex_t wslock; + pthread_cond_t wscond; + pthread_mutex_t swlock; + pthread_cond_t swcond; + RingLineEntry **queue; + int size; + int ready; + int free; + int fi; + int fo; +}; +typedef struct mcc_struct_anon_57 RingLineQueue; +union mcc_union_anon_25 { - DSPContext dsp; - H264DSPContext hdsp; - H264PredContext hpc; - MBRecState *mrs; - RingLineEntry *rle; - uint8_t *scratchpad_y; - uint8_t *scratchpad_cb; - uint8_t *scratchpad_cr; - int linesize; - int uvlinesize; - int mb_width; - int mb_height; - int mb_stride; - int b_stride; - int width; - int height; - int block_offset[16 + 8]; -} MBRecContext; -typedef struct OutputContext + char __size[56]; + long int __align; +}; +typedef union mcc_union_anon_25 pthread_attr_t; +typedef unsigned long int pthread_t; +struct SuperMBContext; +typedef struct SuperMBContext SuperMBContext; +typedef long int __time_t; +struct timespec { - int bit_buffer_size; - uint8_t *bit_buffer; - uint64_t video_size; - int frame_number; - DecodedPicture *delayed_pic[33]; - int dp_cnt; -} OutputContext; -typedef struct + __time_t tv_sec; + long int tv_nsec; +}; +struct H264Context { - pthread_mutex_t lock; - pthread_cond_t cond; - SliceBufferEntry **queue; - int size; - int cnt; - int fi; - int fo; -} SliceBufferQueue; -typedef struct + SliceBufferQueue sb_q[6]; + RingLineQueue rl_q; + pthread_mutex_t lock[6]; + pthread_cond_t cond[6]; + pthread_mutex_t task_lock; + pthread_cond_t task_cond; + pthread_attr_t ed_rec_attr[80]; + pthread_t ed_rec_thr[80]; + int init_threads; + pthread_mutex_t ilock; + pthread_cond_t icond; + const char *file_name; + int profile; + int start; + int touch_start; + int setaff; + int touch_done; + int rl_side_touch; + int statmbd; + pthread_mutex_t slock; + pthread_cond_t scond; + pthread_mutex_t tlock; + pthread_cond_t tcond; + pthread_mutex_t tdlock; + pthread_cond_t tdcond; + int ed_ppe_threads; + int threads; + int smt; + int acdpb_cnt; + int reldpb_cnt; + int sb_size; + SliceBufferEntry *sb; + int free_sb_cnt; + int slice_bufs; + int max_dpb_cnt; + DecodedPicture *dpb; + int free_dpb_cnt; + int ifile; + int ofile; + int frame_width; + int frame_height; + int num_frames; + int width; + int height; + int mb_width; + int mb_height; + int mb_stride; + int b4_stride; + int b_stride; + int smb_height; + int smb_width; + pthread_mutex_t smb_lock; + pthread_cond_t sdl_cond; + pthread_mutex_t sdl_lock; + SuperMBContext *smbc; + int wave_order; + int static_3d; + int pipe_bufs; + uint8_t zigzag_scan[16]; + uint8_t zigzag_scan8x8[64]; + int verbose; + int no_mbd; + int display; + int fullscreen; + int quit; + struct timespec start_time[4]; + struct timespec end_time[4]; + double last_time[4]; + double total_time[4]; +}; +void av_read_frame_internal(ParserContext *pc, GetBitContext *gb); +int decode_nal_units(NalContext *n, H264Slice *s, GetBitContext *gb); +static void parse_task(H264Context *h, ParserContext *pc, NalContext *nc, SliceBufferEntry *sbe) { - pthread_mutex_t wslock; - pthread_cond_t wscond; - pthread_mutex_t swlock; - pthread_cond_t swcond; - RingLineEntry **queue; - int size; - int ready; - int free; - int fi; - int fo; -} RingLineQueue; -typedef struct H264Context + H264Slice *s; + if (!(*sbe).initialized) + { + { + init_sb_entry(h, sbe); + (*sbe).lines_total = (*h).mb_height; + } + } + av_read_frame_internal(pc, &(*sbe).gb); + s = &(*sbe).slice; + decode_nal_units(nc, s, &(*sbe).gb); +} +struct EntropyContext; +typedef struct EntropyContext EntropyContext; +struct EntropyContext { - SliceBufferQueue sb_q[STAGES]; - RingLineQueue rl_q; - pthread_mutex_t lock[STAGES]; - pthread_cond_t cond[STAGES]; - pthread_mutex_t task_lock; - pthread_cond_t task_cond; - pthread_attr_t ed_rec_attr[80]; - pthread_t ed_rec_thr[80]; - int init_threads; - pthread_mutex_t ilock; - pthread_cond_t icond; - const char *file_name; - int profile; - int start; - int touch_start; - int setaff; - int touch_done; - int rl_side_touch; - int statmbd; - pthread_mutex_t slock; - pthread_cond_t scond; - pthread_mutex_t tlock; - pthread_cond_t tcond; - pthread_mutex_t tdlock; - pthread_cond_t tdcond; - int ed_ppe_threads; - int threads; - int smt; - int acdpb_cnt; - int reldpb_cnt; - int sb_size; - SliceBufferEntry *sb; - int free_sb_cnt; - int slice_bufs; - int max_dpb_cnt; - DecodedPicture *dpb; - int free_dpb_cnt; - int ifile; - int ofile; - int frame_width; - int frame_height; - int num_frames; - int width; - int height; - int mb_width; - int mb_height; - int mb_stride; - int b4_stride; - int b_stride; - int smb_height; - int smb_width; - pthread_mutex_t smb_lock; - pthread_cond_t sdl_cond; - pthread_mutex_t sdl_lock; - SuperMBContext *smbc; - int wave_order; - int static_3d; - int pipe_bufs; - uint8_t zigzag_scan[16]; - uint8_t zigzag_scan8x8[64]; - int verbose; - int no_mbd; - int display; - int fullscreen; - int quit; - struct timespec start_time[PROFILE_STAGES]; - struct timespec end_time[PROFILE_STAGES]; - double last_time[PROFILE_STAGES]; - double total_time[PROFILE_STAGES]; -} H264Context; -void av_read_frame_internal(ParserContext *pc, GetBitContext *gb); -ParserContext *get_parse_context(int ifile); -void free_parse_context(ParserContext *pc); -int decode_nal_units(NalContext *n, H264Slice *s, GetBitContext *gb); -NalContext *get_nal_context(int width, int height); -void free_nal_context(NalContext *nc); -int ff_h264_decode_mb_cabac(EntropyContext *ec, H264Slice *s, CABACContext *c); + CABACContext c; + H264Mb *m; + int top_cbp; + int left_cbp; + int neighbor_transform_size; + uint32_t top_type; + uint32_t left_type; + uint32_t topright_type; + uint32_t topleft_type; + int curr_qscale; + int chroma_qp[2]; + int last_qscale_diff; + uint32_t dequant4_buffer[6][52][16]; + uint32_t dequant8_buffer[2][52][64]; + uint32_t (*dequant4_coeff[6])[16]; + uint32_t (*dequant8_coeff[2])[64]; + uint8_t (*non_zero_count_top)[8]; + uint8_t (*non_zero_count)[8]; + uint8_t (*non_zero_count_row[2])[8]; + __attribute__((aligned(8))) uint8_t non_zero_count_left[8]; + uint8_t (*mvd_top[2])[2]; + uint8_t (*mvd[2])[2]; + uint8_t (*mvd_table[2][2])[2]; + uint8_t *direct_top; + uint8_t *direct; + uint8_t *direct_table[2]; + uint8_t *chroma_pred_mode_top; + uint8_t *chroma_pred_mode; + uint8_t *chroma_pred_mode_table[2]; + uint16_t *cbp_top; + uint16_t *cbp; + uint16_t *cbp_table[2]; + int8_t *qscale_top; + int8_t *qscale; + int8_t *qscale_table[2]; + int8_t *ref_index_top[2]; + int8_t *ref_index[2]; + int8_t *ref_index_table[2][2]; + uint32_t *mb_type_top; + uint32_t *mb_type; + uint32_t *mb_type_table[2]; + int b_stride; + int mb_stride; + int mb_width; + int mb_height; + uint8_t *zigzag_scan; + uint8_t *zigzag_scan8x8; + uint8_t direct_cache[40]; + __attribute__((aligned(8))) int8_t intra4x4_pred_mode_cache[40]; + __attribute__((aligned(16))) int16_t mv_cache[2][40][2]; + __attribute__((aligned(8))) int8_t ref_cache[2][40]; + __attribute__((aligned(8))) uint8_t non_zero_count_cache[48]; + __attribute__((aligned(16))) uint8_t mvd_cache[2][40][2]; +}; +void init_dequant_tables(H264Slice *s, EntropyContext *ec); +void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size); void ff_h264_init_cabac_states(EntropyContext *ec, H264Slice *s, CABACContext *c); int init_entropy_buf(EntropyContext *ec, H264Slice *s, int line); -EntropyContext *get_entropy_context(H264Context *h); -void init_dequant_tables(H264Slice *s, EntropyContext *ec); -void free_entropy_context(EntropyContext *ec); -MBRecContext *get_mbrec_context(H264Context *h); -void free_mbrec_context(MBRecContext *d); -void h264_decode_mb_internal(MBRecContext *d, MBRecState *mrs, H264Slice *s, H264Mb *m); -void init_mbrec_context(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, int line); -void ff_h264_pred_direct_motion_rec(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, int *mb_type); -int pred_motion_mb_rec(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, H264Mb *m); -void start_timer(H264Context *h, int stage); -void stop_timer(H264Context *h, int stage); -void init_sb_entry(H264Context *h, SliceBufferEntry *sbe); -void free_sb_entry(SliceBufferEntry *sb); -SliceBufferEntry *get_sb_entry(H264Context *h); -void release_sb_entry(H264Context *h, SliceBufferEntry *sb); -DecodedPicture *get_dpb_entry(H264Context *h, H264Slice *s); -void release_dpb_entry(H264Context *h, DecodedPicture *pic, int mode); -void draw_edges(MBRecContext *d, H264Slice *s, int line); -int ff_init_slice(NalContext *n, H264Slice *s); -void free_picture(PictureInfo *pic); -void free_dp(DecodedPicture *pic); -void av_start_timer(); -int copyEDtoH264Slice(H264Slice *ms, H264Slice *es); -void print_report(int frame_number, uint64_t video_size, int is_last_report, int verbose); -int ff_alloc_picture_info(NalContext *n, H264Slice *s, PictureInfo *pic); -DecodedPicture *output_frame(H264Context *h, OutputContext *oc, DecodedPicture *pic, int fd, int frame_width, int frame_height); -OutputContext *get_output_context(H264Context *h); -void free_output_context(OutputContext *oc); -void freeSuperMBContext(SuperMBContext *smbc); -SuperMBContext *getSuperMBContext(H264Context *h, int smb_width, int smb_height); -void release_smbc(H264Context *h, SuperMBContext *smbc); -SuperMBContext *acquire_smbc(H264Context *h); -static inline int get_chroma_qp(H264Slice *s, int t, int qscale) +struct H264Mb { - return s->pps.chroma_qp_table[t][qscale]; -} -static void parse_task(H264Context *h, ParserContext *pc, NalContext *nc, SliceBufferEntry *sbe) -{ - H264Slice *s; - if (!sbe->initialized) + int16_t mb_x; + int16_t mb_y; + int32_t mb_type; + uint16_t cbp; + int8_t qscale_mb_xy; + int8_t qscale_left_mb_xy; + int8_t qscale_top_mb_xy; + __attribute__((aligned(8))) uint16_t sub_mb_type[4]; + __attribute__((aligned(8))) uint8_t non_zero_count[24]; + __attribute__((aligned(16))) int16_t mb[384]; + union + { + struct { - init_sb_entry(h, sbe); - sbe->lines_total = h->mb_height; - } - av_read_frame_internal(pc, &sbe->gb); - s = &sbe->slice; - decode_nal_units(nc, s, &sbe->gb); -} + __attribute__((aligned(8))) int8_t ref_index[2][4]; + __attribute__((aligned(16))) int16_t mvd[2][16][2]; + }; + struct + { + __attribute__((aligned(8))) int8_t intra4x4_pred_mode[16]; + int8_t chroma_pred_mode; + int8_t intra16x16_pred_mode; + }; + }; + __attribute__((aligned(8))) uint8_t top_border[32]; + __attribute__((aligned(8))) uint8_t top_border_next[8]; + __attribute__((aligned(8))) uint8_t left_border[35]; + int8_t intra4x4_pred_mode_left[4]; +}; +int ff_h264_decode_mb_cabac(EntropyContext *ec, H264Slice *s, CABACContext *c); static void decode_slice_entropy_task(H264Context *h, EntropyContext *ec, SliceBufferEntry *sbe) { - int i, j; - H264Slice *s = &sbe->slice; - GetBitContext *gb = &sbe->gb; - H264Mb *mbs = sbe->mbs; - CABACContext *c = &ec->c; - if (!s->pps.cabac) + int j; + int i; + H264Slice *s = &(*sbe).slice; + GetBitContext *gb = &(*sbe).gb; + H264Mb *mbs = (*sbe).mbs; + CABACContext *c = &(*ec).c; + if (!(*s).pps.cabac) { + { av_log(16, "Only cabac encoded streams are supported\n"); - return; + return ; + } } - init_dequant_tables(s, ec); - ec->curr_qscale = s->qscale; - ec->last_qscale_diff = 0; - ec->chroma_qp[0] = get_chroma_qp((H264Slice *) s, 0, s->qscale); - ec->chroma_qp[1] = get_chroma_qp((H264Slice *) s, 1, s->qscale); - align_get_bits(gb); - ff_init_cabac_decoder(c, gb->buffer + get_bits_count(gb) / 8, (get_bits_left(gb) + 7) / 8); - ff_h264_init_cabac_states(ec, s, c); - for (j = 0; - j < ec->mb_height; - j++) + init_dequant_tables(s, ec); + (*ec).curr_qscale = (*s).qscale; + (*ec).last_qscale_diff = 0; + (*ec).chroma_qp[0] = get_chroma_qp((H264Slice *)s, 0, (*s).qscale); + (*ec).chroma_qp[1] = get_chroma_qp((H264Slice *)s, 1, (*s).qscale); + align_get_bits(gb); + ff_init_cabac_decoder(c, (*gb).buffer + get_bits_count(gb) / 8, (get_bits_left(gb) + 7) / 8); + ff_h264_init_cabac_states(ec, s, c); + for (j = 0; j < (*ec).mb_height; j++) { + { init_entropy_buf(ec, s, j); - for (i = 0; - i < ec->mb_width; - i++) + for (i = 0; i < (*ec).mb_width; i++) + { + { + int ret; + int eos; + H264Mb *m = &mbs[i + j * (*ec).mb_width]; + (*m).mb_x = i; + (*m).mb_y = j; + (*ec).m = m; + ret = ff_h264_decode_mb_cabac(ec, s, c); + eos = get_cabac_terminate(c); + (void)eos; + if (ret < 0 || (*c).bytestream > (*c).bytestream_end + 2) + { + { + av_log(16, "error while decoding MB %d %d, bytestream (%td)\n", (*m).mb_x, (*m).mb_y, (*c).bytestream_end - (*c).bytestream); + return ; + } + } + } + } + } + } +} +struct MBRecContext; +typedef struct MBRecContext MBRecContext; +struct SuperMBTask; +typedef struct SuperMBTask SuperMBTask; +struct SuperMBContext +{ + int nsmb_width; + int nsmb_height; + int nsmb_3dheight; + int smb_width; + int smb_height; + int refcount; + int index; + SuperMBTask *smbs[2]; +}; +struct MBRecState; +typedef struct MBRecState MBRecState; +void init_mbrec_context(MBRecContext *mrc, MBRecState *mrs, H264Slice *s, int line); +struct MBRecState +{ + int8_t *ref_index_top[2]; + int8_t *ref_index[2]; + int16_t (*motion_val_top[2])[2]; + int16_t (*motion_val[2])[2]; + uint32_t *mb_type_top; + uint32_t *mb_type; + int8_t *list1_ref_index[2]; + int16_t (*list1_motion_val[2])[2]; + uint32_t *list1_mb_type; + int8_t *intra4x4_pred_mode_top; + int8_t *intra4x4_pred_mode; + int8_t *non_zero_count_top; + int8_t *non_zero_count; + unsigned int topleft_samples_available; + unsigned int topright_samples_available; + unsigned int top_samples_available; + unsigned int left_samples_available; + int top_type; + int left_type; + __attribute__((aligned(8))) int8_t intra4x4_pred_mode_cache[40]; + __attribute__((aligned(16))) int16_t mv_cache[2][40][2]; + __attribute__((aligned(8))) int8_t ref_cache[2][40]; + __attribute__((aligned(8))) uint8_t non_zero_count_cache[48]; + __attribute__((aligned(16))) uint8_t mvd_cache[2][40][2]; + __attribute__((aligned(8))) int16_t bS[2][4][4]; + uint8_t edges[2]; +}; +typedef short int DCTELEM; +typedef void (*op_pixels_func)(uint8_t *, const uint8_t *, int, int); +typedef void (*qpel_mc_func)(uint8_t *, uint8_t *, int); +typedef void (*h264_chroma_mc_func)(uint8_t *, uint8_t *, int, int, int, int); +struct DSPContext +{ + void (*get_pixels)(DCTELEM *, const uint8_t *, int); + void (*diff_pixels)(DCTELEM *, const uint8_t *, const uint8_t *, int); + void (*put_pixels_clamped)(const DCTELEM *, uint8_t *, int); + void (*put_signed_pixels_clamped)(const DCTELEM *, uint8_t *, int); + void (*put_pixels_nonclamped)(const DCTELEM *, uint8_t *, int); + void (*add_pixels_clamped)(const DCTELEM *, uint8_t *, int); + void (*add_pixels8)(uint8_t *, DCTELEM *, int); + void (*add_pixels4)(uint8_t *, DCTELEM *, int); + void (*clear_block)(DCTELEM *); + void (*clear_blocks)(DCTELEM *); + void (*put_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int); + void (*avg_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int); + void (*put_no_rnd_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int); + void (*avg_no_rnd_pixels_tab[4][4])(uint8_t *, const uint8_t *, int, int); + void (*put_no_rnd_pixels_l2[2])(uint8_t *, const uint8_t *, const uint8_t *, int, int); + void (*put_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int); + void (*avg_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int); + void (*put_no_rnd_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int); + void (*avg_no_rnd_qpel_pixels_tab[2][16])(uint8_t *, uint8_t *, int); + void (*put_mspel_pixels_tab[8])(uint8_t *, uint8_t *, int); + void (*put_h264_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int); + void (*avg_h264_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int); + void (*put_no_rnd_vc1_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int); + void (*avg_no_rnd_vc1_chroma_pixels_tab[3])(uint8_t *, uint8_t *, int, int, int, int); + void (*put_h264_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int); + void (*avg_h264_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int); + void (*put_2tap_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int); + void (*avg_2tap_qpel_pixels_tab[4][16])(uint8_t *, uint8_t *, int); + void (*fdct)(DCTELEM *); + void (*fdct248)(DCTELEM *); + void (*idct)(DCTELEM *); + void (*idct_put)(uint8_t *, int, DCTELEM *); + void (*idct_add)(uint8_t *, int, DCTELEM *); + void (*draw_edges)(uint8_t *, int, int, int, int); + void (*prefetch)(void *, int, int); +}; +typedef struct DSPContext DSPContext; +typedef void (*h264_weight_func)(uint8_t *, int, int, int, int); +typedef void (*h264_biweight_func)(uint8_t *, uint8_t *, int, int, int, int, int); +struct H264DSPContext +{ + void (*weight_h264_pixels_tab[10])(uint8_t *, int, int, int, int); + void (*biweight_h264_pixels_tab[10])(uint8_t *, uint8_t *, int, int, int, int, int); + void (*h264_v_loop_filter_luma)(uint8_t *, int, int, int, int8_t *); + void (*h264_h_loop_filter_luma)(uint8_t *, int, int, int, int8_t *); + void (*h264_v_loop_filter_luma_intra)(uint8_t *, int, int, int); + void (*h264_h_loop_filter_luma_intra)(uint8_t *, int, int, int); + void (*h264_v_loop_filter_chroma)(uint8_t *, int, int, int, int8_t *); + void (*h264_h_loop_filter_chroma)(uint8_t *, int, int, int, int8_t *); + void (*h264_v_loop_filter_chroma_intra)(uint8_t *, int, int, int); + void (*h264_h_loop_filter_chroma_intra)(uint8_t *, int, int, int); + 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); + void (*h264_idct_add)(uint8_t *, DCTELEM *, int); + void (*h264_idct8_add)(uint8_t *, DCTELEM *, int); + void (*h264_idct_dc_add)(uint8_t *, DCTELEM *, int); + void (*h264_idct8_dc_add)(uint8_t *, DCTELEM *, int); + void (*h264_dct)(DCTELEM [4][4]); + void (*h264_idct_add16)(uint8_t *, const int *, DCTELEM *, int, const uint8_t [48]); + void (*h264_idct8_add4)(uint8_t *, const int *, DCTELEM *, int, const uint8_t [48]); + void (*h264_idct_add8)(uint8_t **, const int *, DCTELEM *, int, const uint8_t [48]); + void (*h264_idct_add16intra)(uint8_t *, const int *, DCTELEM *, int, const uint8_t [48]); + void (*(*qpel_put)[16])(uint8_t *, uint8_t *, int); + void (*(*qpel_avg)[16])(uint8_t *, uint8_t *, int); +}; +typedef struct H264DSPContext H264DSPContext; +struct H264PredContext +{ + void (*pred4x4[15])(uint8_t *, uint8_t *, int); + void (*pred8x8l[12])(uint8_t *, int, int, int); + void (*pred8x8[11])(uint8_t *, int); + void (*pred16x16[7])(uint8_t *, int); + void (*pred4x4_add[2])(uint8_t *, const DCTELEM *, int); + void (*pred8x8l_add[2])(uint8_t *, const DCTELEM *, int); + void (*pred8x8_add[3])(uint8_t *, const int *, const DCTELEM *, int); + void (*pred16x16_add[3])(uint8_t *, const int *, const DCTELEM *, int); +}; +typedef struct H264PredContext H264PredContext; +struct MBRecContext +{ + DSPContext dsp; + H264DSPContext hdsp; + H264PredContext hpc; + MBRecState *mrs; + RingLineEntry *rle; + uint8_t *scratchpad_y; + uint8_t *scratchpad_cb; + uint8_t *scratchpad_cr; + int linesize; + int uvlinesize; + int mb_width; + int mb_height; + int mb_stride; + int b_stride; + int width; + int height; + int block_offset[24]; +}; +void h264_decode_mb_internal(MBRecContext *d, MBRecState *mrs, H264Slice *s, H264Mb *m); +static void decode_super_mb_block(MBRecContext *d, H264Slice *s, SuperMBContext *smbc, H264Mb *mbs, int smb_x, int smb_y) +{ + MBRecState mrs; + for (int k = 0, i = smb_y; i < smb_y + (*smbc).smb_height; (i++, k++)) + { + { + init_mbrec_context(d, &mrs, s, i); + for (int j = smb_x - k; j < smb_x - k + (*smbc).smb_width; j++) + { + { + if ((i < (*d).mb_height && j >= 0) && j < (*d).mb_width) + { + { + h264_decode_mb_internal(d, &mrs, s, &mbs[i * (*d).mb_width + j]); + } + } + } + } + } + } +} +struct SuperMBTask +{ + int smb_x; + int smb_y; +}; +static void decode_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *m) +{ + H264Slice *s = &(*sbe).slice; + H264Mb *mbs = (*sbe).mbs; + decode_super_mb_block(d, s, smbc, mbs, (*m).smb_x, (*m).smb_y); +} +void draw_edges(MBRecContext *d, H264Slice *s, int line); +static void draw_edges_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *sm, int line) +{ + H264Slice *s = &(*sbe).slice; + for (int i = line * (*smbc).smb_height; i < (line + 1) * (*smbc).smb_height && i < (*d).mb_height; i++) + { + draw_edges(d, s, i); + } +} +SuperMBContext *acquire_smbc(H264Context *h); +enum mcc_enum_anon_8 +{ + NANOS_OK = 0, + NANOS_UNKNOWN_ERR = 1, + NANOS_UNIMPLEMENTED = 2, + NANOS_ENOMEM = 3, + NANOS_INVALID_PARAM = 4 +}; +typedef enum mcc_enum_anon_8 nanos_err_t; +extern nanos_err_t nanos_in_final(_Bool *result); +struct mcc_struct_anon_20 +{ + void (*outline)(void *); +}; +typedef struct mcc_struct_anon_20 nanos_smp_args_t; +struct nanos_args_0_t +{ + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBContext *smbc; + SuperMBTask *ml; + SuperMBTask *mur; + SuperMBTask *m; +}; +static void smp_ol_decode_super_mb_task_1(struct nanos_args_0_t *const args); +struct mcc_struct_anon_16 +{ + _Bool mandatory_creation:1; + _Bool tied:1; + _Bool clear_chunk:1; + _Bool reserved0:1; + _Bool reserved1:1; + _Bool reserved2:1; + _Bool reserved3:1; + _Bool reserved4:1; +}; +typedef struct mcc_struct_anon_16 nanos_wd_props_t; +typedef unsigned long int size_t; +struct nanos_const_wd_definition_tag +{ + nanos_wd_props_t props; + size_t data_alignment; + size_t num_copies; + size_t num_devices; + size_t num_dimensions; + const char *description; +}; +typedef struct nanos_const_wd_definition_tag nanos_const_wd_definition_t; +struct mcc_struct_anon_19 +{ + void *(*factory)(void *); + void *arg; +}; +typedef struct mcc_struct_anon_19 nanos_device_t; +struct nanos_const_wd_definition_1 +{ + nanos_const_wd_definition_t base; + nanos_device_t devices[1]; +}; +extern void *nanos_smp_factory(void *args); +struct mcc_struct_anon_17 +{ + _Bool is_final:1; + _Bool reserved1:1; + _Bool reserved2:1; + _Bool reserved3:1; + _Bool reserved4:1; + _Bool reserved5:1; + _Bool reserved6:1; + _Bool reserved7:1; +}; +typedef struct mcc_struct_anon_17 nanos_wd_dyn_flags_t; +typedef void *nanos_thread_t; +struct mcc_struct_anon_18 +{ + nanos_wd_dyn_flags_t flags; + void *tie_to; + unsigned int priority; +}; +typedef struct mcc_struct_anon_18 nanos_wd_dyn_props_t; +typedef void *nanos_wd_t; +struct mcc_struct_anon_9; +typedef struct mcc_struct_anon_9 nanos_copy_data_internal_t; +typedef nanos_copy_data_internal_t nanos_copy_data_t; +struct mcc_struct_anon_5; +typedef struct mcc_struct_anon_5 nanos_region_dimension_internal_t; +typedef void *nanos_wg_t; +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); +extern void *nanos_current_wd(void); +extern void nanos_handle_error(nanos_err_t err); +struct mcc_struct_anon_5 +{ + size_t size; + size_t lower_bound; + size_t accessed_length; +}; +typedef nanos_region_dimension_internal_t nanos_region_dimension_t; +struct mcc_struct_anon_6 +{ + _Bool input:1; + _Bool output:1; + _Bool can_rename:1; + _Bool concurrent:1; + _Bool commutative:1; +}; +typedef struct mcc_struct_anon_6 nanos_access_type_internal_t; +typedef long int ptrdiff_t; +struct mcc_struct_anon_7 +{ + void *address; + nanos_access_type_internal_t flags; + short int dimension_count; + const nanos_region_dimension_internal_t *dimensions; + ptrdiff_t offset; +}; +typedef struct mcc_struct_anon_7 nanos_data_access_internal_t; +typedef nanos_data_access_internal_t nanos_data_access_t; +typedef void *nanos_team_t; +extern nanos_err_t nanos_submit(void *wd, size_t num_data_accesses, nanos_data_access_t *data_accesses, void *team); +typedef void (*nanos_translate_args_t)(void *, void *); +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 *)); +struct nanos_args_1_t +{ + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBContext *smbc; + SuperMBTask *sm; + int line; +}; +static void smp_ol_draw_edges_task_3(struct nanos_args_1_t *const args); +extern nanos_err_t nanos_wait_on(size_t num_data_accesses, nanos_data_access_t *data_accesses); +void release_smbc(H264Context *h, SuperMBContext *smbc); +static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe) +{ + int j; + int i; + SuperMBTask *sml; + SuperMBTask *smur; + SuperMBContext *smbc = acquire_smbc(h); + int smb_height = (*smbc).nsmb_height; + int smb_width = (*smbc).nsmb_width; + SuperMBTask *smbs = (*smbc).smbs[0]; + SuperMBTask *sm = (void *)0; + for (j = 0; j < smb_height; j++) + { + { + nanos_err_t mcc_err_in_final_1; + _Bool mcc_is_in_final_1; + for (i = 0; i < smb_width; i++) + { + { + nanos_err_t mcc_err_in_final_0; + _Bool mcc_is_in_final_0; + sm = smbs + j * smb_width + i; + sml = sm - (i > 0 ? 1 : 0); + smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0); + mcc_err_in_final_0 = nanos_in_final(&mcc_is_in_final_0); + { + MBRecContext *mcc_arg_0 = d; + SliceBufferEntry *mcc_arg_1 = sbe; + SuperMBContext *mcc_arg_2 = smbc; + SuperMBTask *mcc_arg_3 = sml; + SuperMBTask *mcc_arg_4 = smur; + SuperMBTask *mcc_arg_5 = sm; + if (mcc_is_in_final_0) + { + decode_super_mb_task(d, sbe, smbc, sml, smur, sm); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_0_t *ol_args; + nanos_err_t err; + struct nanos_args_0_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_0_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).d = mcc_arg_0; + (*ol_args).sbe = mcc_arg_1; + (*ol_args).smbc = mcc_arg_2; + (*ol_args).ml = mcc_arg_3; + (*ol_args).mur = mcc_arg_4; + (*ol_args).m = mcc_arg_5; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 5, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.d = mcc_arg_0; + imm_args.sbe = mcc_arg_1; + imm_args.smbc = mcc_arg_2; + imm_args.ml = mcc_arg_3; + imm_args.mur = mcc_arg_4; + imm_args.m = mcc_arg_5; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + } + } + mcc_err_in_final_1 = nanos_in_final(&mcc_is_in_final_1); { - int eos, ret; - H264Mb *m = &mbs[i + j * ec->mb_width]; - m->mb_x = i; - m->mb_y = j; - ec->m = m; - ret = ff_h264_decode_mb_cabac(ec, s, c); - eos = get_cabac_terminate(c); - (void) eos; - if (ret < 0 || c->bytestream > c->bytestream_end + 2) + MBRecContext *mcc_arg_6 = d; + SliceBufferEntry *mcc_arg_7 = sbe; + SuperMBContext *mcc_arg_8 = smbc; + SuperMBTask *mcc_arg_9 = sm; + int mcc_arg_10 = j; + if (mcc_is_in_final_1) { - av_log(16, "error while decoding MB %d %d, bytestream (%td)\n", m->mb_x, m->mb_y, c->bytestream_end - c->bytestream); - return; + draw_edges_task(d, sbe, smbc, sm, j); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_1_t *ol_args; + nanos_err_t err; + struct nanos_args_1_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_1_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).d = mcc_arg_6; + (*ol_args).sbe = mcc_arg_7; + (*ol_args).smbc = mcc_arg_8; + (*ol_args).sm = mcc_arg_9; + (*ol_args).line = mcc_arg_10; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.d = mcc_arg_6; + imm_args.sbe = mcc_arg_7; + imm_args.smbc = mcc_arg_8; + imm_args.sm = mcc_arg_9; + imm_args.line = mcc_arg_10; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } } } + } } + { + nanos_region_dimension_t dimensions_0[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_data_access_t dependences[1] = { { (void *)sm, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } }; + ; + nanos_err_t err = nanos_wait_on(1, dependences); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + release_smbc(h, smbc); } -static void decode_super_mb_block(MBRecContext *d, H264Slice *s, SuperMBContext *smbc, H264Mb *mbs, int smb_x, int smb_y) +struct DecodedPicture { - MBRecState mrs; - for (int k = 0, i = smb_y; - i < smb_y + smbc->smb_height; - i++ , k++) + int16_t (*motion_val[2])[2]; + int16_t (*motion_val_base[2])[2]; + int8_t *ref_index[2]; + uint32_t *mb_type; + uint32_t *mb_type_base; + int8_t *intra4x4_pred_mode; + int8_t *non_zero_count; + uint8_t *data[3]; + int linesize[3]; + uint8_t *base[3]; + int cpn; + int poc; + int reference; + int key_frame; + int mmco_reset; +}; +struct nanos_lock_t; +typedef struct nanos_lock_t nanos_lock_t; +extern nanos_err_t nanos_set_lock(nanos_lock_t *lock); +enum mcc_enum_anon_7 +{ + NANOS_LOCK_FREE = 0, + NANOS_LOCK_BUSY = 1 +}; +typedef enum mcc_enum_anon_7 nanos_lock_state_t; +struct nanos_lock_t +{ + volatile nanos_lock_state_t state_; +}; +__attribute__((weak)) nanos_lock_t nanos_critical_lock_dpb = { NANOS_LOCK_FREE }; +DecodedPicture *get_dpb_entry(H264Context *h, H264Slice *s); +extern nanos_err_t nanos_unset_lock(nanos_lock_t *lock); +void release_dpb_entry(H264Context *h, DecodedPicture *pic, int mode); +static void decode_slice_mb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe) +{ + H264Slice *s = &(*sbe).slice; + for (int i = 0; i < 2; i++) { - init_mbrec_context(d, &mrs, s, i); - for (int j = smb_x - k; - j < smb_x - k + smbc->smb_width; - j++) - { - if (i < d->mb_height && j >= 0 && j < d->mb_width) + { + for (int j = 0; j < (*s).ref_count[i]; j++) + { { - h264_decode_mb_internal(d, &mrs, s, &mbs[i * d->mb_width + j]); - } - } - } -} -static void decode_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *m) -{ - H264Slice *s = &sbe->slice; - H264Mb *mbs = sbe->mbs; - decode_super_mb_block(d, s, smbc, mbs, m->smb_x, m->smb_y); -} -static void draw_edges_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *sm, int line) -{ - H264Slice *s = &sbe->slice; - for (int i = line * smbc->smb_height; - i < (line + 1) * smbc->smb_height && i < d->mb_height; - i++) - draw_edges(d, s, i); -} -typedef struct _nx_data_env_0_t_tag -{ - struct MBRecContext *__tmp_0_0; - SliceBufferEntry *__tmp_1_0; - struct SuperMBContext *__tmp_2_0; - struct SuperMBTask *__tmp_3_0; - struct SuperMBTask *__tmp_4_0; - struct SuperMBTask *__tmp_5_0; -} _nx_data_env_0_t; -static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe); -static void _smp__ol_decode_mb_in_slice_0(_nx_data_env_0_t *const __restrict__ _args) -{ - struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; - SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; - struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; - struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; - struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0; - struct SuperMBTask *___tmp_5_0 = _args->__tmp_5_0; - /* Translation is done by the runtime */ - { - decode_super_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0)); - } -} -typedef struct _nx_data_env_1_t_tag -{ - struct MBRecContext *__tmp_0_0; - SliceBufferEntry *__tmp_1_0; - struct SuperMBContext *__tmp_2_0; - struct SuperMBTask *__tmp_3_0; - int __tmp_4_0; -} _nx_data_env_1_t; -static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe); -static void _smp__ol_decode_mb_in_slice_1(_nx_data_env_1_t *const __restrict__ _args) -{ - struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; - SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; - struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; - struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; - int ___tmp_4_0 = _args->__tmp_4_0; - /* Translation is done by the runtime */ - { - draw_edges_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0)); - } -} -static void decode_mb_in_slice(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe) -{ - int i, j; - SuperMBContext *smbc = acquire_smbc(h); - int smb_height = smbc->nsmb_height, smb_width = smbc->nsmb_width; - SuperMBTask *smbs = smbc->smbs[0]; - SuperMBTask *sm = ((void *) 0), *sml, *smur; - for (j = 0; - j < smb_height; - j++) - { - for (i = 0; - i < smb_width; - i++) - { - sm = smbs + j * smb_width + i; - sml = sm - ((i > 0) ? 1 : 0); - smur = sm + (((i < smb_width - 1) && (j > 0)) ? - smb_width + 1 : 0); - { - struct MBRecContext *__tmp_0 = d; - SliceBufferEntry *__tmp_1 = sbe; - struct SuperMBContext *__tmp_2 = smbc; - struct SuperMBTask *__tmp_3 = sml; - struct SuperMBTask *__tmp_4 = smur; - struct SuperMBTask *__tmp_5 = sm; + int k; + if ((*s).ref_list_cpn[i][j] == -1) { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_decode_mb_in_slice_0_smp_args = {(void (*)(void *)) _smp__ol_decode_mb_in_slice_0}; - _nx_data_env_0_t *ol_args = (_nx_data_env_0_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { + continue; + } + for (k = 0; k < (*h).max_dpb_cnt; k++) + { + { + if ((*h).dpb[k].reference >= 2 && (*h).dpb[k].cpn == (*s).ref_list_cpn[i][j]) + { { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_0_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_decode_mb_in_slice_0_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_0_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - ol_args->__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[5] = { - { - (void **) &ol_args->__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - err = nanos_submit(wd, 5, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_0_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - imm_args.__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[5] = { - { - (void **) &imm_args.__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_0_t), &imm_args, 5, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - } - { - struct MBRecContext *__tmp_0 = d; - SliceBufferEntry *__tmp_1 = sbe; - struct SuperMBContext *__tmp_2 = smbc; - struct SuperMBTask *__tmp_3 = sm; - int __tmp_4 = j; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_decode_mb_in_slice_1_smp_args = {(void (*)(void *)) _smp__ol_decode_mb_in_slice_1}; - _nx_data_env_1_t *ol_args = (_nx_data_env_1_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_1_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_decode_mb_in_slice_1_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_1_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) + (*s).dp_ref_list[i][j] = &(*h).dpb[k]; + break; } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_1_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_1_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); + } + } } } - ; - } + } + } } + { + nanos_err_t err; + err = nanos_set_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + get_dpb_entry(h, s); + err = nanos_unset_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + if (!(*h).no_mbd) { - struct _dependence_holder - { - struct SuperMBTask *dep_0; - } _dep_holder = {&(*sm)}; - nanos_dependence_t _wait_dependences[1] = {{ - (void **) &_dep_holder.dep_0, - ((char *) ((sm)) - (char *) _dep_holder.dep_0), + { + decode_mb_in_slice(h, d, sbe); + } + } + for (int i = 0; i < (*s).release_cnt; i++) + { + { + for (int j = 0; j < (*h).max_dpb_cnt; j++) + { { - 1, - 0, - 0, - 0 - }, - sizeof (*sm) - }}; - nanos_wait_on(1, _wait_dependences); - } - release_smbc(h, smbc); -} -__attribute__((weak)) nanos_lock_t _nx_u_dpb_critical_lock = {NANOS_LOCK_FREE}; -static void decode_slice_mb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe) -{ - H264Slice *s = &sbe->slice; - for (int i = 0; - i < 2; - i++) - { - for (int j = 0; - j < s->ref_count[i]; - j++) - { - if (s->ref_list_cpn[i][j] == - 1) - continue; - int k; - for (k = 0; - k < h->max_dpb_cnt; - k++) - { - if (h->dpb[k].reference >= 2 && h->dpb[k].cpn == s->ref_list_cpn[i][j]) + if ((*h).dpb[j].cpn == (*s).release_ref_cpn[i]) { - s->dp_ref_list[i][j] = &h->dpb[k]; + { + { + nanos_err_t err; + err = nanos_set_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + release_dpb_entry(h, &(*h).dpb[j], 2); + err = nanos_unset_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } break; + } } } - } + } + } } - { - nanos_set_lock(&_nx_u_dpb_critical_lock); - get_dpb_entry(h, s); - nanos_unset_lock(&_nx_u_dpb_critical_lock); - } - if (!h->no_mbd) - { - decode_mb_in_slice(h, d, sbe); - } - for (int i = 0; - i < s->release_cnt; - i++) - { - for (int j = 0; - j < h->max_dpb_cnt; - j++) - { - if (h->dpb[j].cpn == s->release_ref_cpn[i]) - { - { - nanos_set_lock(&_nx_u_dpb_critical_lock); - release_dpb_entry(h, &h->dpb[j], 2); - nanos_unset_lock(&_nx_u_dpb_critical_lock); - } - break; - } - } - } - s->release_cnt = 0; + (*s).release_cnt = 0; } static void decode_3dwave_super_mb_task(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc, SuperMBTask *ml, SuperMBTask *mur, SuperMBTask *mprev, SuperMBTask *m) { - H264Slice *s = &sbe->slice; - H264Mb *mbs = sbe->mbs; - decode_super_mb_block(d, s, smbc, mbs, m->smb_x, m->smb_y); + H264Slice *s = &(*sbe).slice; + H264Mb *mbs = (*sbe).mbs; + decode_super_mb_block(d, s, smbc, mbs, (*m).smb_x, (*m).smb_y); } static void init_ref_list_and_get_dpb_task(H264Context *h, MBRecContext *d, SliceBufferEntry *sbe, int *init) { - H264Slice *s = &sbe->slice; - for (int i = 0; - i < 2; - i++) + H264Slice *s = &(*sbe).slice; + for (int i = 0; i < 2; i++) { - for (int j = 0; - j < s->ref_count[i]; - j++) - { - if (s->ref_list_cpn[i][j] == - 1) - continue; - int k; - for (k = 0; - k < h->max_dpb_cnt; - k++) + { + for (int j = 0; j < (*s).ref_count[i]; j++) + { { - if (h->dpb[k].reference >= 2 && h->dpb[k].cpn == s->ref_list_cpn[i][j]) + int k; + if ((*s).ref_list_cpn[i][j] == -1) { - s->dp_ref_list[i][j] = &h->dpb[k]; - break; + continue; + } + for (k = 0; k < (*h).max_dpb_cnt; k++) + { + { + if ((*h).dpb[k].reference >= 2 && (*h).dpb[k].cpn == (*s).ref_list_cpn[i][j]) + { + { + (*s).dp_ref_list[i][j] = &(*h).dpb[k]; + break; + } + } + } } } - } + } + } } - { - nanos_set_lock(&_nx_u_dpb_critical_lock); - get_dpb_entry(h, s); - nanos_unset_lock(&_nx_u_dpb_critical_lock); - } + { + nanos_err_t err; + err = nanos_set_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + get_dpb_entry(h, s); + err = nanos_unset_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } } -typedef struct _nx_data_env_2_t_tag +struct nanos_args_2_t { - struct MBRecContext *__tmp_0_0; - SliceBufferEntry *__tmp_1_0; - struct SuperMBContext *__tmp_2_0; - struct SuperMBTask *__tmp_3_0; - struct SuperMBTask *__tmp_4_0; - struct SuperMBTask *__tmp_5_0; - struct SuperMBTask *__tmp_6_0; -} _nx_data_env_2_t; -static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc); -static void _smp__ol_add_decode_slice_3dwave_tasks_2(_nx_data_env_2_t *const __restrict__ _args) + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBContext *smbc; + SuperMBTask *ml; + SuperMBTask *mur; + SuperMBTask *mprev; + SuperMBTask *m; +}; +static void smp_ol_decode_3dwave_super_mb_task_5(struct nanos_args_2_t *const args); +struct nanos_args_3_t { - struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; - SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; - struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; - struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; - struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0; - struct SuperMBTask *___tmp_5_0 = _args->__tmp_5_0; - struct SuperMBTask *___tmp_6_0 = _args->__tmp_6_0; - /* Translation is done by the runtime */ - { - decode_3dwave_super_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0), (___tmp_6_0)); - } -} -typedef struct _nx_data_env_3_t_tag + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBContext *smbc; + SuperMBTask *sm; + int line; +}; +static void smp_ol_draw_edges_task_7(struct nanos_args_3_t *const args); +struct nanos_args_4_t { - struct MBRecContext *__tmp_0_0; - SliceBufferEntry *__tmp_1_0; - struct SuperMBContext *__tmp_2_0; - struct SuperMBTask *__tmp_3_0; - int __tmp_4_0; -} _nx_data_env_3_t; -static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc); -static void _smp__ol_add_decode_slice_3dwave_tasks_3(_nx_data_env_3_t *const __restrict__ _args) + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBContext *smbc; + SuperMBTask *ml; + SuperMBTask *mur; + SuperMBTask *m; +}; +static void smp_ol_decode_super_mb_task_9(struct nanos_args_4_t *const args); +struct nanos_args_5_t { - struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; - SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; - struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; - struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; - int ___tmp_4_0 = _args->__tmp_4_0; - /* Translation is done by the runtime */ - { - draw_edges_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0)); - } -} -typedef struct _nx_data_env_4_t_tag -{ - struct MBRecContext *__tmp_0_0; - SliceBufferEntry *__tmp_1_0; - struct SuperMBContext *__tmp_2_0; - struct SuperMBTask *__tmp_3_0; - struct SuperMBTask *__tmp_4_0; - struct SuperMBTask *__tmp_5_0; -} _nx_data_env_4_t; -static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc); -static void _smp__ol_add_decode_slice_3dwave_tasks_4(_nx_data_env_4_t *const __restrict__ _args) -{ - struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; - SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; - struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; - struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; - struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0; - struct SuperMBTask *___tmp_5_0 = _args->__tmp_5_0; - /* Translation is done by the runtime */ - { - decode_super_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0)); - } -} -typedef struct _nx_data_env_5_t_tag -{ - struct MBRecContext *__tmp_0_0; - SliceBufferEntry *__tmp_1_0; - struct SuperMBContext *__tmp_2_0; - struct SuperMBTask *__tmp_3_0; - int __tmp_4_0; -} _nx_data_env_5_t; -static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc); -static void _smp__ol_add_decode_slice_3dwave_tasks_5(_nx_data_env_5_t *const __restrict__ _args) -{ - struct MBRecContext *___tmp_0_0 = _args->__tmp_0_0; - SliceBufferEntry *___tmp_1_0 = _args->__tmp_1_0; - struct SuperMBContext *___tmp_2_0 = _args->__tmp_2_0; - struct SuperMBTask *___tmp_3_0 = _args->__tmp_3_0; - int ___tmp_4_0 = _args->__tmp_4_0; - /* Translation is done by the runtime */ - { - draw_edges_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0)); - } -} + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBContext *smbc; + SuperMBTask *sm; + int line; +}; +static void smp_ol_draw_edges_task_11(struct nanos_args_5_t *const args); static SuperMBTask *add_decode_slice_3dwave_tasks(MBRecContext *d, SliceBufferEntry *sbe, SuperMBContext *smbc) { - int i, j; - int smb_3d_height = smbc->nsmb_3dheight; - int smb_height = smbc->nsmb_height, smb_width = smbc->nsmb_width; - int smb_diff_prev = smb_height - smb_3d_height; - SuperMBTask *sm = ((void *) 0), *sml, *smur, *smprev; - SuperMBTask *smbs = smbc->smbs[smbc->index++]; - smbc->index %= 2; - SuperMBTask *smbs_prev = smbc->smbs[smbc->index]; - for (j = 0; - j < smb_3d_height; - j++) + int j; + int i; + SuperMBTask *sml; + SuperMBTask *smur; + SuperMBTask *smprev; + int smb_3d_height = (*smbc).nsmb_3dheight; + int smb_height = (*smbc).nsmb_height; + int smb_width = (*smbc).nsmb_width; + int smb_diff_prev = smb_height - smb_3d_height; + SuperMBTask *sm = (void *)0; + SuperMBTask *smbs = (*smbc).smbs[(*smbc).index++]; + (*smbc).index %= 2; + SuperMBTask *smbs_prev = (*smbc).smbs[(*smbc).index]; + for (j = 0; j < smb_3d_height; j++) { - for (i = 0; - i < smb_width; - i++) + { + nanos_err_t mcc_err_in_final_3; + _Bool mcc_is_in_final_3; + for (i = 0; i < smb_width; i++) + { + { + nanos_err_t mcc_err_in_final_2; + _Bool mcc_is_in_final_2; + sm = smbs + j * smb_width + i; + sml = sm - (i > 0 ? 1 : 0); + smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0); + smprev = smbs_prev + (j + smb_diff_prev + 1) * smb_width - 1; + mcc_err_in_final_2 = nanos_in_final(&mcc_is_in_final_2); + { + MBRecContext *mcc_arg_11 = d; + SliceBufferEntry *mcc_arg_12 = sbe; + SuperMBContext *mcc_arg_13 = smbc; + SuperMBTask *mcc_arg_14 = sml; + SuperMBTask *mcc_arg_15 = smur; + SuperMBTask *mcc_arg_16 = smprev; + SuperMBTask *mcc_arg_17 = sm; + if (mcc_is_in_final_2) + { + decode_3dwave_super_mb_task(d, sbe, smbc, sml, smur, smprev, sm); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_2_t *ol_args; + nanos_err_t err; + struct nanos_args_2_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_2_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).d = mcc_arg_11; + (*ol_args).sbe = mcc_arg_12; + (*ol_args).smbc = mcc_arg_13; + (*ol_args).ml = mcc_arg_14; + (*ol_args).mur = mcc_arg_15; + (*ol_args).mprev = mcc_arg_16; + (*ol_args).m = mcc_arg_17; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_5[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 6, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.d = mcc_arg_11; + imm_args.sbe = mcc_arg_12; + imm_args.smbc = mcc_arg_13; + imm_args.ml = mcc_arg_14; + imm_args.mur = mcc_arg_15; + imm_args.mprev = mcc_arg_16; + imm_args.m = mcc_arg_17; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_5[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + } + } + mcc_err_in_final_3 = nanos_in_final(&mcc_is_in_final_3); { - sm = smbs + j * smb_width + i; - sml = sm - ((i > 0) ? 1 : 0); - smur = sm + (((i < smb_width - 1) && (j > 0)) ? - smb_width + 1 : 0); - smprev = smbs_prev + (j + smb_diff_prev + 1) * smb_width - 1; + MBRecContext *mcc_arg_18 = d; + SliceBufferEntry *mcc_arg_19 = sbe; + SuperMBContext *mcc_arg_20 = smbc; + SuperMBTask *mcc_arg_21 = sm; + int mcc_arg_22 = j; + if (mcc_is_in_final_3) { - struct MBRecContext *__tmp_0 = d; - SliceBufferEntry *__tmp_1 = sbe; - struct SuperMBContext *__tmp_2 = smbc; - struct SuperMBTask *__tmp_3 = sml; - struct SuperMBTask *__tmp_4 = smur; - struct SuperMBTask *__tmp_5 = smprev; - struct SuperMBTask *__tmp_6 = sm; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_2_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_2}; - _nx_data_env_2_t *ol_args = (_nx_data_env_2_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t + draw_edges_task(d, sbe, smbc, sm, j); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_3_t *ol_args; + nanos_err_t err; + struct nanos_args_3_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_3_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { + (*ol_args).d = mcc_arg_18; + (*ol_args).sbe = mcc_arg_19; + (*ol_args).smbc = mcc_arg_20; + (*ol_args).sm = mcc_arg_21; + (*ol_args).line = mcc_arg_22; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_2_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_add_decode_slice_3dwave_tasks_2_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_2_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) + nanos_handle_error(err); + } + } + } + else + { { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - ol_args->__tmp_5_0 = __tmp_5; - ol_args->__tmp_6_0 = __tmp_6; - nanos_dependence_t _dependences[6] = { - { - (void **) &ol_args->__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_6_0, - ((char *) ((__tmp_6)) - (char *) ol_args->__tmp_6_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - err = nanos_submit(wd, 6, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); + imm_args.d = mcc_arg_18; + imm_args.sbe = mcc_arg_19; + imm_args.smbc = mcc_arg_20; + imm_args.sm = mcc_arg_21; + imm_args.line = mcc_arg_22; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } } - else - { - _nx_data_env_2_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - imm_args.__tmp_5_0 = __tmp_5; - imm_args.__tmp_6_0 = __tmp_6; - nanos_dependence_t _dependences[6] = { - { - (void **) &imm_args.__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_6_0, - ((char *) ((__tmp_6)) - (char *) imm_args.__tmp_6_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_2_t), &imm_args, 6, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; + } + } } } + } + } + for (; j < smb_height; j++) + { + { + nanos_err_t mcc_err_in_final_5; + _Bool mcc_is_in_final_5; + for (i = 0; i < smb_width; i++) + { + { + nanos_err_t mcc_err_in_final_4; + _Bool mcc_is_in_final_4; + sm = smbs + j * smb_width + i; + sml = sm - (i > 0 ? 1 : 0); + smur = sm + (i < smb_width - 1 && j > 0 ? -smb_width + 1 : 0); + mcc_err_in_final_4 = nanos_in_final(&mcc_is_in_final_4); + { + MBRecContext *mcc_arg_23 = d; + SliceBufferEntry *mcc_arg_24 = sbe; + SuperMBContext *mcc_arg_25 = smbc; + SuperMBTask *mcc_arg_26 = sml; + SuperMBTask *mcc_arg_27 = smur; + SuperMBTask *mcc_arg_28 = sm; + if (mcc_is_in_final_4) + { + decode_super_mb_task(d, sbe, smbc, sml, smur, sm); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_4_t *ol_args; + nanos_err_t err; + struct nanos_args_4_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_4_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).d = mcc_arg_23; + (*ol_args).sbe = mcc_arg_24; + (*ol_args).smbc = mcc_arg_25; + (*ol_args).ml = mcc_arg_26; + (*ol_args).mur = mcc_arg_27; + (*ol_args).m = mcc_arg_28; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 5, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.d = mcc_arg_23; + imm_args.sbe = mcc_arg_24; + imm_args.smbc = mcc_arg_25; + imm_args.ml = mcc_arg_26; + imm_args.mur = mcc_arg_27; + imm_args.m = mcc_arg_28; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_4[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + } + } + mcc_err_in_final_5 = nanos_in_final(&mcc_is_in_final_5); { - struct MBRecContext *__tmp_0 = d; - SliceBufferEntry *__tmp_1 = sbe; - struct SuperMBContext *__tmp_2 = smbc; - struct SuperMBTask *__tmp_3 = sm; - int __tmp_4 = j; + MBRecContext *mcc_arg_29 = d; + SliceBufferEntry *mcc_arg_30 = sbe; + SuperMBContext *mcc_arg_31 = smbc; + SuperMBTask *mcc_arg_32 = sm; + int mcc_arg_33 = j; + if (mcc_is_in_final_5) { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_3_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_3}; - _nx_data_env_3_t *ol_args = (_nx_data_env_3_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { + draw_edges_task(d, sbe, smbc, sm, j); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_5_t *ol_args; + nanos_err_t err; + struct nanos_args_5_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_5_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { { + (*ol_args).d = mcc_arg_29; + (*ol_args).sbe = mcc_arg_30; + (*ol_args).smbc = mcc_arg_31; + (*ol_args).sm = mcc_arg_32; + (*ol_args).line = mcc_arg_33; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_3_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_add_decode_slice_3dwave_tasks_3_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_3_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - nanos_dependence_t _dependences[3] = { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.d = mcc_arg_29; + imm_args.sbe = mcc_arg_30; + imm_args.smbc = mcc_arg_31; + imm_args.sm = mcc_arg_32; + imm_args.line = mcc_arg_33; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) { - (void **) &ol_args->__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) + nanos_handle_error(err); } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_3_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_3_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - } - for (; - j < smb_height; - j++) - { - for (i = 0; - i < smb_width; - i++) - { - sm = smbs + j * smb_width + i; - sml = sm - ((i > 0) ? 1 : 0); - smur = sm + (((i < smb_width - 1) && (j > 0)) ? - smb_width + 1 : 0); - { - struct MBRecContext *__tmp_0 = d; - SliceBufferEntry *__tmp_1 = sbe; - struct SuperMBContext *__tmp_2 = smbc; - struct SuperMBTask *__tmp_3 = sml; - struct SuperMBTask *__tmp_4 = smur; - struct SuperMBTask *__tmp_5 = sm; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_4_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_4}; - _nx_data_env_4_t *ol_args = (_nx_data_env_4_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_4_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_add_decode_slice_3dwave_tasks_4_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_4_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - ol_args->__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[5] = { - { - (void **) &ol_args->__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - err = nanos_submit(wd, 5, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); } - else - { - _nx_data_env_4_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - imm_args.__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[5] = { - { - (void **) &imm_args.__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_4_t), &imm_args, 5, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; + } + } } } - { - struct MBRecContext *__tmp_0 = d; - SliceBufferEntry *__tmp_1 = sbe; - struct SuperMBContext *__tmp_2 = smbc; - struct SuperMBTask *__tmp_3 = sm; - int __tmp_4 = j; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_add_decode_slice_3dwave_tasks_5_smp_args = {(void (*)(void *)) _smp__ol_add_decode_slice_3dwave_tasks_5}; - _nx_data_env_5_t *ol_args = (_nx_data_env_5_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_5_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_add_decode_slice_3dwave_tasks_5_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_5_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) ol_args->__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_5_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_0_0, - ((char *) ((__tmp_0)) - (char *) imm_args.__tmp_0_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct SuperMBTask) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_5_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } + } } - return sm; + return sm; } static void release_ref_list_task(H264Context *h, SuperMBContext *smbc, MBRecContext *d, SliceBufferEntry *sbe, SuperMBTask *lastsmb, int *release) { - H264Slice *s = &sbe->slice; - for (int i = 0; - i < s->release_cnt; - i++) + H264Slice *s = &(*sbe).slice; + for (int i = 0; i < (*s).release_cnt; i++) { - for (int j = 0; - j < h->max_dpb_cnt; - j++) + { + for (int j = 0; j < (*h).max_dpb_cnt; j++) + { + { + if ((*h).dpb[j].cpn == (*s).release_ref_cpn[i]) + { + { + { + nanos_err_t err; + err = nanos_set_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + release_dpb_entry(h, &(*h).dpb[j], 2); + err = nanos_unset_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + break; + } + } + } + } + } + } + (*s).release_cnt = 0; + release_smbc(h, smbc); +} +struct OutputContext; +typedef struct OutputContext OutputContext; +DecodedPicture *output_frame(H264Context *h, OutputContext *oc, DecodedPicture *pic, int fd, int frame_width, int frame_height); +static void output_task(H264Context *h, OutputContext *oc, SliceBufferEntry *sbe) +{ + DecodedPicture *out = output_frame(h, oc, (*sbe).slice.curr_pic, (*h).ofile, (*h).frame_width, (*h).frame_height); + if (out) + { + { { - if (h->dpb[j].cpn == s->release_ref_cpn[i]) + nanos_err_t err; + err = nanos_set_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) { - { - nanos_set_lock(&_nx_u_dpb_critical_lock); - release_dpb_entry(h, &h->dpb[j], 2); - nanos_unset_lock(&_nx_u_dpb_critical_lock); - } - break; + nanos_handle_error(err); + } + release_dpb_entry(h, out, 1); + err = nanos_unset_lock(&nanos_critical_lock_dpb); + if (err != NANOS_OK) + { + nanos_handle_error(err); } } - } - s->release_cnt = 0; - release_smbc(h, smbc); -} -static void output_task(H264Context *h, OutputContext *oc, SliceBufferEntry *sbe) -{ - DecodedPicture *out = output_frame(h, oc, sbe->slice.curr_pic, h->ofile, h->frame_width, h->frame_height); - if (out) - { - { - nanos_set_lock(&_nx_u_dpb_critical_lock); - release_dpb_entry(h, out, 1); - nanos_unset_lock(&_nx_u_dpb_critical_lock); - } + } } } -typedef struct _nx_data_env_6_t_tag +void *av_mallocz(unsigned int size)__attribute__((__malloc__)); +ParserContext *get_parse_context(int ifile); +NalContext *get_nal_context(int width, int height); +EntropyContext *get_entropy_context(H264Context *h); +MBRecContext *get_mbrec_context(H264Context *h); +OutputContext *get_output_context(H264Context *h); +void av_start_timer(); +struct ParserContext { - struct H264Context *__tmp_0_0; - struct ParserContext *__tmp_1_0; - struct NalContext *__tmp_2_0; - SliceBufferEntry *__tmp_3_0; -} _nx_data_env_6_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_6(_nx_data_env_6_t *const __restrict__ _args) + int ifile; + int ofile; + int buffer_size; + int eof_reached; + uint8_t *data; + int size; + uint8_t *cur_ptr; + int cur_len; + int64_t frame_offset; + int64_t cur_offset; + int64_t next_frame_offset; + int pict_type; + int repeat_pict; + int key_frame; + int64_t pos; + int64_t last_pos; + int final_frame; + uint8_t overread[5]; + int overread_cnt; + int index; + int last_index; + int frame_start_found; + uint32_t state; +}; +struct nanos_args_6_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct ParserContext *___tmp_1_0 = _args->__tmp_1_0; - struct NalContext *___tmp_2_0 = _args->__tmp_2_0; - SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0; - /* Translation is done by the runtime */ - { - parse_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0)); - } -} -typedef struct _nx_data_env_7_t_tag + H264Context *h; + ParserContext *pc; + NalContext *nc; + SliceBufferEntry *sbe; +}; +static void smp_ol_parse_task_13(struct nanos_args_6_t *const args); +struct SPS; +typedef struct SPS SPS; +enum AVColorPrimaries { - struct H264Context *__tmp_0_0; - struct EntropyContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_7_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_7(_nx_data_env_7_t *const __restrict__ _args) + AVCOL_PRI_BT709 = 1, + AVCOL_PRI_UNSPECIFIED = 2, + AVCOL_PRI_BT470M = 4, + AVCOL_PRI_BT470BG = 5, + AVCOL_PRI_SMPTE170M = 6, + AVCOL_PRI_SMPTE240M = 7, + AVCOL_PRI_FILM = 8, + AVCOL_PRI_NB = 9 +}; +enum AVColorTransferCharacteristic { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct EntropyContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - decode_slice_entropy_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} -typedef struct _nx_data_env_8_t_tag + AVCOL_TRC_BT709 = 1, + AVCOL_TRC_UNSPECIFIED = 2, + AVCOL_TRC_GAMMA22 = 4, + AVCOL_TRC_GAMMA28 = 5, + AVCOL_TRC_NB = 6 +}; +enum AVColorSpace { - struct H264Context *__tmp_0_0; - struct ParserContext *__tmp_1_0; - struct NalContext *__tmp_2_0; - SliceBufferEntry *__tmp_3_0; -} _nx_data_env_8_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_8(_nx_data_env_8_t *const __restrict__ _args) + AVCOL_SPC_RGB = 0, + AVCOL_SPC_BT709 = 1, + AVCOL_SPC_UNSPECIFIED = 2, + AVCOL_SPC_FCC = 4, + AVCOL_SPC_BT470BG = 5, + AVCOL_SPC_SMPTE170M = 6, + AVCOL_SPC_SMPTE240M = 7, + AVCOL_SPC_NB = 8 +}; +struct SPS { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct ParserContext *___tmp_1_0 = _args->__tmp_1_0; - struct NalContext *___tmp_2_0 = _args->__tmp_2_0; - SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0; - /* Translation is done by the runtime */ - { - parse_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0)); - } -} -typedef struct _nx_data_env_9_t_tag + int profile_idc; + int level_idc; + int chroma_format_idc; + int transform_bypass; + int log2_max_frame_num; + int poc_type; + int log2_max_poc_lsb; + int delta_pic_order_always_zero_flag; + int offset_for_non_ref_pic; + int offset_for_top_to_bottom_field; + int poc_cycle_length; + int ref_frame_count; + int gaps_in_frame_num_allowed_flag; + int mb_width; + int mb_height; + int frame_mbs_only_flag; + int mb_aff; + int direct_8x8_inference_flag; + int crop; + unsigned int crop_left; + unsigned int crop_right; + unsigned int crop_top; + unsigned int crop_bottom; + int vui_parameters_present_flag; + int num; + int den; + int video_signal_type_present_flag; + int full_range; + int colour_description_present_flag; + enum AVColorPrimaries color_primaries; + enum AVColorTransferCharacteristic color_trc; + enum AVColorSpace colorspace; + int timing_info_present_flag; + uint32_t num_units_in_tick; + uint32_t time_scale; + int fixed_frame_rate_flag; + short int offset_for_ref_frame[256]; + int bitstream_restriction_flag; + int num_reorder_frames; + int scaling_matrix_present; + uint8_t scaling_matrix4[6][16]; + uint8_t scaling_matrix8[2][64]; + int nal_hrd_parameters_present_flag; + int vcl_hrd_parameters_present_flag; + int pic_struct_present_flag; + int time_offset_length; + int cpb_cnt; + int initial_cpb_removal_delay_length; + int cpb_removal_delay_length; + int dpb_output_delay_length; + int bit_depth_luma; + int bit_depth_chroma; + int residual_color_transform_flag; +}; +struct PictureInfo { - struct H264Context *__tmp_0_0; - struct EntropyContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_9_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_9(_nx_data_env_9_t *const __restrict__ _args) + int ref_poc[2][16]; + int ref_count[2]; + int poc; + int frame_num; + int pic_id; + int long_ref; + int cpn; + int slice_type_nos; + int reference; +}; +enum mcc_enum_anon_20 { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct EntropyContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - decode_slice_entropy_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} -typedef struct _nx_data_env_10_t_tag + SEI_PIC_STRUCT_FRAME = 0, + SEI_PIC_STRUCT_TOP_FIELD = 1, + SEI_PIC_STRUCT_BOTTOM_FIELD = 2, + SEI_PIC_STRUCT_TOP_BOTTOM = 3, + SEI_PIC_STRUCT_BOTTOM_TOP = 4, + SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, + SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, + SEI_PIC_STRUCT_FRAME_DOUBLING = 7, + SEI_PIC_STRUCT_FRAME_TRIPLING = 8 +}; +typedef enum mcc_enum_anon_20 SEI_PicStructType; +struct NalContext { - struct H264Context *__tmp_0_0; - struct MBRecContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; - int *__tmp_3_0; -} _nx_data_env_10_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_10(_nx_data_env_10_t *const __restrict__ _args) + SPS *sps_buffers[32]; + PPS *pps_buffers[256]; + SPS sps; + PictureInfo picture[17]; + PictureInfo *release_ref[66]; + PictureInfo *short_ref[32]; + PictureInfo *long_ref[32]; + int long_ref_count; + int short_ref_count; + uint32_t coded_pic_num; + int poc_lsb; + int poc_msb; + uint32_t poc_offset; + int delta_poc; + int frame_num; + int prev_poc_msb; + int prev_poc_lsb; + int frame_num_offset; + int prev_frame_num_offset; + int prev_frame_num; + int max_pic_num; + int redundant_pic_count; + int outputed_poc; + int ip_id; + int b4_stride; + int mb_stride; + int mb_width; + int mb_height; + int width; + int height; + int has_b_frames; + SEI_PicStructType sei_pic_struct; + int sei_ct_type; + int sei_dpb_output_delay; + int sei_cpb_removal_delay; + int sei_recovery_frame_cnt; + int sei_buffering_period_present; + int initial_cpb_removal_delay[32]; +}; +struct nanos_args_7_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct MBRecContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - int *___tmp_3_0 = _args->__tmp_3_0; - /* Translation is done by the runtime */ - { - init_ref_list_and_get_dpb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0)); - } -} -typedef struct _nx_data_env_11_t_tag + H264Context *h; + EntropyContext *ec; + SliceBufferEntry *sbe; +}; +static void smp_ol_decode_slice_entropy_task_15(struct nanos_args_7_t *const args); +struct nanos_args_8_t { - struct H264Context *__tmp_0_0; - struct SuperMBContext *__tmp_1_0; - struct MBRecContext *__tmp_2_0; - SliceBufferEntry *__tmp_3_0; - struct SuperMBTask *__tmp_4_0; - int *__tmp_5_0; -} _nx_data_env_11_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_11(_nx_data_env_11_t *const __restrict__ _args) + H264Context *h; + ParserContext *pc; + NalContext *nc; + SliceBufferEntry *sbe; +}; +static void smp_ol_parse_task_17(struct nanos_args_8_t *const args); +struct nanos_args_9_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct SuperMBContext *___tmp_1_0 = _args->__tmp_1_0; - struct MBRecContext *___tmp_2_0 = _args->__tmp_2_0; - SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0; - struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0; - int *___tmp_5_0 = _args->__tmp_5_0; - /* Translation is done by the runtime */ - { - release_ref_list_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0)); - } -} -typedef struct _nx_data_env_12_t_tag + H264Context *h; + EntropyContext *ec; + SliceBufferEntry *sbe; +}; +static void smp_ol_decode_slice_entropy_task_19(struct nanos_args_9_t *const args); +struct nanos_args_10_t { - struct H264Context *__tmp_0_0; - struct OutputContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_12_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_12(_nx_data_env_12_t *const __restrict__ _args) + H264Context *h; + MBRecContext *d; + SliceBufferEntry *sbe; + int *init; +}; +static void smp_ol_init_ref_list_and_get_dpb_task_21(struct nanos_args_10_t *const args); +struct nanos_args_11_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct OutputContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - output_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} -typedef struct _nx_data_env_13_t_tag + H264Context *h; + SuperMBContext *smbc; + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBTask *lastsmb; + int *release; +}; +static void smp_ol_release_ref_list_task_23(struct nanos_args_11_t *const args); +struct nanos_args_12_t { - struct H264Context *__tmp_0_0; - struct MBRecContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; - int *__tmp_3_0; -} _nx_data_env_13_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_13(_nx_data_env_13_t *const __restrict__ _args) + H264Context *h; + OutputContext *oc; + SliceBufferEntry *sbe; +}; +static void smp_ol_output_task_25(struct nanos_args_12_t *const args); +struct OutputContext { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct MBRecContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - int *___tmp_3_0 = _args->__tmp_3_0; - /* Translation is done by the runtime */ - { - init_ref_list_and_get_dpb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0)); - } -} -typedef struct _nx_data_env_14_t_tag + int bit_buffer_size; + uint8_t *bit_buffer; + uint64_t video_size; + int frame_number; + DecodedPicture *delayed_pic[33]; + int dp_cnt; +}; +struct nanos_args_13_t { - struct H264Context *__tmp_0_0; - struct SuperMBContext *__tmp_1_0; - struct MBRecContext *__tmp_2_0; - SliceBufferEntry *__tmp_3_0; - struct SuperMBTask *__tmp_4_0; - int *__tmp_5_0; -} _nx_data_env_14_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_14(_nx_data_env_14_t *const __restrict__ _args) + H264Context *h; + MBRecContext *d; + SliceBufferEntry *sbe; + int *init; +}; +static void smp_ol_init_ref_list_and_get_dpb_task_27(struct nanos_args_13_t *const args); +struct nanos_args_14_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct SuperMBContext *___tmp_1_0 = _args->__tmp_1_0; - struct MBRecContext *___tmp_2_0 = _args->__tmp_2_0; - SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0; - struct SuperMBTask *___tmp_4_0 = _args->__tmp_4_0; - int *___tmp_5_0 = _args->__tmp_5_0; - /* Translation is done by the runtime */ - { - release_ref_list_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0), (___tmp_4_0), (___tmp_5_0)); - } -} -typedef struct _nx_data_env_15_t_tag + H264Context *h; + SuperMBContext *smbc; + MBRecContext *d; + SliceBufferEntry *sbe; + SuperMBTask *lastsmb; + int *release; +}; +static void smp_ol_release_ref_list_task_29(struct nanos_args_14_t *const args); +struct nanos_args_15_t { - struct H264Context *__tmp_0_0; - struct OutputContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_15_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_15(_nx_data_env_15_t *const __restrict__ _args) + H264Context *h; + OutputContext *oc; + SliceBufferEntry *sbe; +}; +static void smp_ol_output_task_31(struct nanos_args_15_t *const args); +struct nanos_args_16_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct OutputContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - output_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} -typedef struct _nx_data_env_16_t_tag + H264Context *h; + ParserContext *pc; + NalContext *nc; + SliceBufferEntry *sbe; +}; +static void smp_ol_parse_task_33(struct nanos_args_16_t *const args); +struct nanos_args_17_t { - struct H264Context *__tmp_0_0; - struct ParserContext *__tmp_1_0; - struct NalContext *__tmp_2_0; - SliceBufferEntry *__tmp_3_0; -} _nx_data_env_16_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_16(_nx_data_env_16_t *const __restrict__ _args) + H264Context *h; + EntropyContext *ec; + SliceBufferEntry *sbe; +}; +static void smp_ol_decode_slice_entropy_task_35(struct nanos_args_17_t *const args); +struct nanos_args_18_t { - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct ParserContext *___tmp_1_0 = _args->__tmp_1_0; - struct NalContext *___tmp_2_0 = _args->__tmp_2_0; - SliceBufferEntry *___tmp_3_0 = _args->__tmp_3_0; - /* Translation is done by the runtime */ - { - parse_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0), (___tmp_3_0)); - } -} -typedef struct _nx_data_env_17_t_tag + H264Context *h; + MBRecContext *d; + SliceBufferEntry *sbe; +}; +static void smp_ol_decode_slice_mb_task_37(struct nanos_args_18_t *const args); +struct nanos_args_19_t { - struct H264Context *__tmp_0_0; - struct EntropyContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_17_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_17(_nx_data_env_17_t *const __restrict__ _args) -{ - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct EntropyContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - decode_slice_entropy_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} -typedef struct _nx_data_env_18_t_tag -{ - struct H264Context *__tmp_0_0; - struct MBRecContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_18_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_18(_nx_data_env_18_t *const __restrict__ _args) -{ - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct MBRecContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - decode_slice_mb_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} -typedef struct _nx_data_env_19_t_tag -{ - struct H264Context *__tmp_0_0; - struct OutputContext *__tmp_1_0; - SliceBufferEntry *__tmp_2_0; -} _nx_data_env_19_t; -int h264_decode_ompss(H264Context *h); -static void _smp__ol_h264_decode_ompss_19(_nx_data_env_19_t *const __restrict__ _args) -{ - struct H264Context *___tmp_0_0 = _args->__tmp_0_0; - struct OutputContext *___tmp_1_0 = _args->__tmp_1_0; - SliceBufferEntry *___tmp_2_0 = _args->__tmp_2_0; - /* Translation is done by the runtime */ - { - output_task((___tmp_0_0), (___tmp_1_0), (___tmp_2_0)); - } -} + H264Context *h; + OutputContext *oc; + SliceBufferEntry *sbe; +}; +static void smp_ol_output_task_39(struct nanos_args_19_t *const args); +extern nanos_err_t nanos_wg_wait_completion(void *wg, _Bool avoid_flush); +void free_parse_context(ParserContext *pc); +void free_nal_context(NalContext *nc); +void free_output_context(OutputContext *oc); +void free_sb_entry(SliceBufferEntry *sb); +void free_entropy_context(EntropyContext *ec); +void av_free(void *ptr); +void free_mbrec_context(MBRecContext *d); int h264_decode_ompss(H264Context *h) { - const int bufs = h->pipe_bufs; - ParserContext *pc; - NalContext *nc; - EntropyContext *ec[bufs]; - MBRecContext *rc[2]; - OutputContext *oc; - SliceBufferEntry *sbe; - SuperMBContext *smbc; - DecodedPicture *out; - int frames = 0; - sbe = av_mallocz(sizeof(SliceBufferEntry) * bufs); - pc = get_parse_context(h->ifile); - nc = get_nal_context(h->width, h->height); - for (int i = 0; - i < bufs; - i++) + SliceBufferEntry *sbe; + ParserContext *pc; + NalContext *nc; + MBRecContext *rc[2]; + OutputContext *oc; + int init; + SuperMBContext *smbc; + int release; + DecodedPicture *out; + const int bufs = (*h).pipe_bufs; + EntropyContext *ec[bufs]; + int frames = 0; + sbe = av_mallocz(sizeof(SliceBufferEntry) * bufs); + pc = get_parse_context((*h).ifile); + nc = get_nal_context((*h).width, (*h).height); + for (int i = 0; i < bufs; i++) { + { ec[i] = get_entropy_context(h); + } } - for (int i = 0; - i < 2; - i++) + for (int i = 0; i < 2; i++) { + { rc[i] = get_mbrec_context(h); + } } - oc = get_output_context(h); - av_start_timer(); - int k = 0; - int init, release; - if (h->static_3d && bufs < h->num_frames) + oc = get_output_context(h); + av_start_timer(); + int k = 0; + if ((*h).static_3d && bufs < (*h).num_frames) { + { int num_pre_ed = 0; - for (num_pre_ed = 0; - num_pre_ed < bufs - 1 && !pc->final_frame; - num_pre_ed++) - { + for (num_pre_ed = 0; num_pre_ed < bufs - 1 && !(*pc).final_frame; num_pre_ed++) + { { - struct H264Context *__tmp_0 = h; - struct ParserContext *__tmp_1 = pc; - struct NalContext *__tmp_2 = nc; - SliceBufferEntry *__tmp_3 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_6_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_6}; - _nx_data_env_6_t *ol_args = (_nx_data_env_6_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t + nanos_err_t mcc_err_in_final_6; + _Bool mcc_is_in_final_6; + nanos_err_t mcc_err_in_final_7; + _Bool mcc_is_in_final_7; + mcc_err_in_final_6 = nanos_in_final(&mcc_is_in_final_6); + { + H264Context *mcc_arg_34 = h; + ParserContext *mcc_arg_35 = pc; + NalContext *mcc_arg_36 = nc; + SliceBufferEntry *mcc_arg_37 = &sbe[k % bufs]; + if (mcc_is_in_final_6) + { + parse_task(h, pc, nc, &sbe[k % bufs]); + } + else + { { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_6_t *ol_args; + nanos_err_t err; + struct nanos_args_6_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_6_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_6_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_6_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_6_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_34; + (*ol_args).pc = mcc_arg_35; + (*ol_args).nc = mcc_arg_36; + (*ol_args).sbe = mcc_arg_37; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_34; + imm_args.pc = mcc_arg_35; + imm_args.nc = mcc_arg_36; + imm_args.sbe = mcc_arg_37; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + mcc_err_in_final_7 = nanos_in_final(&mcc_is_in_final_7); + { + H264Context *mcc_arg_38 = h; + EntropyContext *mcc_arg_39 = ec[k % bufs]; + SliceBufferEntry *mcc_arg_40 = &sbe[k % bufs]; + if (mcc_is_in_final_7) + { + decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]); + } + else + { { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 0, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct ParserContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct NalContext) - } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_7_t *ol_args; + nanos_err_t err; + struct nanos_args_7_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_7_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_38; + (*ol_args).ec = mcc_arg_39; + (*ol_args).sbe = mcc_arg_40; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_38; + imm_args.ec = mcc_arg_39; + imm_args.sbe = mcc_arg_40; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } } - else + } + } + { + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_data_access_t dependences[1] = { { (void *)pc, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } }; + ; + nanos_err_t err = nanos_wait_on(1, dependences); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + k++; + } + } + while ((!(*pc).final_frame && frames++ < (*h).num_frames) && !(*h).quit) + { + { + nanos_err_t mcc_err_in_final_8; + _Bool mcc_is_in_final_8; + nanos_err_t mcc_err_in_final_9; + _Bool mcc_is_in_final_9; + nanos_err_t mcc_err_in_final_10; + _Bool mcc_is_in_final_10; + nanos_err_t mcc_err_in_final_11; + _Bool mcc_is_in_final_11; + nanos_err_t mcc_err_in_final_12; + _Bool mcc_is_in_final_12; + mcc_err_in_final_8 = nanos_in_final(&mcc_is_in_final_8); + { + H264Context *mcc_arg_41 = h; + ParserContext *mcc_arg_42 = pc; + NalContext *mcc_arg_43 = nc; + SliceBufferEntry *mcc_arg_44 = &sbe[k % bufs]; + if (mcc_is_in_final_8) + { + parse_task(h, pc, nc, &sbe[k % bufs]); + } + else + { { - _nx_data_env_6_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 0, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct ParserContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct NalContext) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_6_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_8_t *ol_args; + nanos_err_t err; + struct nanos_args_8_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_8_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_41; + (*ol_args).pc = mcc_arg_42; + (*ol_args).nc = mcc_arg_43; + (*ol_args).sbe = mcc_arg_44; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_41; + imm_args.pc = mcc_arg_42; + imm_args.nc = mcc_arg_43; + imm_args.sbe = mcc_arg_44; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } } - } + } + } + mcc_err_in_final_9 = nanos_in_final(&mcc_is_in_final_9); + { + H264Context *mcc_arg_45 = h; + EntropyContext *mcc_arg_46 = ec[k % bufs]; + SliceBufferEntry *mcc_arg_47 = &sbe[k % bufs]; + if (mcc_is_in_final_9) + { + decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_9_t *ol_args; + nanos_err_t err; + struct nanos_args_9_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_9_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_45; + (*ol_args).ec = mcc_arg_46; + (*ol_args).sbe = mcc_arg_47; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_45; + imm_args.ec = mcc_arg_46; + imm_args.sbe = mcc_arg_47; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + k++; + mcc_err_in_final_10 = nanos_in_final(&mcc_is_in_final_10); + { + H264Context *mcc_arg_48 = h; + MBRecContext *mcc_arg_49 = rc[k % 2]; + SliceBufferEntry *mcc_arg_50 = &sbe[k % bufs]; + int *mcc_arg_51 = &init; + if (mcc_is_in_final_10) + { + init_ref_list_and_get_dpb_task(h, rc[k % 2], &sbe[k % bufs], &init); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_10_t *ol_args; + nanos_err_t err; + struct nanos_args_10_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_10_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_48; + (*ol_args).d = mcc_arg_49; + (*ol_args).sbe = mcc_arg_50; + (*ol_args).init = mcc_arg_51; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_48; + imm_args.d = mcc_arg_49; + imm_args.sbe = mcc_arg_50; + imm_args.init = mcc_arg_51; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + smbc = acquire_smbc(h); + SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc); + mcc_err_in_final_11 = nanos_in_final(&mcc_is_in_final_11); + { + H264Context *mcc_arg_52 = h; + SuperMBContext *mcc_arg_53 = smbc; + MBRecContext *mcc_arg_54 = rc[k % 2]; + SliceBufferEntry *mcc_arg_55 = &sbe[k % bufs]; + SuperMBTask *mcc_arg_56 = lastsmb; + int *mcc_arg_57 = &release; + if (mcc_is_in_final_11) + { + release_ref_list_task(h, smbc, rc[k % 2], &sbe[k % bufs], lastsmb, &release); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_11_t *ol_args; + nanos_err_t err; + struct nanos_args_11_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_11_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_52; + (*ol_args).smbc = mcc_arg_53; + (*ol_args).d = mcc_arg_54; + (*ol_args).sbe = mcc_arg_55; + (*ol_args).lastsmb = mcc_arg_56; + (*ol_args).release = mcc_arg_57; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 4, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_52; + imm_args.smbc = mcc_arg_53; + imm_args.d = mcc_arg_54; + imm_args.sbe = mcc_arg_55; + imm_args.lastsmb = mcc_arg_56; + imm_args.release = mcc_arg_57; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + mcc_err_in_final_12 = nanos_in_final(&mcc_is_in_final_12); + { + H264Context *mcc_arg_58 = h; + OutputContext *mcc_arg_59 = oc; + SliceBufferEntry *mcc_arg_60 = &sbe[k % bufs]; + if (mcc_is_in_final_12) + { + output_task(h, oc, &sbe[k % bufs]); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_12_t *ol_args; + nanos_err_t err; + struct nanos_args_12_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_12_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_58; + (*ol_args).oc = mcc_arg_59; + (*ol_args).sbe = mcc_arg_60; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_58; + imm_args.oc = mcc_arg_59; + imm_args.sbe = mcc_arg_60; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + { + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_data_access_t dependences[1] = { { (void *)pc, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } }; ; + nanos_err_t err = nanos_wait_on(1, dependences); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } } + } + for (int i = 0; i < num_pre_ed; i++) + { { - struct H264Context *__tmp_0 = h; - struct EntropyContext *__tmp_1 = ec[k % bufs]; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_7_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_7}; - _nx_data_env_7_t *ol_args = (_nx_data_env_7_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t + nanos_err_t mcc_err_in_final_13; + _Bool mcc_is_in_final_13; + nanos_err_t mcc_err_in_final_14; + _Bool mcc_is_in_final_14; + nanos_err_t mcc_err_in_final_15; + _Bool mcc_is_in_final_15; + k++; + mcc_err_in_final_13 = nanos_in_final(&mcc_is_in_final_13); + { + H264Context *mcc_arg_61 = h; + MBRecContext *mcc_arg_62 = rc[k % 2]; + SliceBufferEntry *mcc_arg_63 = &sbe[k % bufs]; + int *mcc_arg_64 = &init; + if (mcc_is_in_final_13) + { + init_ref_list_and_get_dpb_task(h, rc[k % 2], &sbe[k % bufs], &init); + } + else + { { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_13_t *ol_args; + nanos_err_t err; + struct nanos_args_13_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_13_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_7_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_7_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_7_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_61; + (*ol_args).d = mcc_arg_62; + (*ol_args).sbe = mcc_arg_63; + (*ol_args).init = mcc_arg_64; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_61; + imm_args.d = mcc_arg_62; + imm_args.sbe = mcc_arg_63; + imm_args.init = mcc_arg_64; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + smbc = acquire_smbc(h); + SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc); + mcc_err_in_final_14 = nanos_in_final(&mcc_is_in_final_14); + { + H264Context *mcc_arg_65 = h; + SuperMBContext *mcc_arg_66 = smbc; + MBRecContext *mcc_arg_67 = rc[k % 2]; + SliceBufferEntry *mcc_arg_68 = &sbe[k % bufs]; + SuperMBTask *mcc_arg_69 = lastsmb; + int *mcc_arg_70 = &release; + if (mcc_is_in_final_14) + { + release_ref_list_task(h, smbc, rc[k % 2], &sbe[k % bufs], lastsmb, &release); + } + else + { { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct EntropyContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_14_t *ol_args; + nanos_err_t err; + struct nanos_args_14_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_14_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_65; + (*ol_args).smbc = mcc_arg_66; + (*ol_args).d = mcc_arg_67; + (*ol_args).sbe = mcc_arg_68; + (*ol_args).lastsmb = mcc_arg_69; + (*ol_args).release = mcc_arg_70; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 4, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_65; + imm_args.smbc = mcc_arg_66; + imm_args.d = mcc_arg_67; + imm_args.sbe = mcc_arg_68; + imm_args.lastsmb = mcc_arg_69; + imm_args.release = mcc_arg_70; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SuperMBTask), 0, sizeof(SuperMBTask) } }; + nanos_region_dimension_t dimensions_3[1] = { { sizeof(int), 0, sizeof(int) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } } - else + } + } + mcc_err_in_final_15 = nanos_in_final(&mcc_is_in_final_15); + { + H264Context *mcc_arg_71 = h; + OutputContext *mcc_arg_72 = oc; + SliceBufferEntry *mcc_arg_73 = &sbe[k % bufs]; + if (mcc_is_in_final_15) + { + output_task(h, oc, &sbe[k % bufs]); + } + else + { { - _nx_data_env_7_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct EntropyContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_7_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_15_t *ol_args; + nanos_err_t err; + struct nanos_args_15_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_15_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_71; + (*ol_args).oc = mcc_arg_72; + (*ol_args).sbe = mcc_arg_73; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_71; + imm_args.oc = mcc_arg_72; + imm_args.sbe = mcc_arg_73; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } } - } + } + } + } + } + } + } + else + { + { + while ((!(*pc).final_frame && frames++ < (*h).num_frames) && !(*h).quit) + { + { + nanos_err_t mcc_err_in_final_16; + _Bool mcc_is_in_final_16; + nanos_err_t mcc_err_in_final_17; + _Bool mcc_is_in_final_17; + nanos_err_t mcc_err_in_final_18; + _Bool mcc_is_in_final_18; + nanos_err_t mcc_err_in_final_19; + _Bool mcc_is_in_final_19; + mcc_err_in_final_16 = nanos_in_final(&mcc_is_in_final_16); + { + H264Context *mcc_arg_74 = h; + ParserContext *mcc_arg_75 = pc; + NalContext *mcc_arg_76 = nc; + SliceBufferEntry *mcc_arg_77 = &sbe[k % bufs]; + if (mcc_is_in_final_16) + { + parse_task(h, pc, nc, &sbe[k % bufs]); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_16_t *ol_args; + nanos_err_t err; + struct nanos_args_16_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_16_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_74; + (*ol_args).pc = mcc_arg_75; + (*ol_args).nc = mcc_arg_76; + (*ol_args).sbe = mcc_arg_77; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 3, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_74; + imm_args.pc = mcc_arg_75; + imm_args.nc = mcc_arg_76; + imm_args.sbe = mcc_arg_77; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(NalContext), 0, sizeof(NalContext) } }; + nanos_region_dimension_t dimensions_2[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + mcc_err_in_final_17 = nanos_in_final(&mcc_is_in_final_17); + { + H264Context *mcc_arg_78 = h; + EntropyContext *mcc_arg_79 = ec[k % bufs]; + SliceBufferEntry *mcc_arg_80 = &sbe[k % bufs]; + if (mcc_is_in_final_17) + { + decode_slice_entropy_task(h, ec[k % bufs], &sbe[k % bufs]); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_17_t *ol_args; + nanos_err_t err; + struct nanos_args_17_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_17_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_78; + (*ol_args).ec = mcc_arg_79; + (*ol_args).sbe = mcc_arg_80; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_78; + imm_args.ec = mcc_arg_79; + imm_args.sbe = mcc_arg_80; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(EntropyContext), 0, sizeof(EntropyContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + mcc_err_in_final_18 = nanos_in_final(&mcc_is_in_final_18); + { + H264Context *mcc_arg_81 = h; + MBRecContext *mcc_arg_82 = rc[0]; + SliceBufferEntry *mcc_arg_83 = &sbe[k % bufs]; + if (mcc_is_in_final_18) + { + decode_slice_mb_task(h, rc[0], &sbe[k % bufs]); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_18_t *ol_args; + nanos_err_t err; + struct nanos_args_18_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_18_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_81; + (*ol_args).d = mcc_arg_82; + (*ol_args).sbe = mcc_arg_83; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_81; + imm_args.d = mcc_arg_82; + imm_args.sbe = mcc_arg_83; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(MBRecContext), 0, sizeof(MBRecContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + mcc_err_in_final_19 = nanos_in_final(&mcc_is_in_final_19); + { + H264Context *mcc_arg_84 = h; + OutputContext *mcc_arg_85 = oc; + SliceBufferEntry *mcc_arg_86 = &sbe[k % bufs]; + if (mcc_is_in_final_19) + { + output_task(h, oc, &sbe[k % bufs]); + } + else + { + { + nanos_wd_dyn_props_t nanos_wd_dyn_props; + struct nanos_args_19_t *ol_args; + nanos_err_t err; + struct nanos_args_19_t imm_args; + 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 }; + 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 } } }; + nanos_wd_dyn_props.tie_to = 0; + nanos_wd_dyn_props.priority = 0; + nanos_wd_dyn_props.flags.is_final = 0; + ol_args = (struct nanos_args_19_t *)0; + void *nanos_wd_ = (void *)0; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + /* Check pendant writes on subexpressions */ + /* End check pendant writes on subexpressions */ + if (nanos_wd_ != (void *)0) + { + { + (*ol_args).h = mcc_arg_84; + (*ol_args).oc = mcc_arg_85; + (*ol_args).sbe = mcc_arg_86; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + err = nanos_submit(nanos_wd_, 2, dependences, (void *)0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + else + { + { + imm_args.h = mcc_arg_84; + imm_args.oc = mcc_arg_85; + imm_args.sbe = mcc_arg_86; + nanos_region_dimension_t dimensions_0[1] = { { sizeof(OutputContext), 0, sizeof(OutputContext) } }; + nanos_region_dimension_t dimensions_1[1] = { { sizeof(SliceBufferEntry), 0, sizeof(SliceBufferEntry) } }; + 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 } }; + ; + 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); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + } + } + } + } + { + nanos_region_dimension_t dimensions_0[1] = { { sizeof(ParserContext), 0, sizeof(ParserContext) } }; + nanos_data_access_t dependences[1] = { { (void *)pc, { 1, 1, 0, 0, 0 }, 1, dimensions_0, 0 } }; ; + nanos_err_t err = nanos_wait_on(1, dependences); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + k++; } - { - struct _dependence_holder - { - struct ParserContext *dep_0; - } _dep_holder = {&(*pc)}; - nanos_dependence_t _wait_dependences[1] = {{ - (void **) &_dep_holder.dep_0, - ((char *) ((pc)) - (char *) _dep_holder.dep_0), - { - 1, - 0, - 0, - 0 - }, - sizeof (*pc) - }}; - nanos_wait_on(1, _wait_dependences); - } - k++; - } - while (!pc->final_frame && frames++ < h->num_frames && !h->quit) - { - { - struct H264Context *__tmp_0 = h; - struct ParserContext *__tmp_1 = pc; - struct NalContext *__tmp_2 = nc; - SliceBufferEntry *__tmp_3 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_8_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_8}; - _nx_data_env_8_t *ol_args = (_nx_data_env_8_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_8_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_8_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_8_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 0, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct ParserContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct NalContext) - } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_8_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 0, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct ParserContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct NalContext) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_8_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct H264Context *__tmp_0 = h; - struct EntropyContext *__tmp_1 = ec[k % bufs]; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_9_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_9}; - _nx_data_env_9_t *ol_args = (_nx_data_env_9_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_9_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_9_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_9_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct EntropyContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_9_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct EntropyContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_9_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - k++; - { - struct H264Context *__tmp_0 = h; - struct MBRecContext *__tmp_1 = rc[k % 2]; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - int *__tmp_3 = &init; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_10_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_10}; - _nx_data_env_10_t *ol_args = (_nx_data_env_10_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_10_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_10_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_10_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_10_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_10_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - smbc = acquire_smbc(h); - SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc); - { - struct H264Context *__tmp_0 = h; - struct SuperMBContext *__tmp_1 = smbc; - struct MBRecContext *__tmp_2 = rc[k % 2]; - SliceBufferEntry *__tmp_3 = &sbe[k % bufs]; - struct SuperMBTask *__tmp_4 = lastsmb; - int *__tmp_5 = &release; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_11_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_11}; - _nx_data_env_11_t *ol_args = (_nx_data_env_11_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_11_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_11_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_11_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - ol_args->__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[4] = { - { - (void **) &ol_args->__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - err = nanos_submit(wd, 4, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_11_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - imm_args.__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[4] = { - { - (void **) &imm_args.__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_11_t), &imm_args, 4, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct H264Context *__tmp_0 = h; - struct OutputContext *__tmp_1 = oc; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_12_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_12}; - _nx_data_env_12_t *ol_args = (_nx_data_env_12_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_12_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_12_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_12_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct OutputContext) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_12_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct OutputContext) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_12_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct _dependence_holder - { - struct ParserContext *dep_0; - } _dep_holder = {&(*pc)}; - nanos_dependence_t _wait_dependences[1] = {{ - (void **) &_dep_holder.dep_0, - ((char *) ((pc)) - (char *) _dep_holder.dep_0), - { - 1, - 0, - 0, - 0 - }, - sizeof (*pc) - }}; - nanos_wait_on(1, _wait_dependences); - } - } - for (int i = 0; - i < num_pre_ed; - i++) - { - k++; - { - struct H264Context *__tmp_0 = h; - struct MBRecContext *__tmp_1 = rc[k % 2]; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - int *__tmp_3 = &init; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_13_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_13}; - _nx_data_env_13_t *ol_args = (_nx_data_env_13_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_13_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_13_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_13_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_13_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_13_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - smbc = acquire_smbc(h); - SuperMBTask *lastsmb = add_decode_slice_3dwave_tasks(rc[k % 2], &sbe[k % bufs], smbc); - { - struct H264Context *__tmp_0 = h; - struct SuperMBContext *__tmp_1 = smbc; - struct MBRecContext *__tmp_2 = rc[k % 2]; - SliceBufferEntry *__tmp_3 = &sbe[k % bufs]; - struct SuperMBTask *__tmp_4 = lastsmb; - int *__tmp_5 = &release; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_14_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_14}; - _nx_data_env_14_t *ol_args = (_nx_data_env_14_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_14_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_14_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_14_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - ol_args->__tmp_4_0 = __tmp_4; - ol_args->__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[4] = { - { - (void **) &ol_args->__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) ol_args->__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) ol_args->__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - err = nanos_submit(wd, 4, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_14_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - imm_args.__tmp_4_0 = __tmp_4; - imm_args.__tmp_5_0 = __tmp_5; - nanos_dependence_t _dependences[4] = { - { - (void **) &imm_args.__tmp_4_0, - ((char *) ((__tmp_4)) - (char *) imm_args.__tmp_4_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(struct SuperMBTask) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_5_0, - ((char *) ((__tmp_5)) - (char *) imm_args.__tmp_5_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(int) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_14_t), &imm_args, 4, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct H264Context *__tmp_0 = h; - struct OutputContext *__tmp_1 = oc; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_15_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_15}; - _nx_data_env_15_t *ol_args = (_nx_data_env_15_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_15_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_15_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_15_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct OutputContext) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_15_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct OutputContext) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_15_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - } + } + } } - else + { + nanos_err_t err; + void *nanos_wd_ = nanos_current_wd(); + err = nanos_wg_wait_completion(nanos_wd_, 0); + if (err != NANOS_OK) + { + nanos_handle_error(err); + } + } + while ((out = output_frame(h, oc, (void *)0, (*h).ofile, (*h).frame_width, (*h).frame_height))) { - while (!pc->final_frame && frames++ < h->num_frames && !h->quit) - { - { - struct H264Context *__tmp_0 = h; - struct ParserContext *__tmp_1 = pc; - struct NalContext *__tmp_2 = nc; - SliceBufferEntry *__tmp_3 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_16_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_16}; - _nx_data_env_16_t *ol_args = (_nx_data_env_16_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_16_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_16_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_16_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - ol_args->__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &ol_args->__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) ol_args->__tmp_3_0), - { - 0, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct ParserContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct NalContext) - } - }; - err = nanos_submit(wd, 3, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_16_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - imm_args.__tmp_3_0 = __tmp_3; - nanos_dependence_t _dependences[3] = { - { - (void **) &imm_args.__tmp_3_0, - ((char *) ((__tmp_3)) - (char *) imm_args.__tmp_3_0), - { - 0, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct ParserContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct NalContext) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_16_t), &imm_args, 3, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct H264Context *__tmp_0 = h; - struct EntropyContext *__tmp_1 = ec[k % bufs]; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_17_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_17}; - _nx_data_env_17_t *ol_args = (_nx_data_env_17_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_17_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_17_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_17_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct EntropyContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_17_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct EntropyContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_17_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct H264Context *__tmp_0 = h; - struct MBRecContext *__tmp_1 = rc[0]; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_18_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_18}; - _nx_data_env_18_t *ol_args = (_nx_data_env_18_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_18_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_18_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_18_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_18_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct MBRecContext) - }, - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(SliceBufferEntry) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_18_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct H264Context *__tmp_0 = h; - struct OutputContext *__tmp_1 = oc; - SliceBufferEntry *__tmp_2 = &sbe[k % bufs]; - { - /* SMP device descriptor */ - static nanos_smp_args_t _ol_h264_decode_ompss_19_smp_args = {(void (*)(void *)) _smp__ol_h264_decode_ompss_19}; - _nx_data_env_19_t *ol_args = (_nx_data_env_19_t *) 0; - nanos_wd_t wd = (nanos_wd_t) 0; - struct nanos_const_wd_definition_local_t - { - nanos_const_wd_definition_t base; - nanos_device_t devices[1]; - }; - static struct nanos_const_wd_definition_local_t _const_def = { - { - { - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0 - }, - __alignof__(_nx_data_env_19_t), - 0, - 1 - }, - {{ - nanos_smp_factory, - &_ol_h264_decode_ompss_19_smp_args - }} - }; - nanos_wd_dyn_props_t dyn_props = {0}; - nanos_err_t err; - dyn_props.priority = 0; - err = nanos_create_wd_compact(&wd, &_const_def.base, &dyn_props, sizeof(_nx_data_env_19_t), (void **) &ol_args, nanos_current_wd(), (nanos_copy_data_t **) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - if (wd != (nanos_wd_t) 0) - { - ol_args->__tmp_0_0 = __tmp_0; - ol_args->__tmp_1_0 = __tmp_1; - ol_args->__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &ol_args->__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) ol_args->__tmp_2_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &ol_args->__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) ol_args->__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct OutputContext) - } - }; - err = nanos_submit(wd, 2, (nanos_dependence_t *) _dependences, (nanos_team_t) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - else - { - _nx_data_env_19_t imm_args; - imm_args.__tmp_0_0 = __tmp_0; - imm_args.__tmp_1_0 = __tmp_1; - imm_args.__tmp_2_0 = __tmp_2; - nanos_dependence_t _dependences[2] = { - { - (void **) &imm_args.__tmp_2_0, - ((char *) ((__tmp_2)) - (char *) imm_args.__tmp_2_0), - { - 1, - 0, - 1, - 0 - }, - sizeof(SliceBufferEntry) - }, - { - (void **) &imm_args.__tmp_1_0, - ((char *) ((__tmp_1)) - (char *) imm_args.__tmp_1_0), - { - 1, - 1, - 1, - 0 - }, - sizeof(struct OutputContext) - } - }; - dyn_props.priority = 0; - err = nanos_create_wd_and_run_compact(&_const_def.base, &dyn_props, sizeof(_nx_data_env_19_t), &imm_args, 2, (nanos_dependence_t *) _dependences, (nanos_copy_data_t *) 0, (void *) 0); - if (err != NANOS_OK) - nanos_handle_error(err); - } - } - ; - } - { - struct _dependence_holder - { - struct ParserContext *dep_0; - } _dep_holder = {&(*pc)}; - nanos_dependence_t _wait_dependences[1] = {{ - (void **) &_dep_holder.dep_0, - ((char *) ((pc)) - (char *) _dep_holder.dep_0), - { - 1, - 0, - 0, - 0 - }, - sizeof (*pc) - }}; - nanos_wait_on(1, _wait_dependences); - } - k++; - } + ; } - nanos_wg_wait_completion(nanos_current_wd(), 0); - while ((out = output_frame(h, oc, ((void *) 0), h->ofile, h->frame_width, h->frame_height))) - ; - h->num_frames = oc->frame_number; - free_parse_context(pc); - free_nal_context(nc); - free_output_context(oc); - for (int i = 0; - i < bufs; - i++) + (*h).num_frames = (*oc).frame_number; + free_parse_context(pc); + free_nal_context(nc); + free_output_context(oc); + for (int i = 0; i < bufs; i++) { + { free_sb_entry(&sbe[i]); free_entropy_context(ec[i]); + } } - av_free(sbe); - for (int i = 0; - i < 2; - i++) + av_free(sbe); + for (int i = 0; i < 2; i++) { + { free_mbrec_context(rc[i]); + } } - return 0; + return 0; } -__attribute__((weak, section("nanos_init"))) nanos_init_desc_t __section__nanos_init = { - nanos_omp_set_interface, - (void *) 0 +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) +{ + { + decode_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*m)); + } +} +static void smp_ol_decode_super_mb_task_1(struct nanos_args_0_t *const args) +{ + { + smp_ol_decode_super_mb_task_1_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).m)); + } +} +static void smp_ol_draw_edges_task_3_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const sm, int *const line) +{ + { + draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line)); + } +} +static void smp_ol_draw_edges_task_3(struct nanos_args_1_t *const args) +{ + { + smp_ol_draw_edges_task_3_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line)); + } +} +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) +{ + { + decode_3dwave_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*mprev), (*m)); + } +} +static void smp_ol_decode_3dwave_super_mb_task_5(struct nanos_args_2_t *const args) +{ + { + smp_ol_decode_3dwave_super_mb_task_5_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).mprev), &((*args).m)); + } +} +static void smp_ol_draw_edges_task_7_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const sm, int *const line) +{ + { + draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line)); + } +} +static void smp_ol_draw_edges_task_7(struct nanos_args_3_t *const args) +{ + { + smp_ol_draw_edges_task_7_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line)); + } +} +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) +{ + { + decode_super_mb_task((*d), (*sbe), (*smbc), (*ml), (*mur), (*m)); + } +} +static void smp_ol_decode_super_mb_task_9(struct nanos_args_4_t *const args) +{ + { + smp_ol_decode_super_mb_task_9_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).ml), &((*args).mur), &((*args).m)); + } +} +static void smp_ol_draw_edges_task_11_unpacked(MBRecContext **const d, SliceBufferEntry **const sbe, SuperMBContext **const smbc, SuperMBTask **const sm, int *const line) +{ + { + draw_edges_task((*d), (*sbe), (*smbc), (*sm), (*line)); + } +} +static void smp_ol_draw_edges_task_11(struct nanos_args_5_t *const args) +{ + { + smp_ol_draw_edges_task_11_unpacked(&((*args).d), &((*args).sbe), &((*args).smbc), &((*args).sm), &((*args).line)); + } +} +static void smp_ol_parse_task_13_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe) +{ + { + parse_task((*h), (*pc), (*nc), (*sbe)); + } +} +static void smp_ol_parse_task_13(struct nanos_args_6_t *const args) +{ + { + smp_ol_parse_task_13_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe)); + } +} +static void smp_ol_decode_slice_entropy_task_15_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe) +{ + { + decode_slice_entropy_task((*h), (*ec), (*sbe)); + } +} +static void smp_ol_decode_slice_entropy_task_15(struct nanos_args_7_t *const args) +{ + { + smp_ol_decode_slice_entropy_task_15_unpacked(&((*args).h), &((*args).ec), &((*args).sbe)); + } +} +static void smp_ol_parse_task_17_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe) +{ + { + parse_task((*h), (*pc), (*nc), (*sbe)); + } +} +static void smp_ol_parse_task_17(struct nanos_args_8_t *const args) +{ + { + smp_ol_parse_task_17_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe)); + } +} +static void smp_ol_decode_slice_entropy_task_19_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe) +{ + { + decode_slice_entropy_task((*h), (*ec), (*sbe)); + } +} +static void smp_ol_decode_slice_entropy_task_19(struct nanos_args_9_t *const args) +{ + { + smp_ol_decode_slice_entropy_task_19_unpacked(&((*args).h), &((*args).ec), &((*args).sbe)); + } +} +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) +{ + { + init_ref_list_and_get_dpb_task((*h), (*d), (*sbe), (*init)); + } +} +static void smp_ol_init_ref_list_and_get_dpb_task_21(struct nanos_args_10_t *const args) +{ + { + smp_ol_init_ref_list_and_get_dpb_task_21_unpacked(&((*args).h), &((*args).d), &((*args).sbe), &((*args).init)); + } +} +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) +{ + { + release_ref_list_task((*h), (*smbc), (*d), (*sbe), (*lastsmb), (*release)); + } +} +static void smp_ol_release_ref_list_task_23(struct nanos_args_11_t *const args) +{ + { + smp_ol_release_ref_list_task_23_unpacked(&((*args).h), &((*args).smbc), &((*args).d), &((*args).sbe), &((*args).lastsmb), &((*args).release)); + } +} +static void smp_ol_output_task_25_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe) +{ + { + output_task((*h), (*oc), (*sbe)); + } +} +static void smp_ol_output_task_25(struct nanos_args_12_t *const args) +{ + { + smp_ol_output_task_25_unpacked(&((*args).h), &((*args).oc), &((*args).sbe)); + } +} +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) +{ + { + init_ref_list_and_get_dpb_task((*h), (*d), (*sbe), (*init)); + } +} +static void smp_ol_init_ref_list_and_get_dpb_task_27(struct nanos_args_13_t *const args) +{ + { + smp_ol_init_ref_list_and_get_dpb_task_27_unpacked(&((*args).h), &((*args).d), &((*args).sbe), &((*args).init)); + } +} +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) +{ + { + release_ref_list_task((*h), (*smbc), (*d), (*sbe), (*lastsmb), (*release)); + } +} +static void smp_ol_release_ref_list_task_29(struct nanos_args_14_t *const args) +{ + { + smp_ol_release_ref_list_task_29_unpacked(&((*args).h), &((*args).smbc), &((*args).d), &((*args).sbe), &((*args).lastsmb), &((*args).release)); + } +} +static void smp_ol_output_task_31_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe) +{ + { + output_task((*h), (*oc), (*sbe)); + } +} +static void smp_ol_output_task_31(struct nanos_args_15_t *const args) +{ + { + smp_ol_output_task_31_unpacked(&((*args).h), &((*args).oc), &((*args).sbe)); + } +} +static void smp_ol_parse_task_33_unpacked(H264Context **const h, ParserContext **const pc, NalContext **const nc, SliceBufferEntry **const sbe) +{ + { + parse_task((*h), (*pc), (*nc), (*sbe)); + } +} +static void smp_ol_parse_task_33(struct nanos_args_16_t *const args) +{ + { + smp_ol_parse_task_33_unpacked(&((*args).h), &((*args).pc), &((*args).nc), &((*args).sbe)); + } +} +static void smp_ol_decode_slice_entropy_task_35_unpacked(H264Context **const h, EntropyContext **const ec, SliceBufferEntry **const sbe) +{ + { + decode_slice_entropy_task((*h), (*ec), (*sbe)); + } +} +static void smp_ol_decode_slice_entropy_task_35(struct nanos_args_17_t *const args) +{ + { + smp_ol_decode_slice_entropy_task_35_unpacked(&((*args).h), &((*args).ec), &((*args).sbe)); + } +} +static void smp_ol_decode_slice_mb_task_37_unpacked(H264Context **const h, MBRecContext **const d, SliceBufferEntry **const sbe) +{ + { + decode_slice_mb_task((*h), (*d), (*sbe)); + } +} +static void smp_ol_decode_slice_mb_task_37(struct nanos_args_18_t *const args) +{ + { + smp_ol_decode_slice_mb_task_37_unpacked(&((*args).h), &((*args).d), &((*args).sbe)); + } +} +static void smp_ol_output_task_39_unpacked(H264Context **const h, OutputContext **const oc, SliceBufferEntry **const sbe) +{ + { + output_task((*h), (*oc), (*sbe)); + } +} +static void smp_ol_output_task_39(struct nanos_args_19_t *const args) +{ + { + smp_ol_output_task_39_unpacked(&((*args).h), &((*args).oc), &((*args).sbe)); + } +} +typedef void nanos_init_func_t(void *); +struct mcc_struct_anon_22 +{ + void (*func)(void *); + void *data; }; +typedef struct mcc_struct_anon_22 nanos_init_desc_t; +void nanos_omp_set_interface(void *); +__attribute__((weak)) __attribute__((section("nanos_init"))) nanos_init_desc_t __section__nanos_init = { nanos_omp_set_interface, (void *)0 };