blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 268 | content_id stringlengths 40 40 | detected_licenses listlengths 0 58 | license_type stringclasses 2
values | repo_name stringlengths 5 118 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 816
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 2.31k 677M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 151
values | src_encoding stringclasses 33
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 3 10.3M | extension stringclasses 119
values | content stringlengths 3 10.3M | authors listlengths 1 1 | author_id stringlengths 0 228 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a627b02a3285c03c769950c337a6beb994fbc4e3 | a2c064282ce1dea303e752b8251a3be6ba7c256a | /Compression.c | 7493bb9a432383441fa5e345ad4fbe8173eea8c3 | [] | no_license | HermanStarr/Huffman | ef16f5e9c2c4f94c0cac97753850272e4c0addca | cd5ae7532e4b891ed59c78bfbb0c6991cdafe9b0 | refs/heads/main | 2023-03-02T06:31:22.649026 | 2021-01-29T20:21:30 | 2021-01-29T20:21:30 | 334,228,704 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 8,061 | c | /** @file */
#include "Compression.h"
#pragma warning(disable : 4996)
/**Function manages compression process
@param input is an input handler
@param output is an output handler*/
void initCompression(char* input, char* output)
{
Characters* characters = malloc(sizeof(Characters));
if (characters)
{
characters->character = 0;
characters->next = NULL;
characters->code = NULL;
characters->tree = NULL;
characters->value = 0u;
/*Call function readCharactersForCompression
taking input handle and adress of Characters head to further modify*/
readCharactersForCompression(input, &characters);
/*Call for list to be sorted using merge sort
taking adress of Characters head to further modify*/
mergeSort(&characters);
/*Create a copy of characters list*/
Characters* copy = copyCharacters(characters);
/*Deconstruct Characters list while constructing huffman tree*/
Keys* keys = huffmanTreeConstruction(&characters);
/*Assign huffman codes to characters in a tree*/
assignFirstHuffmanCodes(copy, keys);
FILE* compression = fopen(output, "wb");
FILE* for_compression = fopen(input, "rb");
if (compression && for_compression)
{
/*Compress codes into file*/
compressCodes(compression, copy);
/*Compress text of input file*/
compressText(for_compression, compression, copy);
if (fclose(for_compression) == EOF || fclose(compression) == EOF)
{
endPrg(__func__, "failed to close files");
}
}
deleteCharacters(characters);
deleteCharacters(copy);
deleteKeys(keys);
}
else
{
endPrg(__func__, "did not allocate head of Characters list");
}
}
/**Function reads characters from input file and creates a characters list
@param file_name is a path to the input file for compression
@param head is a head to the Characters list*/
void readCharactersForCompression(char* file_name, Characters** head)
{
FILE* for_compression_file = fopen(file_name, "rb");
if (for_compression_file)
{
int count = 0;
char c = 0;
/**While not END OF FILE*/
while (fread(&c, 1U, 1, for_compression_file) == 1)
{
count++;
if (c == 0)
endPrg(__func__, "did not read any characters");
/*Add character to Characters list*/
addCharacter(c, head);
}
fclose(for_compression_file);
}
else
endPrg(__func__, "could not open input file");
}
/**Function assigns huffman codes based on a huffman tree
*not embeded in the assignHuffmanCodes function to avoid redundant if statements
@param copy is a head of a copy Characters list
@param keys is a head of Keys tree*/
void assignFirstHuffmanCodes(Characters* copy, Keys* keys)
{
if (!keys->left_node && !keys->right_node)
{
/*Set code to 0*/
copy->code = strdup("0");
return;
}
/*Dynamically allocate lc as "0"*/
char* lc = strdup("0");
/*Assign huffman code for left node*/
assignHuffmanCodes(copy, keys->left_node, lc);
/*Dynamically allocate rc as "1"*/
char* rc = strdup("1");
/*Assign huffman code for left node*/
assignHuffmanCodes(copy, keys->right_node, rc);
}
/**Function assigns huffman codes based on a huffman tree
@param copy is a head of a copy Characters list
@param keys is a head of Keys tree
@param code is a passed huffman code corresponding to current node*/
void assignHuffmanCodes(Characters* copy, Keys* keys, char* code)
{
if (keys)
{
if (keys->left_node)
{
/*Append 0 to the end of code*/
char* new_code = appendCharacter(strdup(code), 48);
if (new_code)
/*Assign Huffman code for left node*/
assignHuffmanCodes(copy, keys->left_node, new_code);
else
endPrg(__func__, "failed to allocate");
}
if (keys->right_node)
{
/*Append 1 to the end of code*/
char* new_code = appendCharacter(strdup(code), 49);
if (new_code)
/*Assign Huffman code for right node*/
assignHuffmanCodes(copy, keys->right_node, new_code);
else
endPrg(__func__, "failed to allocate");
}
/*If leaf*/
if (!keys->left_node && !keys->right_node)
{
/*Assign code corresponding to given character*/
searchCharacter(keys->character, copy)->code = code;
}
/*If not leaf*/
else
{
free(code);
}
}
else
{
endPrg(__func__, "Keys node was empty");
}
}
/**Functions passes information about characters and coding into the output file
@param compression compression file
@param list header to Characters list*/
void compressCodes(FILE* compression, Characters* list)
{
/*Create temporary value storing list adress*/
Characters* tmp = list;
for (; tmp; tmp = tmp->next)
{
/*Compute length of code*/
unsigned char length = strlen(tmp->code);
/*Write 8-bit word storing character*/
fwrite(&tmp->character, 1U, 1, compression);
/*Write 8-bit word storing lenghth of code to be read from the next words*/
fwrite(&length, 1U, 1, compression);
unsigned char code_to_be = 0;
/*Write appropriate ammount of 8-bit words to the file
ceil(length/8) is rounded up ammount of total bits divided by 8*/
for (int i = 0; i < ceiling(length); i++)
{
int j = 0;
/*j cannot be more than length of code
and it cannot be more than (i+1)*8 */
for (j = i * 8; j < length && j < (i + 1) * 8; j++)
{
if (tmp->code[j] == 48)
{
/*left shift code_to_be*/
code_to_be *= 2;
}
else
{
/*Left shift code_to_be*/
code_to_be *= 2;
code_to_be += 1;
}
}
/*If not all 8 bits were written*/
if (j % 8 != 0)
{
/*For remaining bits*/
for (; j % 8 != 0; j++)
{
if (j % 2 == 1)
{
/*Left shift*/
code_to_be *= 2;
code_to_be += 1;
}
else
/*Shift left*/
code_to_be *= 2;
}
/*Write the result into the file*/
fwrite(&code_to_be, 1U, 1, compression);
break;
}
/*If all 8 bits were written*/
else
{
/*Write the result into the file*/
fwrite(&code_to_be, 1U, 1, compression);
/*Zero the code*/
code_to_be = 0;
}
}
}
/*Set guardian value 0*/
unsigned char to_be_passed = 0;
/*Print additional guardian line in compression file*/
fwrite(&to_be_passed, 1U, 1, compression);
}
/**Function passes encoded characters into the output file
@param for_compression file from where all of the uncompressed characters are read
@param compression compression file
@param list header to Characters list*/
compressText(FILE* for_compression, FILE* compression, Characters* list)
{
unsigned char to_be_passed = 0;
unsigned char c = 0;
/*Define count value to manauver through 8 bit chunks*/
size_t count = 0;
Characters* element = NULL;
/*Code of given Characters element*/
char* code = NULL;
while ((c = getc(for_compression)) != EOF)
{
/*Search for given character*/
element = searchCharacter(c, list);
/*If there is no such an element break*/
if (element == NULL)
break;
/*Set code to be equal to code of the element*/
code = element->code;
size_t size = strlen(code);
for (size_t i = 0; i < size; i++)
{
if (count == 8)
{
/*If code is equal to either 0 or 255 set guardian value*/
if (to_be_passed == 255 || to_be_passed == 0)
{
/*Guardian value equal to 0*/
unsigned char pass = 0;
/*Write guardian value*/
fwrite(&pass, sizeof(char), 1, compression);
}
if (fwrite(&to_be_passed, sizeof(char), 1, compression) != 1)
endPrg(__func__, "fwrite is nuts!");
to_be_passed = 0;
count = 0;
}
if (code[i] == 49)
{
to_be_passed *= 2;
to_be_passed += 1;
}
else
{
to_be_passed *= 2;
}
count++;
}
}
if (count != 0)
{
unsigned char count2 = count;
/*For each remaining bit*/
for (; count < 8; count++)
{
if (count % 2 == 0)
{
to_be_passed *= 2;
to_be_passed += 1;
}
else
to_be_passed *= 2;
}
count = 0;
/*Write guardian value 0*/
fwrite(&count, 1U, 1, compression);
/*Set count to 1*/
count = 1;
/*Write second guardian value 1*/
fwrite(&count, 1U, 1, compression);
/*Write number of bits to be read*/
fwrite(&count2, 1U, 1, compression);
/*Pass the remaining bits*/
fwrite(&to_be_passed, 1U, 1, compression);
}
}
| [
"kamilszmk@gmail.com"
] | kamilszmk@gmail.com |
f4fd753d1982c4099e9e17fb8c50f2ab205dcf0f | 654f9a4f51696e70c992ffa61f57647ee937dd60 | /Projects/STM32F412G-Discovery/Examples/HAL/HAL_TimeBase_RTC_ALARM/Inc/main.h | 250174feb4685839458dc6efb0c3f82ad688fe8c | [
"BSD-2-Clause",
"Apache-2.0"
] | permissive | 980f/STM32CubeF4 | b48b4197339426953019d338a399611c7c0a2c6c | 4b4b7c17135ff062f0e2dd4f6798583aa3ffc08f | refs/heads/master | 2023-02-02T21:56:00.651533 | 2020-12-21T18:03:39 | 2020-12-21T18:03:39 | 292,336,672 | 0 | 0 | NOASSERTION | 2020-09-02T16:32:06 | 2020-09-02T16:32:06 | null | UTF-8 | C | false | false | 2,694 | h | /**
******************************************************************************
* @file HAL/HAL_TimeBase/Inc/main.h
* @author MCD Application Team
* @brief Header for main.c module
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#include "stm32412g_discovery.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
#endif /* __MAIN_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"ali.labbene@st.com"
] | ali.labbene@st.com |
d981185342648fcd50f584967538d4a51c2eaf48 | 5501e96988db71063cdc2511ae6c4046c6b79311 | /OpenMP_Project3/GaussElimination/gauss_elimination_parallel_openmp.c | 55c0a84d3a3ee74d8243af794322134094e2d690 | [] | no_license | SaipranavK/Multiprocessor-Programming | 2f7da20a0805f2c4aeda658248ca760fae5fbbb4 | 305ac9ade268d9e10b7b050e10356cdf0f0d25ce | refs/heads/main | 2023-01-24T08:40:20.435506 | 2020-12-01T14:32:52 | 2020-12-01T14:32:52 | 317,565,429 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,110 | c |
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <omp.h>
#include <unistd.h>
#define MAX_SIZE 4096
#define BILLION 1000000000.0
typedef double matrix[MAX_SIZE][MAX_SIZE];
int N; // matrix size
matrix A; // matrix A
double b[MAX_SIZE]; // vector b
double y[MAX_SIZE]; // vector y
int chunksize; // chunk size
int number_of_threads;
void work(void);
void Init_Matrix(void);
void Print_Matrix(void);
int main()
{
int i;
struct timespec start, end;
printf("ENRER THE SIZE:\n");
scanf("%d",&N);
printf("Enter number of threads:\n");
scanf("%d",&number_of_threads);
Init_Matrix();
clock_gettime(CLOCK_REALTIME, &start);
work();
clock_gettime(CLOCK_REALTIME, &end);
Print_Matrix();
double time_spent = (end.tv_sec - start.tv_sec) + (end.tv_nsec - start.tv_nsec) / BILLION;
printf("SIZE:%d\n",N);
printf("THREAS:%d\n",number_of_threads);
printf("Time elpased is %f seconds\n", time_spent);
}
void work(void) /* Gaussian Elimination algorithm */
{
int i, j, k;
for (k = 0; k < N; k++) {
/* Creates a new group of threads */
#pragma omp parallel for num_threads(number_of_threads) schedule(dynamic, chunksize)
for (j = k+1; j < N; j++)
{
A[k][j] = A[k][j] / A[k][k];
}
y[k] = b[k] / A[k][k];
A[k][k] = 1.0;
#pragma omp parallel for num_threads(number_of_threads) schedule(dynamic, chunksize) collapse(2)
for (i = k+1; i < N; i++) {
for (j = k+1; j < N; j++) //colapse for 2 for loop
A[i][j] = A[i][j] - A[i][k]*A[k][j]; // Elimination step
}
#pragma omp parallel for num_threads(number_of_threads) schedule(dynamic, chunksize)
- for (i = k+1; i < N; i++) {
b[i] = b[i] - A[i][k]*y[k];
A[i][k] = 0.0;
}
}
}
void
Init_Matrix()
{
int i, j;
printf("\nsize = %dx%d ", N, N);
printf("Initializing matrix...");
chunksize = N/number_of_threads; // chunk size of each chunk that is allocated to a thread by omp
for (i = 0; i < N; i++)
{
for (j = 0; j < N; j++) {
if (i == j) // diagonal dominance
A[i][j] = 5.0;
else
A[i][j] = 2.0;
}
}
for (i = 0; i < N; i++) { // Initialize vectors b and y
b[i] = 2.0;
y[i] = 1.0;
}
printf("init done \n\n");
Print_Matrix();
}
void Print_Matrix()
{
int i, j;
printf("Matrix A:\n");
for (i = 0; i < N; i++) {
printf("[");
for (j = 0; j < N; j++)
printf(" %5.3f,", A[i][j]);
printf("]\n");
}
printf("Vector b:\n[");
for (j = 0; j < N; j++)
printf(" %5.3f,", b[j]);
printf("]\n");
printf("Vector y:\n[");
for (j = 0; j < N; j++)
printf(" %5.3f,", y[j]);
printf("]\n");
printf("\n\n");
}
| [
"ksaipranav@gmail.com"
] | ksaipranav@gmail.com |
7bd21220b3a09e65f2af2e8d0788b5465dd988b7 | 94b9b8e13e63fbd1bb9fa4a95afc7f0537b95359 | /iCritter/zlib-1.2.3/gzio.c | d7f2240032799cf7240bcd302925a491779bd817 | [] | no_license | alteredworlds/Altered3D | 662519989f1aa7a3e732f1430ae4eee5b95fffee | 2c241e890df7bfc44e313535ddbd55079168ce40 | refs/heads/master | 2021-06-29T23:11:38.542311 | 2017-09-18T11:46:12 | 2017-09-18T11:46:12 | 103,859,202 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 31,131 | c | /* gzio.c -- IO on .gz files
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*
* Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
*/
/* @(#) $Id$ */
#include <stdio.h>
#include "zutil.h"
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
#ifndef NO_DUMMY_DECL
struct internal_state {int dummy;}; /* for buggy compilers */
#endif
#ifndef Z_BUFSIZE
# ifdef MAXSEG_64K
# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
# else
# define Z_BUFSIZE 16384
# endif
#endif
#ifndef Z_PRINTF_BUFSIZE
# define Z_PRINTF_BUFSIZE 4096
#endif
#ifdef __MVS__
# pragma map (fdopen , "\174\174FDOPEN")
FILE *fdopen(int, const char *);
#endif
#ifndef STDC
extern voidp malloc OF((uInt size));
extern void free OF((voidpf ptr));
#endif
#define ALLOC(size) malloc(size)
#define TRYFREE(p) {if (p) free(p);}
static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
/* gzip flag byte */
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
#define COMMENT 0x10 /* bit 4 set: file comment present */
#define RESERVED 0xE0 /* bits 5..7: reserved */
typedef struct gz_stream {
z_stream stream;
int z_err; /* error code for last stream operation */
int z_eof; /* set if end of input file */
FILE *file; /* .gz file */
Byte *inbuf; /* input buffer */
Byte *outbuf; /* output buffer */
uLong crc; /* crc32 of uncompressed data */
char *msg; /* error message */
char *path; /* path name for debugging only */
int transparent; /* 1 if input file is not a .gz file */
char mode; /* 'w' or 'r' */
z_off_t start; /* start of compressed data in file (header skipped) */
z_off_t in; /* bytes into deflate or inflate */
z_off_t out; /* bytes out of deflate or inflate */
int back; /* one character push-back */
int last; /* true if push-back is last character */
} gz_stream;
local gzFile gz_open OF((const char *path, const char *mode, int fd));
local int do_flush OF((gzFile file, int flush));
local int get_byte OF((gz_stream *s));
local void check_header OF((gz_stream *s));
local int destroy OF((gz_stream *s));
local void putLong OF((FILE *file, uLong x));
local uLong getLong OF((gz_stream *s));
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb"). The file is given either by file descriptor
or path name (if fd == -1).
gz_open returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR).
*/
local gzFile gz_open (path, mode, fd)
const char *path;
const char *mode;
int fd;
{
int err;
int level = Z_DEFAULT_COMPRESSION; /* compression level */
int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
char *p = (char*)mode;
gz_stream *s;
char fmode[80]; /* copy of mode, without the compression level */
char *m = fmode;
if (!path || !mode) return Z_NULL;
s = (gz_stream *)ALLOC(sizeof(gz_stream));
if (!s) return Z_NULL;
s->stream.zalloc = (alloc_func)0;
s->stream.zfree = (free_func)0;
s->stream.opaque = (voidpf)0;
s->stream.next_in = s->inbuf = Z_NULL;
s->stream.next_out = s->outbuf = Z_NULL;
s->stream.avail_in = s->stream.avail_out = 0;
s->stream.state = NULL;
s->file = NULL;
s->z_err = Z_OK;
s->z_eof = 0;
s->in = 0;
s->out = 0;
s->back = EOF;
s->crc = crc32(0L, Z_NULL, 0);
s->msg = NULL;
s->transparent = 0;
s->path = (char*)ALLOC(strlen(path)+1);
if (s->path == NULL) {
return destroy(s), (gzFile)Z_NULL;
}
strcpy(s->path, path); /* do this early for debugging */
s->mode = '\0';
do {
if (*p == 'r') s->mode = 'r';
if (*p == 'w' || *p == 'a') s->mode = 'w';
if (*p >= '0' && *p <= '9') {
level = *p - '0';
} else if (*p == 'f') {
strategy = Z_FILTERED;
} else if (*p == 'h') {
strategy = Z_HUFFMAN_ONLY;
} else if (*p == 'R') {
strategy = Z_RLE;
} else {
*m++ = *p; /* copy the mode */
}
} while (*p++ && m != fmode + sizeof(fmode));
if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
if (s->mode == 'w') {
#ifdef NO_GZCOMPRESS
err = Z_STREAM_ERROR;
#else
err = deflateInit2(&(s->stream), level,
Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
/* windowBits is passed < 0 to suppress zlib header */
s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
#endif
if (err != Z_OK || s->outbuf == Z_NULL) {
return destroy(s), (gzFile)Z_NULL;
}
} else {
s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
err = inflateInit2(&(s->stream), -MAX_WBITS);
/* windowBits is passed < 0 to tell that there is no zlib header.
* Note that in this case inflate *requires* an extra "dummy" byte
* after the compressed stream in order to complete decompression and
* return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
* present after the compressed stream.
*/
if (err != Z_OK || s->inbuf == Z_NULL) {
return destroy(s), (gzFile)Z_NULL;
}
}
s->stream.avail_out = Z_BUFSIZE;
errno = 0;
s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
if (s->file == NULL) {
return destroy(s), (gzFile)Z_NULL;
}
if (s->mode == 'w') {
/* Write a very simple .gz header:
*/
fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
s->start = 10L;
/* We use 10L instead of ftell(s->file) to because ftell causes an
* fflush on some systems. This version of the library doesn't use
* start anyway in write mode, so this initialization is not
* necessary.
*/
} else {
check_header(s); /* skip the .gz header */
s->start = ftell(s->file) - s->stream.avail_in;
}
return (gzFile)s;
}
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing.
*/
gzFile ZEXPORT gzopen (path, mode)
const char *path;
const char *mode;
{
return gz_open (path, mode, -1);
}
/* ===========================================================================
Associate a gzFile with the file descriptor fd. fd is not dup'ed here
to mimic the behavio(u)r of fdopen.
*/
gzFile ZEXPORT gzdopen (fd, mode)
int fd;
const char *mode;
{
char name[46]; /* allow for up to 128-bit integers */
if (fd < 0) return (gzFile)Z_NULL;
sprintf(name, "<fd:%d>", fd); /* for debugging */
return gz_open (name, mode, fd);
}
/* ===========================================================================
* Update the compression level and strategy
*/
int ZEXPORT gzsetparams (file, level, strategy)
gzFile file;
int level;
int strategy;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
/* Make room to allow flushing */
if (s->stream.avail_out == 0) {
s->stream.next_out = s->outbuf;
if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
s->z_err = Z_ERRNO;
}
s->stream.avail_out = Z_BUFSIZE;
}
return deflateParams (&(s->stream), level, strategy);
}
/* ===========================================================================
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
for end of file.
IN assertion: the stream s has been sucessfully opened for reading.
*/
local int get_byte(s)
gz_stream *s;
{
if (s->z_eof) return EOF;
if (s->stream.avail_in == 0) {
errno = 0;
s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
if (s->stream.avail_in == 0) {
s->z_eof = 1;
if (ferror(s->file)) s->z_err = Z_ERRNO;
return EOF;
}
s->stream.next_in = s->inbuf;
}
s->stream.avail_in--;
return *(s->stream.next_in)++;
}
/* ===========================================================================
Check the gzip header of a gz_stream opened for reading. Set the stream
mode to transparent if the gzip magic header is not present; set s->err
to Z_DATA_ERROR if the magic header is present but the rest of the header
is incorrect.
IN assertion: the stream s has already been created sucessfully;
s->stream.avail_in is zero for the first time, but may be non-zero
for concatenated .gz files.
*/
local void check_header(s)
gz_stream *s;
{
int method; /* method byte */
int flags; /* flags byte */
uInt len;
int c;
/* Assure two bytes in the buffer so we can peek ahead -- handle case
where first byte of header is at the end of the buffer after the last
gzip segment */
len = s->stream.avail_in;
if (len < 2) {
if (len) s->inbuf[0] = s->stream.next_in[0];
errno = 0;
len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
s->stream.avail_in += len;
s->stream.next_in = s->inbuf;
if (s->stream.avail_in < 2) {
s->transparent = s->stream.avail_in;
return;
}
}
/* Peek ahead to check the gzip magic header */
if (s->stream.next_in[0] != gz_magic[0] ||
s->stream.next_in[1] != gz_magic[1]) {
s->transparent = 1;
return;
}
s->stream.avail_in -= 2;
s->stream.next_in += 2;
/* Check the rest of the gzip header */
method = get_byte(s);
flags = get_byte(s);
if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
s->z_err = Z_DATA_ERROR;
return;
}
/* Discard time, xflags and OS code: */
for (len = 0; len < 6; len++) (void)get_byte(s);
if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
len = (uInt)get_byte(s);
len += ((uInt)get_byte(s))<<8;
/* len is garbage if EOF but the loop below will quit anyway */
while (len-- != 0 && get_byte(s) != EOF) ;
}
if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
while ((c = get_byte(s)) != 0 && c != EOF) ;
}
if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
while ((c = get_byte(s)) != 0 && c != EOF) ;
}
if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
for (len = 0; len < 2; len++) (void)get_byte(s);
}
s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
}
/* ===========================================================================
* Cleanup then free the given gz_stream. Return a zlib error code.
Try freeing in the reverse order of allocations.
*/
local int destroy (s)
gz_stream *s;
{
int err = Z_OK;
if (!s) return Z_STREAM_ERROR;
TRYFREE(s->msg);
if (s->stream.state != NULL) {
if (s->mode == 'w') {
#ifdef NO_GZCOMPRESS
err = Z_STREAM_ERROR;
#else
err = deflateEnd(&(s->stream));
#endif
} else if (s->mode == 'r') {
err = inflateEnd(&(s->stream));
}
}
if (s->file != NULL && fclose(s->file)) {
#ifdef ESPIPE
if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
#endif
err = Z_ERRNO;
}
if (s->z_err < 0) err = s->z_err;
TRYFREE(s->inbuf);
TRYFREE(s->outbuf);
TRYFREE(s->path);
TRYFREE(s);
return err;
}
/* ===========================================================================
Reads the given number of uncompressed bytes from the compressed file.
gzread returns the number of bytes actually read (0 for end of file).
*/
int ZEXPORT gzread (file, buf, len)
gzFile file;
voidp buf;
unsigned len;
{
gz_stream *s = (gz_stream*)file;
Bytef *start = (Bytef*)buf; /* starting point for crc computation */
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
if (s->z_err == Z_STREAM_END) return 0; /* EOF */
next_out = (Byte*)buf;
s->stream.next_out = (Bytef*)buf;
s->stream.avail_out = len;
if (s->stream.avail_out && s->back != EOF) {
*next_out++ = s->back;
s->stream.next_out++;
s->stream.avail_out--;
s->back = EOF;
s->out++;
start++;
if (s->last) {
s->z_err = Z_STREAM_END;
return 1;
}
}
while (s->stream.avail_out != 0) {
if (s->transparent) {
/* Copy first the lookahead bytes: */
uInt n = s->stream.avail_in;
if (n > s->stream.avail_out) n = s->stream.avail_out;
if (n > 0) {
zmemcpy(s->stream.next_out, s->stream.next_in, n);
next_out += n;
s->stream.next_out = next_out;
s->stream.next_in += n;
s->stream.avail_out -= n;
s->stream.avail_in -= n;
}
if (s->stream.avail_out > 0) {
s->stream.avail_out -=
(uInt)fread(next_out, 1, s->stream.avail_out, s->file);
}
len -= s->stream.avail_out;
s->in += len;
s->out += len;
if (len == 0) s->z_eof = 1;
return (int)len;
}
if (s->stream.avail_in == 0 && !s->z_eof) {
errno = 0;
s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
if (s->stream.avail_in == 0) {
s->z_eof = 1;
if (ferror(s->file)) {
s->z_err = Z_ERRNO;
break;
}
}
s->stream.next_in = s->inbuf;
}
s->in += s->stream.avail_in;
s->out += s->stream.avail_out;
s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
s->in -= s->stream.avail_in;
s->out -= s->stream.avail_out;
if (s->z_err == Z_STREAM_END) {
/* Check CRC and original size */
s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
start = s->stream.next_out;
if (getLong(s) != s->crc) {
s->z_err = Z_DATA_ERROR;
} else {
(void)getLong(s);
/* The uncompressed length returned by above getlong() may be
* different from s->out in case of concatenated .gz files.
* Check for such files:
*/
check_header(s);
if (s->z_err == Z_OK) {
inflateReset(&(s->stream));
s->crc = crc32(0L, Z_NULL, 0);
}
}
}
if (s->z_err != Z_OK || s->z_eof) break;
}
s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
if (len == s->stream.avail_out &&
(s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO))
return -1;
return (int)(len - s->stream.avail_out);
}
/* ===========================================================================
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
int ZEXPORT gzgetc(file)
gzFile file;
{
unsigned char c;
return gzread(file, &c, 1) == 1 ? c : -1;
}
/* ===========================================================================
Push one byte back onto the stream.
*/
int ZEXPORT gzungetc(c, file)
int c;
gzFile file;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'r' || c == EOF || s->back != EOF) return EOF;
s->back = c;
s->out--;
s->last = (s->z_err == Z_STREAM_END);
if (s->last) s->z_err = Z_OK;
s->z_eof = 0;
return c;
}
/* ===========================================================================
Reads bytes from the compressed file until len-1 characters are
read, or a newline character is read and transferred to buf, or an
end-of-file condition is encountered. The string is then terminated
with a null character.
gzgets returns buf, or Z_NULL in case of error.
The current implementation is not optimized at all.
*/
char * ZEXPORT gzgets(file, buf, len)
gzFile file;
char *buf;
int len;
{
char *b = buf;
if (buf == Z_NULL || len <= 0) return Z_NULL;
while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
*buf = '\0';
return b == buf && len > 0 ? Z_NULL : b;
}
#ifndef NO_GZCOMPRESS
/* ===========================================================================
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of bytes actually written (0 in case of error).
*/
int ZEXPORT gzwrite (file, buf, len)
gzFile file;
voidpc buf;
unsigned len;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
s->stream.next_in = (Bytef*)buf;
s->stream.avail_in = len;
while (s->stream.avail_in != 0) {
if (s->stream.avail_out == 0) {
s->stream.next_out = s->outbuf;
if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
s->z_err = Z_ERRNO;
break;
}
s->stream.avail_out = Z_BUFSIZE;
}
s->in += s->stream.avail_in;
s->out += s->stream.avail_out;
s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
s->in -= s->stream.avail_in;
s->out -= s->stream.avail_out;
if (s->z_err != Z_OK) break;
}
s->crc = crc32(s->crc, (const Bytef *)buf, len);
return (int)(len - s->stream.avail_in);
}
/* ===========================================================================
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written (0 in case of error).
*/
#ifdef STDC
#include <stdarg.h>
int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
{
char buf[Z_PRINTF_BUFSIZE];
va_list va;
int len;
buf[sizeof(buf) - 1] = 0;
va_start(va, format);
#ifdef NO_vsnprintf
# ifdef HAS_vsprintf_void
(void)vsprintf(buf, format, va);
va_end(va);
for (len = 0; len < sizeof(buf); len++)
if (buf[len] == 0) break;
# else
len = vsprintf(buf, format, va);
va_end(va);
# endif
#else
# ifdef HAS_vsnprintf_void
(void)vsnprintf(buf, sizeof(buf), format, va);
va_end(va);
len = strlen(buf);
# else
len = vsnprintf(buf, sizeof(buf), format, va);
va_end(va);
# endif
#endif
if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
return 0;
return gzwrite(file, buf, (unsigned)len);
}
#else /* not ANSI C */
int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
gzFile file;
const char *format;
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
{
char buf[Z_PRINTF_BUFSIZE];
int len;
buf[sizeof(buf) - 1] = 0;
#ifdef NO_snprintf
# ifdef HAS_sprintf_void
sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
for (len = 0; len < sizeof(buf); len++)
if (buf[len] == 0) break;
# else
len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
# endif
#else
# ifdef HAS_snprintf_void
snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
len = strlen(buf);
# else
len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
# endif
#endif
if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0)
return 0;
return gzwrite(file, buf, len);
}
#endif
/* ===========================================================================
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
int ZEXPORT gzputc(file, c)
gzFile file;
int c;
{
unsigned char cc = (unsigned char) c; /* required for big endian systems */
return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
}
/* ===========================================================================
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
int ZEXPORT gzputs(file, s)
gzFile file;
const char *s;
{
return gzwrite(file, (char*)s, (unsigned)strlen(s));
}
/* ===========================================================================
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function.
*/
local int do_flush (file, flush)
gzFile file;
int flush;
{
uInt len;
int done = 0;
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
s->stream.avail_in = 0; /* should be zero already anyway */
for (;;) {
len = Z_BUFSIZE - s->stream.avail_out;
if (len != 0) {
if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
s->z_err = Z_ERRNO;
return Z_ERRNO;
}
s->stream.next_out = s->outbuf;
s->stream.avail_out = Z_BUFSIZE;
}
if (done) break;
s->out += s->stream.avail_out;
s->z_err = deflate(&(s->stream), flush);
s->out -= s->stream.avail_out;
/* Ignore the second of two consecutive flushes: */
if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
/* deflate has finished flushing only when it hasn't used up
* all the available space in the output buffer:
*/
done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
}
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
}
int ZEXPORT gzflush (file, flush)
gzFile file;
int flush;
{
gz_stream *s = (gz_stream*)file;
int err = do_flush (file, flush);
if (err) return err;
fflush(s->file);
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
}
#endif /* NO_GZCOMPRESS */
/* ===========================================================================
Sets the starting position for the next gzread or gzwrite on the given
compressed file. The offset represents a number of bytes in the
gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error.
SEEK_END is not implemented, returns error.
In this version of the library, gzseek can be extremely slow.
*/
z_off_t ZEXPORT gzseek (file, offset, whence)
gzFile file;
z_off_t offset;
int whence;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || whence == SEEK_END ||
s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
return -1L;
}
if (s->mode == 'w') {
#ifdef NO_GZCOMPRESS
return -1L;
#else
if (whence == SEEK_SET) {
offset -= s->in;
}
if (offset < 0) return -1L;
/* At this point, offset is the number of zero bytes to write. */
if (s->inbuf == Z_NULL) {
s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
if (s->inbuf == Z_NULL) return -1L;
zmemzero(s->inbuf, Z_BUFSIZE);
}
while (offset > 0) {
uInt size = Z_BUFSIZE;
if (offset < Z_BUFSIZE) size = (uInt)offset;
size = gzwrite(file, s->inbuf, size);
if (size == 0) return -1L;
offset -= size;
}
return s->in;
#endif
}
/* Rest of function is for reading only */
/* compute absolute position */
if (whence == SEEK_CUR) {
offset += s->out;
}
if (offset < 0) return -1L;
if (s->transparent) {
/* map to fseek */
s->back = EOF;
s->stream.avail_in = 0;
s->stream.next_in = s->inbuf;
if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
s->in = s->out = offset;
return offset;
}
/* For a negative seek, rewind and use positive seek */
if (offset >= s->out) {
offset -= s->out;
} else if (gzrewind(file) < 0) {
return -1L;
}
/* offset is now the number of bytes to skip. */
if (offset != 0 && s->outbuf == Z_NULL) {
s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
if (s->outbuf == Z_NULL) return -1L;
}
if (offset && s->back != EOF) {
s->back = EOF;
s->out++;
offset--;
if (s->last) s->z_err = Z_STREAM_END;
}
while (offset > 0) {
int size = Z_BUFSIZE;
if (offset < Z_BUFSIZE) size = (int)offset;
size = gzread(file, s->outbuf, (uInt)size);
if (size <= 0) return -1L;
offset -= size;
}
return s->out;
}
/* ===========================================================================
Rewinds input file.
*/
int ZEXPORT gzrewind (file)
gzFile file;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'r') return -1;
s->z_err = Z_OK;
s->z_eof = 0;
s->back = EOF;
s->stream.avail_in = 0;
s->stream.next_in = s->inbuf;
s->crc = crc32(0L, Z_NULL, 0);
if (!s->transparent) (void)inflateReset(&s->stream);
s->in = 0;
s->out = 0;
return fseek(s->file, s->start, SEEK_SET);
}
/* ===========================================================================
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
*/
z_off_t ZEXPORT gztell (file)
gzFile file;
{
return gzseek(file, 0L, SEEK_CUR);
}
/* ===========================================================================
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
int ZEXPORT gzeof (file)
gzFile file;
{
gz_stream *s = (gz_stream*)file;
/* With concatenated compressed files that can have embedded
* crc trailers, z_eof is no longer the only/best indicator of EOF
* on a gz_stream. Handle end-of-stream error explicitly here.
*/
if (s == NULL || s->mode != 'r') return 0;
if (s->z_eof) return 1;
return s->z_err == Z_STREAM_END;
}
/* ===========================================================================
Returns 1 if reading and doing so transparently, otherwise zero.
*/
int ZEXPORT gzdirect (file)
gzFile file;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL || s->mode != 'r') return 0;
return s->transparent;
}
/* ===========================================================================
Outputs a long in LSB order to the given file
*/
local void putLong (file, x)
FILE *file;
uLong x;
{
int n;
for (n = 0; n < 4; n++) {
fputc((int)(x & 0xff), file);
x >>= 8;
}
}
/* ===========================================================================
Reads a long in LSB order from the given gz_stream. Sets z_err in case
of error.
*/
local uLong getLong (s)
gz_stream *s;
{
uLong x = (uLong)get_byte(s);
int c;
x += ((uLong)get_byte(s))<<8;
x += ((uLong)get_byte(s))<<16;
c = get_byte(s);
if (c == EOF) s->z_err = Z_DATA_ERROR;
x += ((uLong)c)<<24;
return x;
}
/* ===========================================================================
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state.
*/
int ZEXPORT gzclose (file)
gzFile file;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL) return Z_STREAM_ERROR;
if (s->mode == 'w') {
#ifdef NO_GZCOMPRESS
return Z_STREAM_ERROR;
#else
if (do_flush (file, Z_FINISH) != Z_OK)
return destroy((gz_stream*)file);
putLong (s->file, s->crc);
putLong (s->file, (uLong)(s->in & 0xffffffff));
#endif
}
return destroy((gz_stream*)file);
}
#ifdef STDC
# define zstrerror(errnum) strerror(errnum)
#else
# define zstrerror(errnum) ""
#endif
/* ===========================================================================
Returns the error message for the last error which occurred on the
given compressed file. errnum is set to zlib error number. If an
error occurred in the file system and not in the compression library,
errnum is set to Z_ERRNO and the application may consult errno
to get the exact error code.
*/
const char * ZEXPORT gzerror (file, errnum)
gzFile file;
int *errnum;
{
char *m;
gz_stream *s = (gz_stream*)file;
if (s == NULL) {
*errnum = Z_STREAM_ERROR;
return (const char*)ERR_MSG(Z_STREAM_ERROR);
}
*errnum = s->z_err;
if (*errnum == Z_OK) return (const char*)"";
m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
TRYFREE(s->msg);
s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
if (s->msg == Z_NULL) return (const char*)ERR_MSG(Z_MEM_ERROR);
strcpy(s->msg, s->path);
strcat(s->msg, ": ");
strcat(s->msg, m);
return (const char*)s->msg;
}
/* ===========================================================================
Clear the error and end-of-file flags, and do the same for the real file.
*/
void ZEXPORT gzclearerr (file)
gzFile file;
{
gz_stream *s = (gz_stream*)file;
if (s == NULL) return;
if (s->z_err != Z_STREAM_END) s->z_err = Z_OK;
s->z_eof = 0;
clearerr(s->file);
}
| [
"tom@alteredworlds.com"
] | tom@alteredworlds.com |
f746eae89b9511fadcdd6f04327d05f9a56fd471 | 4f792b2f12862857b06b379e2185f061fae0b61d | /src/utils.c | 15c0dc29a16e7d5916e103e8c50a0cc9795be0e3 | [] | no_license | Manilator/SO-1819 | f89665a76b8ca794d9c3152fd7999387e4e2e525 | 363dac17a302889bc151c3daa31ace2b34ba1902 | refs/heads/master | 2022-12-27T22:08:03.128692 | 2020-10-16T17:58:07 | 2020-10-16T17:58:07 | 179,303,751 | 1 | 0 | null | 2020-10-16T17:58:09 | 2019-04-03T14:09:10 | C | UTF-8 | C | false | false | 296 | c | #include "utils.h"
ssize_t readln(int fildes, void *buf, size_t nbyte) {
size_t n = 0;
char *buff = (char *)buf;
while (read(fildes, buff + n, 1)) {
if (buff[n] == '\n') {
n++;
break;
}
if (n >= nbyte - 1) {
n++;
break;
}
n++;
}
return n;
} | [
"manilator777@gmail.com"
] | manilator777@gmail.com |
e66f3f10d37640da8b352570f96509088f0589ba | a3c604effcb34c7a9594a7a37e2ec618aab4c74f | /reference/cvs/jul285/news/c_news.h | 32ef78312083a2509e258818a0f1c2f22a861694 | [] | no_license | jvonwimm/aleph64bit | 09d9d48db51ed8c5f868b5409c6b7a78bfff8e6f | a779f00fd147a2fd3b1f81e0d65ca09509045c88 | refs/heads/main | 2023-02-04T06:10:49.338430 | 2020-12-16T00:59:48 | 2020-12-16T00:59:48 | 301,156,974 | 0 | 2 | null | null | null | null | UTF-8 | C | false | false | 686 | h | C! 1st entry in C_SET
! JULIA 280
CFPNMP, CRCJOB, CTHCLU : replace WRITE(6, by WRITE(IW(6),
(H. Drevermann, Feb 96)
CTKCHG : opening "'" should have a closing "'" within the same
line for cvs (F. Ranjard, Feb 96)
* corr file 279.1
CASHET : remove comments after *CA for LIGHT (P. Comas, Nov 95)
! JULIA 279
! JULIA 275
CDANG : restrict COMN1 to [-1.,1.] to avoid precision problems
(P. Comas, 18-OCT-1994)
CTRPAR : avoid division by zero: no need to step in the helix if
STEP = 0 (A. Bonissant,P. Comas, 29-SEP-1994)
! JULIA 272
CINIJO : define POT name-indices even when no output file is required
| [
"jvonwimm@protonmail.com"
] | jvonwimm@protonmail.com |
2b0b5ea2ca3e7fdaaaaa92b657cfaae5af5b681e | eb2d07f2b26295b535ae2edf2fae175916882028 | /gsk/utils.h | 4d83f6ee87df3b5d29276e081565f94415279f89 | [] | no_license | velicast/OS-Snake | c78b5dff17b855699ec7f3ab22ee21490e490318 | 7dacb36e8af9e1b671a667d1cc55d64f89827be1 | refs/heads/master | 2021-06-28T03:09:01.400496 | 2017-08-15T03:16:20 | 2017-08-15T03:16:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 630 | h | /*
* Algunas funciones de utileria
* eduarcastrillo@gmail.com
*/
#ifndef _UTILS_H
#define _UTILS_H
#include "common.h"
/* Tiempo en segundos del reloj del CMOS, Real-Time Clock */
unsigned int time();
/* Generador de numeros pseudo-aleatorios */
int rand();
void srand(unsigned int __seed);
/* Caracteres */
int isdigit(int __c);
int isxdigit(int __c);
/* Conversion de cadenas a valores numericos */
int xatoi(const char *__str_hex);
int atoi(const char *__str_dec);
/* Conversion de valores numericos a cadenas */
void parsex(char *__buff, unsigned __hex);
void parsei(char *__buff, int __dec);
#endif /* _UTILS_H */
| [
"eduarcastrillo@gmail"
] | eduarcastrillo@gmail |
b002c78c1b09f43001e9e22d44a04342906c6ec0 | 745df397854a1a06a78bd1bb60c90a3919a48393 | /STM32CubeExpansion_MEMS1_V7.1.0/Projects/STM32L476RG-Nucleo/Examples/IKS01A3/LIS2DW12_6DOrientation/Src/stm32l4xx_it.c | 0c4f39dd99ecdd90e32eec98ca235ab99da38af8 | [] | no_license | imwangwang/en.x-cube-mems1 | 8a7aafea8f33fa71685ee6c0832d960ad923917e | dc883acd878193b1648f66ba829eab0e7dc780ba | refs/heads/master | 2022-04-24T06:24:41.560972 | 2020-04-24T04:07:52 | 2020-04-24T04:07:52 | 258,400,725 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,175 | c | /* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32l4xx_it.c
* @brief Interrupt Service Routines.
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32l4xx_it.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN TD */
/* USER CODE END TD */
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
/* USER CODE BEGIN EV */
/* USER CODE END EV */
/******************************************************************************/
/* Cortex-M4 Processor Interruption and Exception Handlers */
/******************************************************************************/
/**
* @brief This function handles Non maskable interrupt.
*/
void NMI_Handler(void)
{
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
/* USER CODE END NonMaskableInt_IRQn 0 */
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
/* USER CODE END NonMaskableInt_IRQn 1 */
}
/**
* @brief This function handles Hard fault interrupt.
*/
void HardFault_Handler(void)
{
/* USER CODE BEGIN HardFault_IRQn 0 */
/* USER CODE END HardFault_IRQn 0 */
while (1)
{
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
/* USER CODE END W1_HardFault_IRQn 0 */
}
}
/**
* @brief This function handles Memory management fault.
*/
void MemManage_Handler(void)
{
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
/* USER CODE END MemoryManagement_IRQn 0 */
while (1)
{
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
/* USER CODE END W1_MemoryManagement_IRQn 0 */
}
}
/**
* @brief This function handles Prefetch fault, memory access fault.
*/
void BusFault_Handler(void)
{
/* USER CODE BEGIN BusFault_IRQn 0 */
/* USER CODE END BusFault_IRQn 0 */
while (1)
{
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
/* USER CODE END W1_BusFault_IRQn 0 */
}
}
/**
* @brief This function handles Undefined instruction or illegal state.
*/
void UsageFault_Handler(void)
{
/* USER CODE BEGIN UsageFault_IRQn 0 */
/* USER CODE END UsageFault_IRQn 0 */
while (1)
{
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
/* USER CODE END W1_UsageFault_IRQn 0 */
}
}
/**
* @brief This function handles System service call via SWI instruction.
*/
void SVC_Handler(void)
{
/* USER CODE BEGIN SVCall_IRQn 0 */
/* USER CODE END SVCall_IRQn 0 */
/* USER CODE BEGIN SVCall_IRQn 1 */
/* USER CODE END SVCall_IRQn 1 */
}
/**
* @brief This function handles Debug monitor.
*/
void DebugMon_Handler(void)
{
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
/* USER CODE END DebugMonitor_IRQn 0 */
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
/* USER CODE END DebugMonitor_IRQn 1 */
}
/**
* @brief This function handles Pendable request for system service.
*/
void PendSV_Handler(void)
{
/* USER CODE BEGIN PendSV_IRQn 0 */
/* USER CODE END PendSV_IRQn 0 */
/* USER CODE BEGIN PendSV_IRQn 1 */
/* USER CODE END PendSV_IRQn 1 */
}
/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
/******************************************************************************/
/* STM32L4xx Peripheral Interrupt Handlers */
/* Add here the Interrupt Handlers for the used peripherals. */
/* For the available peripheral interrupt handler names, */
/* please refer to the startup file (startup_stm32l4xx.s). */
/******************************************************************************/
/**
* @brief This function handles EXTI line0 interrupt.
*/
void EXTI0_IRQHandler(void)
{
/* USER CODE BEGIN EXTI0_IRQn 0 */
/* USER CODE END EXTI0_IRQn 0 */
HAL_EXTI_IRQHandler(&H_EXTI_0);
/* USER CODE BEGIN EXTI0_IRQn 1 */
/* USER CODE END EXTI0_IRQn 1 */
}
/**
* @brief This function handles EXTI line[15:10] interrupts.
*/
void EXTI15_10_IRQHandler(void)
{
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
/* USER CODE END EXTI15_10_IRQn 0 */
HAL_EXTI_IRQHandler(&H_EXTI_13);
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
/* USER CODE END EXTI15_10_IRQn 1 */
}
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"imwangwang@gmail.com"
] | imwangwang@gmail.com |
bd8bced730e1d7692fe970567316d5ec050ce194 | a86995a16ba2e574376c882c3a9eead8143dd4f8 | /STM32Cube_FW_F4_V1.9.0/Drivers/BSP/STM324xG_EVAL/stm324xg_eval_ts.c | 98c4f8d24ba44baf62f9dc28686b024198b2ce01 | [] | no_license | umapathiuit/Stm32-Tools-Evaluation | ded5f569677c8e9cbe708a57b5db19780a86fd6c | e9fd061f48f50501606bc237c6773c2b6c28d345 | refs/heads/master | 2020-12-02T17:11:19.014644 | 2015-11-23T07:45:38 | 2015-11-23T07:45:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,529 | c | /**
******************************************************************************
* @file stm324xg_eval_ts.c
* @author MCD Application Team
* @version V2.1.0
* @date 14-August-2015
* @brief This file provides a set of functions needed to manage the touch
* screen on STM324xG-EVAL evaluation board.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* File Info : -----------------------------------------------------------------
User NOTES
1. How To use this driver:
--------------------------
- This driver is used to drive the touch screen module of the STM324xG-EVAL
evaluation board on the ILI9325 LCD mounted on MB785 daughter board .
- The STMPE811 IO expander device component driver must be included with this
driver in order to run the TS module commanded by the IO expander device
mounted on the evaluation board.
2. Driver description:
---------------------
+ Initialization steps:
o Initialize the TS module using the BSP_TS_Init() function. This
function includes the MSP layer hardware resources initialization and the
communication layer configuration to start the TS use. The LCD size properties
(x and y) are passed as parameters.
o If TS interrupt mode is desired, you must configure the TS interrupt mode
by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
as an external interrupt whenever a touch is detected.
+ Touch screen use
o The touch screen state is captured whenever the function BSP_TS_GetState() is
used. This function returns information about the last LCD touch occurred
in the TS_StateTypeDef structure.
o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
the interrupt status. To clear the IT pending bits, you should call the
function BSP_TS_ITClear().
o The IT is handled using the corresponding external interrupt IRQ handler,
the user IT callback treatment is implemented on the same external interrupt
callback.
------------------------------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/
#include "stm324xg_eval_ts.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup STM324xG_EVAL
* @{
*/
/** @defgroup STM324xG_EVAL_TS
* @{
*/
/** @defgroup STM324xG_EVAL_TS_Private_Types_Definitions
* @{
*/
/**
* @}
*/
/** @defgroup STM324xG_EVAL_TS_Private_Defines
* @{
*/
/**
* @}
*/
/** @defgroup STM324xG_EVAL_TS_Private_Macros
* @{
*/
/**
* @}
*/
/** @defgroup STM324xG_EVAL_TS_Private_Variables
* @{
*/
static TS_DrvTypeDef *ts_driver;
static uint16_t ts_x_boundary, ts_y_boundary;
static uint8_t ts_orientation;
/**
* @}
*/
/** @defgroup STM324xG_EVAL_TS_Private_Function_Prototypes
* @{
*/
/**
* @}
*/
/** @defgroup STM324xG_EVAL_TS_Private_Functions
* @{
*/
/**
* @brief Initializes and configures the touch screen functionalities and
* configures all necessary hardware resources (GPIOs, clocks..).
* @param xSize: Maximum X size of the TS area on LCD
* ySize: Maximum Y size of the TS area on LCD
* @retval TS_OK if all initializations are OK. Other value if error.
*/
uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize)
{
uint8_t ret = TS_ERROR;
if(stmpe811_ts_drv.ReadID(TS_I2C_ADDRESS) == STMPE811_ID)
{
/* Initialize the TS driver structure */
ts_driver = &stmpe811_ts_drv;
/* Initialize x and y positions boundaries */
ts_x_boundary = xSize;
ts_y_boundary = ySize;
ts_orientation = TS_SWAP_XY;
ret = TS_OK;
}
if(ret == TS_OK)
{
/* Initialize the LL TS Driver */
ts_driver->Init(TS_I2C_ADDRESS);
ts_driver->Start(TS_I2C_ADDRESS);
}
return ret;
}
/**
* @brief Configures and enables the touch screen interrupts.
* @param None
* @retval TS_OK if all initializations are OK. Other value if error.
*/
uint8_t BSP_TS_ITConfig(void)
{
/* Call component driver to enable TS ITs */
ts_driver->EnableIT(TS_I2C_ADDRESS);
return TS_OK;
}
/**
* @brief Gets the touch screen interrupt status.
* @param None
* @retval TS_OK if all initializations are OK. Other value if error.
*/
uint8_t BSP_TS_ITGetStatus(void)
{
/* Call component driver to enable TS ITs */
return (ts_driver->GetITStatus(TS_I2C_ADDRESS));
}
/**
* @brief Returns status and positions of the touch screen.
* @param TS_State: Pointer to touch screen current state structure
* @retval TS_OK if all initializations are OK. Other value if error.
*/
uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
{
static uint32_t _x = 0, _y = 0;
uint16_t xDiff, yDiff , x , y;
uint16_t swap;
TS_State->TouchDetected = ts_driver->DetectTouch(TS_I2C_ADDRESS);
if(TS_State->TouchDetected)
{
ts_driver->GetXY(TS_I2C_ADDRESS, &x, &y);
if(ts_orientation & TS_SWAP_X)
{
x = 4096 - x;
}
if(ts_orientation & TS_SWAP_Y)
{
y = 4096 - y;
}
if(ts_orientation & TS_SWAP_XY)
{
swap = y;
y = x;
x = swap;
}
xDiff = x > _x? (x - _x): (_x - x);
yDiff = y > _y? (y - _y): (_y - y);
if (xDiff + yDiff > 5)
{
_x = x;
_y = y;
}
TS_State->x = (ts_x_boundary * _x) >> 12;
TS_State->y = (ts_y_boundary * _y) >> 12;
}
return TS_OK;
}
/**
* @brief Clears all touch screen interrupts.
* @param None
* @retval None
*/
void BSP_TS_ITClear(void)
{
ts_driver->ClearIT(TS_I2C_ADDRESS);
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"git@jme.de"
] | git@jme.de |
d05870f1737778220cb37c14a4400185edbd8ed1 | afa23811554d9e8d7fdac78d022d2b030ec49093 | /Networking/TCPSocketServer/TCPSocketServer/CFSocketServer.h | 382de596471a9da4fb63f1f7d91beacf24faa999 | [] | no_license | watergirl/socket | 4860b9b74ed1f67a8a771334ae253c07115b49ed | 70d8f671225a335982aec8b3e3086237ce5cd4d1 | refs/heads/master | 2021-01-10T01:40:20.277206 | 2015-12-18T05:15:05 | 2015-12-18T05:15:05 | 48,215,751 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 596 | h | //
// CFSocketServer.h
// TCPSocketServer
//
// Created by Tarena on 13-11-20.
// Copyright (c) 2013年 Tarena. All rights reserved.
//
#ifndef TCPSocketServer_CFSocketServer_h
#define TCPSocketServer_CFSocketServer_h
//客户端连接到服务器的回调函数
void AcceptCallBack(CFSocketRef, CFSocketCallBackType, CFDataRef, const void*, void*);
//客户端读取数据时的回调函数
void WriteStreamClientCallBack(CFWriteStreamRef, CFStreamEventType, void*);
//客户端写入数据时的回调函数
void ReadStreamClientCallBack(CFReadStreamRef, CFStreamEventType, void*);
#endif
| [
"ios-23@ACC80830.ipt.aol.com"
] | ios-23@ACC80830.ipt.aol.com |
eeca6d6f39c358f8c2466d9a27d1dc083d25000f | 054b5579ad6c2aba467bcf1b397346b9af1689e5 | /DialARide/Debug/shortestPath.c | 555d22a42c864461b4db34e2bd492da8eda790d4 | [] | no_license | charanshetty/Algorithm | e9c7f1ea809571925a62d49fa7d0caf310b2b032 | 43853c45ae0a38314072ce8ff2c7d8c2ab91dbac | refs/heads/master | 2021-01-23T10:00:38.480911 | 2015-05-22T07:32:07 | 2015-05-22T07:32:07 | 13,768,552 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,172 | c | /*to be done
* define 2 struct for a node and an edge
* node includes the list of edges
* via ,the previous node in tha path
* distance of that node
* its position if in heap
*
* edge includes node indicating the end point of this edge
* neigh included edges
* cost cost of the edge
*
* function to insert or add edges when 2 nodes an distance between is given
* insert_edge(node source,node destn,double distance)
* free_edge to remove an edge
*
* finding Distance
* calculate distances
* show the path
*
*
*
*
*/#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node node,*heap;
typedef struct edge edge;
struct edge {
node *end;
edge *neigh;
int cost;
};
struct node {
edge *edge;
node *thru;
char label[8];
double distance;
int index_heap;
};
#ifdef example
# define BLOCK_SIZE (1024*32-1)
#else
#define BLOCK_SIZE 15
#endif
edge *edge_root=0,*edge_next=0;
void insertEdge(node *a,node *b,double x)
{
if(edge_next==edge_root){ // at the beginning
edge_root=malloc(sizeof(edge)*(BLOCK_SIZE+1)); //allocating a block
edge_root[BLOCK_SIZE].neigh=edge_next;//pointing to itself
edge_next = edge_root+BLOCK_SIZE;//the next address after edge_root
}
//now we have a root edge whose next edge is edge_next
--edge_next;
edge_next -> end = b; //setting pointer to next node
edge_next -> cost = x;//setting cost to the edge
edge_next -> neigh = a;//node of the edge or the origin of the edge
a ->edge = edge_next;//edge corresponding to node a
}
void release_edge()
{
for(;edge_root;edge_root=edge_next){ //until edge_root=edge_next
edge_next = edge_root[BLOCK_SIZE].neigh;//find edge_next from edge_root
free(edge_root);// remove edge_root
//go on deleting the new root
}
heap *heap_n;
int heap_len;
void set_cost(node *end,node *thru,double dist){
int l,m;
//if the shortest path is known before i.e the node via is
//known and its distance is less than he new one
if(end->thru && dist>=end->distance) return;
/*set the new min distance,thru path,change the heap */
end->distance=dist;
end->thru = thru;
// take the previous index
l=end->index_heap;
if(!l)
l=++heap_len;//increment l;
/*else heapify ; take the parent node in the heap and compare till the root */
for(;l>1&&end->distance<heap_n[m=l/2]->distance;l=m)
(heap_n[l]=heap_n[m])->index_heap=l;//updating the new index of the child node
heap_n[l]=end; // updating the new node once it reached its position
end->index_heap=l;//updating node with its edge in heap
}
node *pop_que(){
node *end,*temp;
int l,m;
if(!heap_len)
return 0; //no heap
// remove the root element and put the tail there
end = heap[1];
temp=heap[heap_len--];
for(l=1;l<heap_len&&(m=2*l)<=heap_len;l=m)
{
if(m<heap_len&&heap_n[m]->distance>heap_n[m+1]->distance)m++;
if(heap_n[m]->distance>temp->distance)break;
}
heap_n[l]=temp;
temp->index_heap=l;
return end;
}
void calc_all(node *start){
node *lead;
edge *e;
set_dist(start, start, 0);
while ((lead = pop_queue()))
for (e = lead->edge; e; e = e->neigh)
set_dist(e->end, lead, lead->distance + e->cost);
}
void show_path(node *end)
{
if (end->thru == end)
printf("%s", end->label);
else if (!end->thru)
printf("%s(unreached)", end->label);
else {
show_path(end->thru);
printf("-> %s(%g) ", end->label, end->distance);
}
}
//main function
int main(void)
{
#ifndef BIG_EXAMPLE
int i;
# define N_NODES ('f' - 'a' + 1) //number of nodes
node *nodes = calloc(sizeof(node), N_NODES);//creating nodes
for (i = 0; i < N_NODES; i++) //set the names for each node
sprintf(nodes[i].label, "%c", 'a' + i);
# define E(a, b, c) insertEdge(nodes + (a - 'a'), nodes + (b - 'a'), c)
E('a', 'b', 7); E('a', 'c', 9); E('a', 'f', 14);
E('b', 'c', 10);E('b', 'd', 15);E('c', 'd', 11);
E('c', 'f', 2); E('d', 'e', 6); E('e', 'f', 9);
# undef E
heap = calloc(sizeof(heap), N_NODES + 1);
heap_len = 0;
calc_all(nodes);
for (i = 0; i < N_NODES; i++) {
show_path(nodes + i);
putchar('\n');
}
#if 0
free_edges();
free(heap);
free(nodes);
#endif
return 0;
}}
| [
"charan.m.shetty@gmail.com"
] | charan.m.shetty@gmail.com |
980bed274d1a51517c1391cc114b8abea74e348f | 55a30e2bad6a0dc332d2ca00f2ff5a7f3141efd8 | /Daekim/cub3D/20210303/temp/gnl/get_next_line.c | 6a5cba52f156f3ced13645c3de2637cf35d8d316 | [] | no_license | jungmyeong96/42sweethome | 4dbeb0b7b2272a4ede5309c236b8c0c21e12e6ef | 16c8aed39cc2971306a0843d5b01100858a3128d | refs/heads/master | 2023-06-15T09:06:56.233643 | 2021-07-22T04:13:29 | 2021-07-22T04:13:29 | 330,372,333 | 1 | 1 | null | 2021-03-25T20:37:24 | 2021-01-17T11:12:59 | C | UTF-8 | C | false | false | 2,327 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: daekim <daekim@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/11 20:14:27 by daekim #+# #+# */
/* Updated: 2021/03/02 05:02:44 by daekim ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
int ft_find(char *newline, char c)
{
int i;
i = 0;
while (newline[i])
{
if (newline[i] == c)
return (i);
i++;
}
return (-1);
}
int in_line(char **newline, char **line, int i)
{
char *ret;
(*newline)[i] = 0;
if (!(*line = ft_strdup2(*newline)))
return (-1);
if (!(ret = ft_strdup2(*newline + i + 1)))
return (-1);
free(*newline);
*newline = ret;
return (1);
}
int backup(char **newline, char **line, int r)
{
int new_idx;
if (r < 0)
return (-1);
if (*newline == 0)
{
*line = ft_strdup2("");
return (0);
}
if ((new_idx = ft_find(*newline, '\n')) >= 0)
return (in_line(newline, line, new_idx));
if (!(*line = ft_strdup2(*newline)))
return (-1);
free(*newline);
*newline = 0;
return (0);
}
int get_next_line(int fd, char **line)
{
static char *newline[OPEN_MAX];
char *buf;
char *temp;
int rd_size;
int new_idx;
if (!line || fd < 0 || BUFFER_SIZE < 1 || fd > OPEN_MAX)
return (-1);
if (!(buf = (char *)malloc(sizeof(char) * (BUFFER_SIZE + 1))))
return (-1);
while ((rd_size = read(fd, buf, BUFFER_SIZE)) > 0)
{
buf[rd_size] = 0;
if (!(temp = ft_strjoin2(newline[fd], buf)))
return (-1);
free(newline[fd]);
newline[fd] = temp;
if ((new_idx = ft_find(newline[fd], '\n')) >= 0)
{
free(buf);
return (in_line(&newline[fd], line, new_idx));
}
}
free(buf);
return (backup(&newline[fd], line, rd_size));
}
| [
"daekim@c4r1s8.42seoul.kr"
] | daekim@c4r1s8.42seoul.kr |
0aaac1d2a2c68859bfa614265765a900f450379f | eaae3529ea65c9be62e4b177a498dd0459396052 | /modified_lib_dw_ws/bkoropoff_trans.c | 9d7b5fc729dc0fae4e3be8e1f0533f649b19ecca | [] | no_license | mgsanusi/blame-dodger | badac55079b0bc84c1c3ddff9357caffd480b512 | c8b1f19d48e09200c9d59f3dda3b298ced7103d7 | refs/heads/master | 2021-01-20T04:50:14.975609 | 2018-01-12T00:02:14 | 2018-01-12T00:02:14 | 89,739,285 | 3 | 0 | null | null | null | null | UTF-8 | C | false | false | 127 | c | #include "portable.h"
#include <stdio.h>
#include <ac/string.h>
#include "back-bdb.h"
#include "lber_pvt.h"
#include "lutil.h"
| [
"marina@virginia.edu"
] | marina@virginia.edu |
8295535435598d0cbd20170b5e46ebdc6595c859 | 6b2b6c3a923206c17223c0905d8e9c01cc10fc60 | /libft/ft_strcat.c | 2a580f4fd2bd81136f2e805fdd6b19f549424586 | [] | no_license | sbelondr/fillit | 7be11000897f7ef5e95e66363a3faae230b11a2f | fc64a2258d488654d35d6ca8590f3f04fbe666dd | refs/heads/master | 2020-04-08T19:56:18.245641 | 2018-11-29T15:54:36 | 2018-11-29T15:54:36 | 159,677,081 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,128 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sbelondr <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/07 22:48:07 by sbelondr #+# #+# */
/* Updated: 2018/11/26 23:22:09 by sbelondr ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcat(char *s1, const char *s2)
{
int cnt_s2;
int cnt_s1;
cnt_s1 = 0;
cnt_s2 = 0;
while (s1[cnt_s1])
cnt_s1++;
while (s2[cnt_s2])
s1[cnt_s1++] = s2[cnt_s2++];
s1[cnt_s1] = '\0';
return (s1);
}
| [
"sbelondr@e1r4p13.42.fr"
] | sbelondr@e1r4p13.42.fr |
0318d9825b29c189d23678a536d6ba0a7ddcc7d4 | 27a93d65dcddd6654bd372351a9f9a5ca138e447 | /f_readxpm.h | 513c9753011b33d2cba074ca80bbf8b07f8399fa | [
"Xfig",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | coliveira/xfignew | 44182977bb8b5980b0d78db04ddb5b1e3443c6c0 | 770930da640cbe140dfefeddfc6075489abf6435 | refs/heads/master | 2016-09-06T09:50:39.909778 | 2008-04-08T19:56:35 | 2008-04-08T19:56:35 | 98,818 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 24 | h | extern int read_xpm ();
| [
"coliveira@princeton.com"
] | coliveira@princeton.com |
546ea0c1c70e49b38f7939311746e2e0ead0a6e7 | f9314d815f81f82efae3d322d6849e991e5da212 | /ggd/search.c | c5e9cbd9dc25de8070749a4db876280045838f69 | [] | no_license | bottlenome/tiny_utils | 68336cc7e7bf711d1648eff3a310095835ebd4c6 | f1ce841f3f3468660475f385b9b98ebf93982885 | refs/heads/master | 2020-04-12T01:27:55.841402 | 2017-02-02T11:25:22 | 2017-02-02T11:25:22 | 1,969,406 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,244 | c | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "slide.h"
#include "search.h"
#include "limits.h"
int matchCount(board *b)
{
int i = 0;
int matchCount = 0;
char matchChar = '1';
for(i = 0; i < b->w*b->h; i++){
if(b->b[i] == matchChar){
charInc(&matchChar);
matchCount++;
}
else if(b->b[i] == '='){
}
else{
break;
}
}
return matchCount;
}
void charInc(char *c){
if('1' <= *c && *c < '9'){
(*c)++;
}
else if(*c == '9'){
(*c) += 8;
}
else if('A' <= *c && *c < 'Z'){
(*c)++;
}
}
void setline(board *b, int line, char* result, int index)
{
char *countChar;
countChar = malloc(sizeof(char) * (b->w + 1));
setCountChar(b, countChar, line);
free(countChar);
}
double sumf(board *b, char* countChar){
int i = 0,place;
double result = 0;
while(countChar[i] != '\0'){
place = 0;
while(b->b[place] != countChar[i]){
place++;
}
result += euclid(b, countChar[i], place % b->w, place % b->h);
i++;
}
return result;
}
double euclid(board *b, char target, int x, int y){
int xd,yd;
xd = char2x(b,target) - x;
yd = char2y(b,target) - y;
return sqrt(x*x + y*y);
};
int char2x(board *b, char target){
return (char2int(target) - 1) % b->w;
}
int char2y(board *b, char target){
return (char2int(target) - 1) / b->w;
}
int char2int(char c){
if('1' <= c && c <= '9')
return (int)(c - '0');
else if('A' <= c && c <= 'Z')
return (int)(c - 'A' + 10);
else
return INT_MAX;
}
char place2char(int place){
if(0 <= place && place <= 8){
return '1' + place;
}
else if(9 <= place){
return 'A' + place - 9;
}
return 'x';
}
void setCountChar(board *b, char *countChar, int line){
int i;
int index = 0;
for(i = line*b->w; i < (line+1)*b->w; i++){
if(b->b[i] != '='){
countChar[index] = place2char(i);
}
}
countChar[index] = '\0';
}
int endCheck(board *b){
char c = '1';
int i;
for(i = 0; i < b->w * b->h; i++){
if(b->b[i] != c && b->b[i] != '=')
return i;
charInc(&c);
}
return i;
}
int leftEndCheck(board *b){
int x,y,place;
int count = 0;
for(x = 0; x < b->w; x++){
for(y = 0; y < b->h; y++){
place = x + y * b->w;
if(b->b[place] != place2char(place) && b->b[place] != '=')
return count;
count++;
}
}
return count;
}
unsigned int manhattanDistance(board *b)
{
unsigned int result = 0;
int i;
int xd,yd;
for(i = 0; i < b->w * b->h; i++){
if(b->b[i] != '=' && b->b[i] != '0'){
xd = abs(char2x(b,b->b[i]) - (i % b->w));
yd = abs(char2y(b,b->b[i]) - (i / b->w));
result += (xd + yd);
}
}
return result;
}
void checkResult(board *b, char* result, int resultSize){
int i;
board t;
copyBoard(&t, b);
printf("check start\n");
for(i = 0; i < resultSize; i++){
printf("move%c\n", result[i]);
move(&t, result[i]);
printBoard(t);
getchar();
}
}
//false like that
//1234
//xx=x
//56
unsigned int swapPlaceCheck(board *b){
int place;
int x;
int y;
place = endCheck(b);
x = place % b->w;
y = place / b->w;
if(y >= b->h - 1)
return 0;
while((place < (y + 1) * b->w) && b->b[place] != '='){
if(b->b[place + b->w] != place2char(place))
place++;
else
break;
}
//if check matched
return 5;
}
unsigned int windowManhattan(board *b)
{
unsigned int result = 0;
int i,place;
int xd,yd;
int height = 3;
int start;
start = (endCheck(b) / b->w);
if(start == -1)
start = 0;
for(i = 0; i < b->w * b->h; i++){
if(b->b[i] != '=' && b->b[i] != '0'){
place = char2int(b->b[i]);
if(start * b->w <= place && place < (start + height) * b->w){
xd = abs(char2x(b,b->b[i]) - (i % b->w));
yd = abs(char2y(b,b->b[i]) - (i / b->w));
result += (xd + yd);
}
else if((start + height) * b->w <= place){
result += b->w + b->h;
}
}
}
return result;
}
int TLwindowManhattan(board *b)
{
int x,y;
int place;
int xd,yd,i;
int result = 0;
place = topLeftEndCheck(b);
x = place % b->w;
y = place / b->w;
for(i = 0; i < b->w * b->h; i++){
if(b->b[i] != '=' && b->b[i] != '0'){
place = char2int(b->b[i]);
if(((place % b->w) == x && (int)(place / b->w) >= y) ||
((place % b->w) == x + 1 && (int)(place / b->w) >= y) ||
((place % b->w) >= x && (int)(place / b->w) == y) ||
((place % b->w) >= x && (int)(place / b->w) == y + 1) ){
xd = abs(char2x(b,b->b[i]) - (i % b->w));
yd = abs(char2y(b,b->b[i]) - (i / b->w));
result += (xd + yd);
}
else if((place % b->w) > x + 1 && (int)(place / b->w) > y + 1){
result += b->w + b->h;
}
}
}
return result;
}
int topLeftEndCheck(board *b){
int x = 0,y = 0,place,i;
while(x < b->w && y < b->h){
for(i = x; i < b->w; i++){
place = i + y * b->w;
if(b->b[place] != place2char(place) && b->b[place] != '=')
return x + y * b->w;
}
for(i = y; i < b->h; i++){
place = x + i * b->w;
if(b->b[place] != place2char(place) && b->b[place] != '=')
return x + y * b->w;
}
x++;
y++;
}
return x + y * b->w;
}
| [
"bottlenome@gmail.com"
] | bottlenome@gmail.com |
1bdbb64b6e668012a79733c69aa097b46ce50160 | 2b11b6f3dd45f3681bcbe976c358913a57e29f8c | /queue.c | d5a2b98f3e50c969ac8ad345c1cf760c7cc82998 | [] | no_license | kartik-kc/datastructure-c-hacktoberfest | b385bee51bb6d63544a797f112754364f9d807eb | cc88d3546b2e15c0484ccb5ab77b54722fc3c114 | refs/heads/master | 2022-12-28T00:53:43.676915 | 2020-10-06T06:25:34 | 2020-10-06T06:25:34 | 300,893,886 | 0 | 3 | null | 2020-10-06T06:25:36 | 2020-10-03T14:03:15 | C | UTF-8 | C | false | false | 1,882 | c | #include<stdio.h>
void insertion(int *rear,int *front,int queue[]);
void deletion(int *rear,int *front,int queue[]);
void display(int *rear,int *front,int queue[]);
void main()
{
int rear = -1, front = -1, queue[5],ch;
while(ch != 4)
{
printf("Enter the choice 1.insertion 2. deletion 3. display 4. exit: ");
scanf("%d",&ch);
switch(ch)
{
case 1:
{
insertion(&rear,&front,queue);
break;
}
case 2:
{
deletion(&rear,&front,queue);
break;
}
case 3:
{
display(&rear,&front,queue);
break;
}
case 4:
{
break;
}
default:
printf("enter a valid choice");
}
}
}
void insertion(int *rear,int *front,int queue[])
{
if (*rear>=4)
{
printf("queue overflow");
return;
}
else
if(*front==-1)
{
*front=*front + 1;
*rear = *rear + 1;
}
printf("enter the number you want to enter: ");
scanf("%d",&queue[*rear]);
(*rear)++;
}
void deletion(int *rear,int *front,int queue[])
{
if (*front <= -1)
{
printf("queue underflow\n");
return;
}
printf("element deleted %d\n",queue[*front]);
if ( (*rear)-1 == *front)
{
*rear=-1;
*front=-1;
}
else
{
(*front)++;
}
}
void display(int *rear,int *front,int queue[])
{
if (*front == -1)
printf("QUEUE IS EMPTY");
else
printf("Elements in queue are: \n");
for(int i = *front; i<*rear;i++)
{
printf("%d\n",queue[i]);
}
}
| [
"sv_shivansh@outlook.com"
] | sv_shivansh@outlook.com |
56f6003141a09be1c1df35dc380b5e3586a8ec3c | 3ff6aa2fce1d0c0d98d2c0cc521204f5e22d5402 | /include/linux/minix_fs.h | fcdb105857f04005f2f4bd36097856ba83e81cb5 | [
"MIT"
] | permissive | davitkalantaryan/wlac2 | 1c59c513db49d5c1594bf5246ec2f018ea0cd7e4 | 6ec0f88b04407a801c2bf4456044d6a86d589a3a | refs/heads/master | 2023-04-13T07:25:58.068081 | 2023-03-15T14:33:14 | 2023-03-15T14:33:14 | 199,640,620 | 0 | 0 | null | 2023-03-15T14:33:16 | 2019-07-30T11:42:58 | C | UTF-8 | C | false | false | 524 | h | //
// (c) 2015-2018 WLAC. For details refers to LICENSE.md
//
/*
* File: <linux/minix_f.h> For WINDOWS MFC
*
* Created on: Sep 23, 2016
* Author : Davit Kalantaryan (Email: davit.kalantaryan@desy.de)
*
*
*/
#ifndef __linux_minix_fs_h__
#define __linux_minix_fs_h__
#include <first_includes/common_include_for_headers.h>
#include <sdef_gem_windows.h>
__BEGIN_C_DECLS
//GEM_API_FAR int semget(key_t key, int nsems, int semflg);
__END_C_DECLS
#endif // #ifndef __linux_minix_fs_h__
| [
"davit.kalantar@desy.de"
] | davit.kalantar@desy.de |
e0376b7a766de25f317825988198079020380023 | c55b58ab76f44660594f36a6ce63a2db7f13d7ae | /poin1.c | 23194adf8c99455e623da884846f7c9997331908 | [] | no_license | NANDA392/Basic-programs-of-c | 54ff405cd12a29db1acd1a7eec9dff7f90b1b5e6 | f464dc375d2e77523e5701e067aaa1c099364f7a | refs/heads/master | 2023-08-11T06:46:19.790998 | 2021-10-05T07:00:49 | 2021-10-05T07:00:49 | 227,750,428 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 205 | c | #include<stdio.h>
int main()
{
int a[10],r;
int *p,*t;
p=&a[2];
t=&a[3];
// r=t-p;
printf("%d\n",r);
printf("%u\n",p);
// ++*p;
printf("%u\n",t);
printf("%u\n",p);
}
| [
"Nandashiva460@gmail.com"
] | Nandashiva460@gmail.com |
0c895090d9f2e6f68a41a808249a672dbd52fb98 | e45cff70ccd47dc4e08bb7b288f2eb10024fee71 | /circlefit/test_circle_fit.c | 480de8b6442bd9f9de527dd7bcec6d6697f528bc | [] | no_license | victorliu/vlm | a416881549104d2430d0a2e095aec0db9a3e7f58 | d4899818a1ba2a741f4ef6c566159a4f8af3cb2b | refs/heads/master | 2021-01-18T16:19:26.806314 | 2018-02-02T18:55:18 | 2018-02-02T18:55:18 | 86,736,690 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 741 | c | #include "circle_fit.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
double frand(){
return (double)rand() / RAND_MAX;
}
int main(){
int i;
unsigned int n = 10;
double *pt;
double c[2], r, err;
pt = (double*)malloc(sizeof(double) * 2*n);
printf("%%!\n72 72 scale\n4.25 5.5 translate\n0.002 setlinewidth\n");
for(i = 0; i < n; ++i){
double angle = 2*M_PI*(frand()-0.5);
double r = 1 + 0.1*frand();
pt[2*i+0] = r * cos(angle);
pt[2*i+1] = r * sin(angle);
printf("newpath %f %f 0.01 0 360 arc closepath fill\n", pt[2*i+0], pt[2*i+1]);
}
circle_fit(100, n, pt, 1e-10, c, &r, &err);
printf("newpath %f %f %f 0 360 arc closepath stroke\n", c[0], c[1], r);
printf("showpage\n");
free(pt);
return 0;
}
| [
"vliu@padu140.magicleap.ds"
] | vliu@padu140.magicleap.ds |
55f8670ccbb104f1d9443f9642699c45bbc7349d | 94e8344ee420ae4d2eb1643e95973845f341a3d2 | /gcc_4.3.0_mutants/mutant100341_c-lex.c | 172ea88a111183c83e5f47af67c5d30b4e804c69 | [] | no_license | agroce/compilermutants | 94f1e9ac5b43e1f8e5c2fdc17fa627d434e082f3 | dc2f572c9bfe1eb7a38999aaf61d5e0a2bc98991 | refs/heads/master | 2022-02-26T21:19:35.873618 | 2019-09-24T15:30:14 | 2019-09-24T15:30:14 | 207,345,370 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 27,021 | c | /* Mainly the interface between cpplib and the C front ends.
Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "real.h"
#include "rtl.h"
#include "tree.h"
#include "input.h"
#include "output.h"
#include "c-tree.h"
#include "c-common.h"
#include "flags.h"
#include "timevar.h"
#include "cpplib.h"
#include "c-pragma.h"
#include "toplev.h"
#include "intl.h"
#include "tm_p.h"
#include "splay-tree.h"
#include "debug.h"
#include "target.h"
/* We may keep statistics about how long which files took to compile. */
static int header_time, body_time;
static splay_tree file_info_tree;
int pending_lang_change; /* If we need to switch languages - C++ only */
int c_header_level; /* depth in C headers - C++ only */
static tree interpret_integer (const cpp_token *, unsigned int);
static tree interpret_float (const cpp_token *, unsigned int);
static tree interpret_fixed (const cpp_token *, unsigned int);
static enum integer_type_kind narrowest_unsigned_type
(unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned int);
static enum integer_type_kind narrowest_signed_type
(unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned int);
static enum cpp_ttype lex_string (const cpp_token *, tree *, bool, bool);
static tree lex_charconst (const cpp_token *);
static void update_header_times (const char *);
static int dump_one_header (splay_tree_node, void *);
static void cb_line_change (cpp_reader *, const cpp_token *, int);
static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
static void cb_def_pragma (cpp_reader *, unsigned int);
static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
void
init_c_lex (void)
{
struct cpp_callbacks *cb;
struct c_fileinfo *toplevel;
/* The get_fileinfo data structure must be initialized before
cpp_read_main_file is called. */
toplevel = get_fileinfo ("<top level>");
if (flag_detailed_statistics)
{
header_time = 0;
body_time = get_run_time ();
toplevel->time = body_time;
}
cb = cpp_get_callbacks (parse_in);
cb->line_change = cb_line_change;
cb->ident = cb_ident;
cb->def_pragma = cb_def_pragma;
cb->valid_pch = c_common_valid_pch;
cb->read_pch = c_common_read_pch;
/* Set the debug callbacks if we can use them. */
if (debug_info_level == DINFO_LEVEL_VERBOSE
&& (write_symbols == DWARF2_DEBUG
|| write_symbols == VMS_AND_DWARF2_DEBUG))
{
cb->define = cb_define;
cb->undef = cb_undef;
}
}
struct c_fileinfo *
get_fileinfo (const char *name)
{
splay_tree_node n;
struct c_fileinfo *fi;
if (!file_info_tree)
file_info_tree = splay_tree_new ((splay_tree_compare_fn) strcmp,
0,
(splay_tree_delete_value_fn) free);
n = splay_tree_lookup (file_info_tree, (splay_tree_key) name);
if (n)
return (struct c_fileinfo *) n->value;
fi = XNEW (struct c_fileinfo);
fi->time = 0;
fi->interface_only = 0;
fi->interface_unknown = 1;
splay_tree_insert (file_info_tree, (splay_tree_key) name,
(splay_tree_value) fi);
return fi;
}
static void
update_header_times (const char *name)
{
/* Changing files again. This means currently collected time
is charged against header time, and body time starts back at 0. */
if (flag_detailed_statistics)
{
int this_time = get_run_time ();
struct c_fileinfo *file = get_fileinfo (name);
header_time += this_time - body_time;
file->time += this_time - body_time;
body_time = this_time;
}
}
static int
dump_one_header (splay_tree_node n, void * ARG_UNUSED (dummy))
{
print_time ((const char *) n->key,
((struct c_fileinfo *) n->value)->time);
return 0;
}
void
dump_time_statistics (void)
{
struct c_fileinfo *file = get_fileinfo (input_filename);
int this_time = get_run_time ();
file->time += this_time - body_time;
fprintf (stderr, "\n******\n");
print_time ("header files (total)", header_time);
print_time ("main file (total)", this_time - body_time);
fprintf (stderr, "ratio = %g : 1\n",
(double) header_time / (double) (this_time - body_time));
fprintf (stderr, "\n******\n");
splay_tree_foreach (file_info_tree, dump_one_header, 0);
}
static void
cb_ident (cpp_reader * ARG_UNUSED (pfile),
unsigned int ARG_UNUSED (line),
const cpp_string * ARG_UNUSED (str))
{
#ifdef ASM_OUTPUT_IDENT
if (!flag_no_ident)
{
/* Convert escapes in the string. */
cpp_string cstr = { 0, 0 };
if (cpp_interpret_string (pfile, str, 1, &cstr, false))
{
ASM_OUTPUT_IDENT (asm_out_file, (const char *) cstr.text);
free (CONST_CAST (unsigned char *, cstr.text));
}
}
#endif
}
/* Called at the start of every non-empty line. TOKEN is the first
lexed token on the line. Used for diagnostic line numbers. */
static void
cb_line_change (cpp_reader * ARG_UNUSED (pfile), const cpp_token *token,
int parsing_args)
{
if (token->type != CPP_EOF && !parsing_args)
#ifdef USE_MAPPED_LOCATION
input_location = token->src_loc;
#else
{
source_location loc = token->src_loc;
const struct line_map *map = linemap_lookup (line_table, loc);
input_line = SOURCE_LINE (map, loc);
}
#endif
}
void
fe_file_change (const struct line_map *new_map)
{
if (new_map == NULL)
return;
if (new_map->reason == LC_ENTER)
{
/* Don't stack the main buffer on the input stack;
we already did in compile_file. */
if (!MAIN_FILE_P (new_map))
{
#ifdef USE_MAPPED_LOCATION
int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
input_location = included_at;
push_srcloc (new_map->start_location);
#else
int included_at = LAST_SOURCE_LINE (new_map - 1);
input_line = included_at;
push_srcloc (new_map->to_file, 1);
#endif
(*debug_hooks->start_source_file) (included_at, new_map->to_file);
#ifndef NO_IMPLICIT_EXTERN_C
if (c_header_level)
++c_header_level;
else if (new_map->sysp == 2)
{
c_header_level = 1;
++pending_lang_change;
}
#endif
}
}
else if (new_map->reason == LC_LEAVE)
{
#ifndef NO_IMPLICIT_EXTERN_C
if (c_header_level && --c_header_level == 0)
{
if (new_map->sysp == 2)
warning (0, "badly nested C headers from preprocessor");
--pending_lang_change;
}
#endif
pop_srcloc ();
(*debug_hooks->end_source_file) (new_map->to_line);
}
update_header_times (new_map->to_file);
in_system_header = new_map->sysp != 0;
#ifdef USE_MAPPED_LOCATION
input_location = new_map->start_location;
#else
input_filename = new_map->to_file;
input_line = new_map->to_line;
#endif
}
static void
cb_def_pragma (cpp_reader *pfile, source_location loc)
{
/* Issue a warning message if we have been asked to do so. Ignore
unknown pragmas in system headers unless an explicit
-Wunknown-pragmas has been given. */
if (warn_unknown_pragmas > in_system_header)
{
const unsigned char *space, *name;
const cpp_token *s;
#ifndef USE_MAPPED_LOCATION
location_t fe_loc;
const struct line_map *map = linemap_lookup (line_table, loc);
fe_loc.file = map->to_file;
fe_loc.line = SOURCE_LINE (map, loc);
#else
location_t fe_loc = loc;
#endif
space = name = (const unsigned char *) "";
s = cpp_get_token (pfile);
if (s->type != CPP_EOF)
{
space = cpp_token_as_text (pfile, s);
s = cpp_get_token (pfile);
if (s->type == CPP_NAME)
name = cpp_token_as_text (pfile, s);
}
warning (OPT_Wunknown_pragmas, "%Hignoring #pragma %s %s",
&fe_loc, space, name);
}
}
/* #define callback for DWARF and DWARF2 debug info. */
static void
cb_define (cpp_reader *pfile, source_location loc, cpp_hashnode *node)
{
const struct line_map *map = linemap_lookup (line_table, loc);
(*debug_hooks->define) (SOURCE_LINE (map, loc),
(const char *) cpp_macro_definition (pfile, node));
}
/* #undef callback for DWARF and DWARF2 debug info. */
static void
cb_undef (cpp_reader * ARG_UNUSED (pfile), source_location loc,
cpp_hashnode *node)
{
const struct line_map *map = linemap_lookup (line_table, loc);
(*debug_hooks->undef) (SOURCE_LINE (map, loc),
(const char *) NODE_NAME (node));
}
/* Read a token and return its type. Fill *VALUE with its value, if
applicable. Fill *CPP_FLAGS with the token's flags, if it is
non-NULL. */
enum cpp_ttype
c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
int lex_flags)
{
static bool no_more_pch;
const cpp_token *tok;
enum cpp_ttype type;
unsigned char add_flags = 0;
timevar_push (TV_CPP);
retry:
#ifdef USE_MAPPED_LOCATION
tok = cpp_get_token_with_location (parse_in, loc);
#else
tok = cpp_get_token (parse_in);
*loc = input_location;
#endif
type = tok->type;
retry_after_at:
switch (type)
{
case CPP_PADDING:
goto retry;
case CPP_NAME:
*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
break;
case CPP_NUMBER:
{
unsigned int flags = cpp_classify_number (parse_in, tok);
switch (flags & CPP_N_CATEGORY)
{
case CPP_N_INVALID:
/* cpplib has issued an error. */
*value = error_mark_node;
errorcount++;
break;
case CPP_N_INTEGER:
/* C++ uses '0' to mark virtual functions as pure.
Set PURE_ZERO to pass this information to the C++ parser. */
if (tok->val.str.len == 1 && *tok->val.str.text == '0')
add_flags = PURE_ZERO;
*value = interpret_integer (tok, flags);
break;
case CPP_N_FLOATING:
*value = interpret_float (tok, flags);
break;
default:
gcc_unreachable ();
}
}
break;
case CPP_ATSIGN:
/* An @ may give the next token special significance in Objective-C. */
if (c_dialect_objc ())
{
#ifdef USE_MAPPED_LOCATION
location_t atloc = *loc;
location_t newloc;
#else
location_t atloc = input_location;
#endif
retry_at:
#ifdef USE_MAPPED_LOCATION
tok = cpp_get_token_with_location (parse_in, &newloc);
#else
tok = cpp_get_token (parse_in);
#endif
type = tok->type;
switch (type)
{
case CPP_PADDING:
goto retry_at;
case CPP_STRING:
case CPP_WSTRING:
type = lex_string (tok, value, true, true);
break;
case CPP_NAME:
*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
if (objc_is_reserved_word (*value))
{
type = CPP_AT_NAME;
break;
}
/* FALLTHROUGH */
default:
/* ... or not. */
error ("%Hstray %<@%> in program", &atloc);
#ifdef USE_MAPPED_LOCATION
*loc = newloc;
#endif
goto retry_after_at;
}
break;
}
/* FALLTHROUGH */
case CPP_HASH:
case CPP_PASTE:
{
unsigned char name[4];
*cpp_spell_token (parse_in, tok, name, true) = 0;
error ("stray %qs in program", name);
}
goto retry;
case CPP_OTHER:
{
cppchar_t c = tok->val.str.text[0];
if (c == '"' || c == '\'')
error ("missing terminating %c character", (int) c);
else if (ISGRAPH (c))
error ("stray %qc in program", (int) c);
else
error ("stray %<\\%o%> in program", (int) c);
}
goto retry;
case CPP_CHAR:
case CPP_WCHAR:
*value = lex_charconst (tok);
break;
case CPP_STRING:
case CPP_WSTRING:
if ((lex_flags & C_LEX_RAW_STRINGS) == 0)
{
type = lex_string (tok, value, false,
(lex_flags & C_LEX_STRING_NO_TRANSLATE) == 0);
break;
}
*value = build_string (tok->val.str.len, (const char *) tok->val.str.text);
break;
case CPP_PRAGMA:
*value = build_int_cst (NULL, tok->val.pragma);
break;
/* These tokens should not be visible outside cpplib. */
case CPP_HEADER_NAME:
case CPP_COMMENT:
case CPP_MACRO_ARG:
gcc_unreachable ();
default:
*value = NULL_TREE;
break;
}
if (cpp_flags)
*cpp_flags = tok->flags | add_flags;
if (!no_more_pch)
{
no_more_pch = true;
c_common_no_more_pch ();
}
timevar_pop (TV_CPP);
return type;
}
/* Returns the narrowest C-visible unsigned type, starting with the
minimum specified by FLAGS, that can fit HIGH:LOW, or itk_none if
there isn't one. */
static enum integer_type_kind
narrowest_unsigned_type (unsigned HOST_WIDE_INT low,
unsigned HOST_WIDE_INT high,
unsigned int flags)
{
enum integer_type_kind itk;
if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
itk = itk_unsigned_int;
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
itk = itk_unsigned_long;
else
itk = itk_unsigned_long_long;
for (; itk < itk_none; itk += 2 /* skip unsigned types */)
{
tree upper = TYPE_MAX_VALUE (integer_types[itk]);
if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high
&& TREE_INT_CST_LOW (upper) >= low))
return itk;
}
return itk_none;
}
/* Ditto, but narrowest signed type. */
static enum integer_type_kind
narrowest_signed_type (unsigned HOST_WIDE_INT low,
unsigned HOST_WIDE_INT high, unsigned int flags)
{
enum integer_type_kind itk;
if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
itk = itk_int;
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
itk = itk_long;
else
itk = itk_long_long;
for (; itk < itk_none; itk += 2 /* skip signed types */)
{
tree upper = TYPE_MAX_VALUE (integer_types[itk]);
if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high
&& TREE_INT_CST_LOW (upper) >= low))
return itk;
}
return itk_none;
}
/* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */
static tree
interpret_integer (const cpp_token *token, unsigned int flags)
{
tree value, type;
enum integer_type_kind itk;
cpp_num integer;
cpp_options *options = cpp_get_options (parse_in);
integer = cpp_interpret_integer (parse_in, token, flags);
integer = cpp_num_sign_extend (integer, options->precision);
/* The type of a constant with a U suffix is straightforward. */
if (flags & CPP_N_UNSIGNED)
itk = narrowest_unsigned_type (integer.low, integer.high, flags);
else
{
/* The type of a potentially-signed integer constant varies
depending on the base it's in, the standard in use, and the
length suffixes. */
enum integer_type_kind itk_u
= narrowest_unsigned_type (integer.low, integer.high, flags);
enum integer_type_kind itk_s
= narrowest_signed_type (integer.low, integer.high, flags);
/* In both C89 and C99, octal and hex constants may be signed or
unsigned, whichever fits tighter. We do not warn about this
choice differing from the traditional choice, as the constant
is probably a bit pattern and either way will work. */
if ((flags & CPP_N_RADIX) != CPP_N_DECIMAL)
itk = MIN (itk_u, itk_s);
else
{
/* In C99, decimal constants are always signed.
In C89, decimal constants that don't fit in long have
undefined behavior; we try to make them unsigned long.
In GCC's extended C89, that last is true of decimal
constants that don't fit in long long, too. */
itk = itk_s;
if (itk_s > itk_u && itk_s > itk_long)
{
if (!flag_isoc99)
{
if (itk_u < itk_unsigned_long)
itk_u = itk_unsigned_long;
/* MUTANT (del_stmt) */ /* itk = itk_u; */
warning (0, "this decimal constant is unsigned only in ISO C90");
}
else
warning (OPT_Wtraditional,
"this decimal constant would be unsigned in ISO C90");
}
}
}
if (itk == itk_none)
/* cpplib has already issued a warning for overflow. */
type = ((flags & CPP_N_UNSIGNED)
? widest_unsigned_literal_type_node
: widest_integer_literal_type_node);
else
type = integer_types[itk];
if (itk > itk_unsigned_long
&& (flags & CPP_N_WIDTH) != CPP_N_LARGE
&& !in_system_header && !flag_isoc99)
pedwarn ("integer constant is too large for %qs type",
(flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
value = build_int_cst_wide (type, integer.low, integer.high);
/* Convert imaginary to a complex type. */
if (flags & CPP_N_IMAGINARY)
value = build_complex (NULL_TREE, build_int_cst (type, 0), value);
return value;
}
/* Interpret TOKEN, a floating point number with FLAGS as classified
by cpplib. */
static tree
interpret_float (const cpp_token *token, unsigned int flags)
{
tree type;
tree value;
REAL_VALUE_TYPE real;
char *copy;
size_t copylen;
/* Decode _Fract and _Accum. */
if (flags & CPP_N_FRACT || flags & CPP_N_ACCUM)
return interpret_fixed (token, flags);
/* Decode type based on width and properties. */
if (flags & CPP_N_DFLOAT)
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
type = dfloat128_type_node;
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
type = dfloat32_type_node;
else
type = dfloat64_type_node;
else
if (flags & CPP_N_WIDTH_MD)
{
char suffix;
enum machine_mode mode;
if ((flags & CPP_N_WIDTH_MD) == CPP_N_MD_W)
suffix = 'w';
else
suffix = 'q';
mode = targetm.c.mode_for_suffix (suffix);
if (mode == VOIDmode)
{
error ("unsupported non-standard suffix on floating constant");
errorcount++;
return error_mark_node;
}
else if (pedantic)
pedwarn ("non-standard suffix on floating constant");
type = c_common_type_for_mode (mode, 0);
gcc_assert (type);
}
else if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
type = long_double_type_node;
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL
|| flag_single_precision_constant)
type = float_type_node;
else
type = double_type_node;
/* Copy the constant to a nul-terminated buffer. If the constant
has any suffixes, cut them off; REAL_VALUE_ATOF/ REAL_VALUE_HTOF
can't handle them. */
copylen = token->val.str.len;
if (flags & CPP_N_DFLOAT)
copylen -= 2;
else
{
if ((flags & CPP_N_WIDTH) != CPP_N_MEDIUM)
/* Must be an F or L or machine defined suffix. */
copylen--;
if (flags & CPP_N_IMAGINARY)
/* I or J suffix. */
copylen--;
}
copy = (char *) alloca (copylen + 1);
memcpy (copy, token->val.str.text, copylen);
copy[copylen] = '\0';
real_from_string3 (&real, copy, TYPE_MODE (type));
/* Both C and C++ require a diagnostic for a floating constant
outside the range of representable values of its type. Since we
have __builtin_inf* to produce an infinity, this is now a
mandatory pedwarn if the target does not support infinities. */
if (REAL_VALUE_ISINF (real))
{
if (!MODE_HAS_INFINITIES (TYPE_MODE (type)))
pedwarn ("floating constant exceeds range of %qT", type);
else
warning (OPT_Woverflow, "floating constant exceeds range of %qT", type);
}
/* We also give a warning if the value underflows. */
else if (REAL_VALUES_EQUAL (real, dconst0))
{
REAL_VALUE_TYPE realvoidmode;
int overflow = real_from_string (&realvoidmode, copy);
if (overflow < 0 || !REAL_VALUES_EQUAL (realvoidmode, dconst0))
warning (OPT_Woverflow, "floating constant truncated to zero");
}
/* Create a node with determined type and value. */
value = build_real (type, real);
if (flags & CPP_N_IMAGINARY)
value = build_complex (NULL_TREE, convert (type, integer_zero_node), value);
return value;
}
/* Interpret TOKEN, a fixed-point number with FLAGS as classified
by cpplib. */
static tree
interpret_fixed (const cpp_token *token, unsigned int flags)
{
tree type;
tree value;
FIXED_VALUE_TYPE fixed;
char *copy;
size_t copylen;
copylen = token->val.str.len;
if (flags & CPP_N_FRACT) /* _Fract. */
{
if (flags & CPP_N_UNSIGNED) /* Unsigned _Fract. */
{
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
{
type = unsigned_long_long_fract_type_node;
copylen -= 4;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
{
type = unsigned_long_fract_type_node;
copylen -= 3;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
{
type = unsigned_short_fract_type_node;
copylen -= 3;
}
else
{
type = unsigned_fract_type_node;
copylen -= 2;
}
}
else /* Signed _Fract. */
{
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
{
type = long_long_fract_type_node;
copylen -= 3;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
{
type = long_fract_type_node;
copylen -= 2;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
{
type = short_fract_type_node;
copylen -= 2;
}
else
{
type = fract_type_node;
copylen --;
}
}
}
else /* _Accum. */
{
if (flags & CPP_N_UNSIGNED) /* Unsigned _Accum. */
{
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
{
type = unsigned_long_long_accum_type_node;
copylen -= 4;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
{
type = unsigned_long_accum_type_node;
copylen -= 3;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
{
type = unsigned_short_accum_type_node;
copylen -= 3;
}
else
{
type = unsigned_accum_type_node;
copylen -= 2;
}
}
else /* Signed _Accum. */
{
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
{
type = long_long_accum_type_node;
copylen -= 3;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
{
type = long_accum_type_node;
copylen -= 2;
}
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
{
type = short_accum_type_node;
copylen -= 2;
}
else
{
type = accum_type_node;
copylen --;
}
}
}
copy = (char *) alloca (copylen + 1);
memcpy (copy, token->val.str.text, copylen);
copy[copylen] = '\0';
fixed_from_string (&fixed, copy, TYPE_MODE (type));
/* Create a node with determined type and value. */
value = build_fixed (type, fixed);
return value;
}
/* Convert a series of STRING and/or WSTRING tokens into a tree,
performing string constant concatenation. TOK is the first of
these. VALP is the location to write the string into. OBJC_STRING
indicates whether an '@' token preceded the incoming token.
Returns the CPP token type of the result (CPP_STRING, CPP_WSTRING,
or CPP_OBJC_STRING).
This is unfortunately more work than it should be. If any of the
strings in the series has an L prefix, the result is a wide string
(6.4.5p4). Whether or not the result is a wide string affects the
meaning of octal and hexadecimal escapes (6.4.4.4p6,9). But escape
sequences do not continue across the boundary between two strings in
a series (6.4.5p7), so we must not lose the boundaries. Therefore
cpp_interpret_string takes a vector of cpp_string structures, which
we must arrange to provide. */
static enum cpp_ttype
lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate)
{
tree value;
bool wide = false;
size_t concats = 0;
struct obstack str_ob;
cpp_string istr;
/* Try to avoid the overhead of creating and destroying an obstack
for the common case of just one string. */
cpp_string str = tok->val.str;
cpp_string *strs = &str;
if (tok->type == CPP_WSTRING)
wide = true;
retry:
tok = cpp_get_token (parse_in);
switch (tok->type)
{
case CPP_PADDING:
goto retry;
case CPP_ATSIGN:
if (c_dialect_objc ())
{
objc_string = true;
goto retry;
}
/* FALLTHROUGH */
default:
break;
case CPP_WSTRING:
wide = true;
/* FALLTHROUGH */
case CPP_STRING:
if (!concats)
{
gcc_obstack_init (&str_ob);
obstack_grow (&str_ob, &str, sizeof (cpp_string));
}
concats++;
obstack_grow (&str_ob, &tok->val.str, sizeof (cpp_string));
goto retry;
}
/* We have read one more token than we want. */
_cpp_backup_tokens (parse_in, 1);
if (concats)
strs = XOBFINISH (&str_ob, cpp_string *);
if (concats && !objc_string && !in_system_header)
warning (OPT_Wtraditional,
"traditional C rejects string constant concatenation");
if ((translate
? cpp_interpret_string : cpp_interpret_string_notranslate)
(parse_in, strs, concats + 1, &istr, wide))
{
value = build_string (istr.len, (const char *) istr.text);
free (CONST_CAST (unsigned char *, istr.text));
}
else
{
/* Callers cannot generally handle error_mark_node in this context,
so return the empty string instead. cpp_interpret_string has
issued an error. */
if (wide)
value = build_string (TYPE_PRECISION (wchar_type_node)
/ TYPE_PRECISION (char_type_node),
"\0\0\0"); /* widest supported wchar_t
is 32 bits */
else
value = build_string (1, "");
}
TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node;
*valp = fix_string_type (value);
if (concats)
obstack_free (&str_ob, 0);
return objc_string ? CPP_OBJC_STRING : wide ? CPP_WSTRING : CPP_STRING;
}
/* Converts a (possibly wide) character constant token into a tree. */
static tree
lex_charconst (const cpp_token *token)
{
cppchar_t result;
tree type, value;
unsigned int chars_seen;
int unsignedp;
result = cpp_interpret_charconst (parse_in, token,
&chars_seen, &unsignedp);
if (token->type == CPP_WCHAR)
type = wchar_type_node;
/* In C, a character constant has type 'int'.
In C++ 'char', but multi-char charconsts have type 'int'. */
else if (!c_dialect_cxx () || chars_seen > 1)
type = integer_type_node;
else
type = char_type_node;
/* Cast to cppchar_signed_t to get correct sign-extension of RESULT
before possibly widening to HOST_WIDE_INT for build_int_cst. */
if (unsignedp || (cppchar_signed_t) result >= 0)
value = build_int_cst_wide (type, result, 0);
else
value = build_int_cst_wide (type, (cppchar_signed_t) result, -1);
return value;
}
| [
"agroce@gmail.com"
] | agroce@gmail.com |
79adb67ffdae30fda22fb9032be996fba561969f | e894292a153ed025d88df88dbb8188315caa01aa | /lisp/core/cell_iterator.h | 66f396df2aa884c5a99c052b815f0ec864522714 | [
"MIT",
"BSL-1.0"
] | permissive | stefan-wolfsheimer/LispPlusPlus | 8e9fc9aba68da0122cf607531a11324a0cab6b48 | f99612ef859b6a2b94cff26b386b11bcbfc299bd | refs/heads/master | 2021-10-12T07:14:06.943424 | 2021-10-02T17:15:40 | 2021-10-02T17:15:40 | 107,277,460 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,401 | h | /******************************************************************************
Copyright (c) 2021, Stefan Wolfsheimer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
******************************************************************************/
#ifndef __LISP_CELL_ITERATOR_H__
#define __LISP_CELL_ITERATOR_H__
#include <stddef.h>
struct lisp_type_t;
struct cell_t;
typedef struct lisp_cell_iterator_t
{
struct lisp_cell_t * parent;
struct lisp_cell_t * child;
struct lisp_type_t * type;
union
{
/* type specific field,
i.e. index for arrays
*/
size_t index;
};
} lisp_cell_iterator_t;
/**
* Initialize cell iterator.
*/
int lisp_first_child(struct lisp_cell_t * cell,
lisp_cell_iterator_t * itr);
/**
* @return true if iterator is valid
*/
int lisp_cell_iterator_is_valid(lisp_cell_iterator_t * itr);
/**
* Iterate to the next child
*/
int lisp_cell_next_child(lisp_cell_iterator_t * itr);
#endif
| [
"stefan.wolfsheimer@gmail.com"
] | stefan.wolfsheimer@gmail.com |
312848a698b0f7ad4a3198cdab195712942547e0 | 9d60000721b74e2b0724e1aefc14b6e8ce7e1ce0 | /fillit.h | a0ec2d1a9a938c4a1e0b4dc8eed8ddb4a903f5be | [] | no_license | avenonat/Fillit | 6c9db8ba0eb4db2d8615ee53fde22be69e6f22c1 | edd3434cf9a9f43d7b9a53881d6eed2426b17321 | refs/heads/master | 2022-12-23T13:00:56.176236 | 2020-10-07T10:42:59 | 2020-10-07T10:42:59 | 219,550,832 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,972 | h | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fillit.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgarse <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/30 13:19:36 by lgarse #+# #+# */
/* Updated: 2019/10/20 16:00:08 by lgarse ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FILLIT_H
# define FILLIT_H
# define BUFF_SIZE 600
# define IFX (x1 + x - pl.x)
# define IFY (y1 + y - pl.y)
# define NT ((r + 1) / 21)
# include "fcntl.h"
# include "sys/types.h"
# include "sys/uio.h"
# include "unistd.h"
# include "stdlib.h"
# include "libft/libft.h"
typedef struct s_tet
{
int x;
int y;
int s;
} t_tet;
char **blanc(int size);
void brute_force(char ***tet, char **map, int index, int r);
int check_put(char **sq, char **map, int x1, int y1);
int checkin1(char *buf);
int checkin2(char *buf);
int checkin3(char *buf, int r);
char **clear_tet(char **map, int tet, int size);
int dimens(char **map);
int ft_read(int fd, char *buf);
int ft_sqrt(int nbr);
int ft_tet_char(char **sq);
int ft_x(char **sq);
int ft_y(char **sq);
void print_sq(char **sq, int size, char ***tet, int r);
void tostruct(char ***tet, char *buf, int index, int r);
char ***tostruct2(char *buf, int r);
void sq_free(char **sq, int size);
void tet_free(char ***tet, int r);
void organ(char *buf, int r, int size);
#endif
| [
"avenonat@ox-m4.21-school.ru"
] | avenonat@ox-m4.21-school.ru |
faea08f0837764953cb194deb680c04e41df676f | 4681d3e2af8f1a2090c62eb0dc9d2a86193fc11e | /lab4/task.c | e9bd41a9e907afab3740ae70192ab9fef837374c | [
"MIT"
] | permissive | hhhhhojeihsu/osdi2020 | c4af12b99af2e7965ee79067509d2eba0a389d9f | 6094a3eb9ba43a9f061bb7be5e23e5268552a2f2 | refs/heads/master | 2021-02-22T05:12:31.819679 | 2020-06-29T08:42:57 | 2020-06-29T08:42:57 | 245,369,992 | 1 | 0 | MIT | 2020-03-06T08:45:04 | 2020-03-06T08:45:04 | null | UTF-8 | C | false | false | 11,202 | c | #include <stdint.h>
#include "task.h"
#include "schedule.h"
#include "uart.h"
#include "irq.h"
#include "string_util.h"
#include "syscall.h"
#include "sys.h"
#include "shell.h"
#include "signal.h"
struct task_struct kernel_task_pool[TASK_POOL_SIZE];
uint16_t task_kernel_stack_pool[TASK_POOL_SIZE][TASK_KERNEL_STACK_SIZE];
uint16_t task_user_stack_pool[TASK_POOL_SIZE][TASK_USER_STACK_SIZE];
uint64_t task_privilege_task_create(void(*start_func)(), unsigned priority)
{
task_guard_section();
unsigned new_id = 0;
/* find usable position in task_pool */
for(unsigned idx = 0; idx < TASK_POOL_SIZE; ++idx)
{
if(kernel_task_pool[idx].id != idx + 1)
{
new_id = idx + 1;
break;
}
}
if(new_id == 0)
{
/* failed to create new task */
return 0;
}
/* assign id */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].id = new_id;
/* init quantum_count to 0 */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].quantum_count = 0;
/* reset flag */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].flag = 0;
/* reset signal */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].signal = 0;
/* set priority */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].priority = (uint64_t)priority;
/* assign context */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].cpu_context.lr = (uint64_t)start_func;
/* stack grow from high to low */
kernel_task_pool[TASK_ID_TO_IDX(new_id)].cpu_context.fp = (uint64_t)(task_kernel_stack_pool[new_id]);
kernel_task_pool[TASK_ID_TO_IDX(new_id)].cpu_context.sp = (uint64_t)(task_kernel_stack_pool[new_id]);
/* push into queue */
schedule_enqueue(new_id, (unsigned)priority);
task_guard_section();
return new_id;
}
uint64_t task_get_current_task_id(void)
{
uint64_t current_task_id;
asm volatile("mrs %0, tpidr_el1\n":
"=r"(current_task_id));
return current_task_id;
}
uint64_t task_user_get_current_task_id(void)
{
uint64_t current_task_id;
asm volatile("mrs %0, tpidr_el0\n":
"=r"(current_task_id));
return current_task_id;
}
void task_privilege_demo(void)
{
char ann[] = ANSI_YELLOW"[Privilege task] "ANSI_RESET;
int current_reschedule_count = 0;
int max_reschedule_time = 3;
while(1)
{
char string_buff[0x10];
uint64_t current_task_id = task_get_current_task_id();
uint64_t current_quantum_count;
uart_puts(ann);
uart_puts("Hi I'm id ");
string_longlong_to_char(string_buff, (int64_t)current_task_id);
uart_puts(string_buff);
uart_putc('\n');
irq_int_enable();
uart_puts(ann);
uart_puts("Enabling timer interrupt and waiting to reschedule\n");
/* if quantum_count get from task_pool is less than previous one, the reschedule occurred */
do
{
current_quantum_count = kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].quantum_count;
asm volatile("wfi");
}
while(current_quantum_count <= kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].quantum_count);
++current_reschedule_count;
if(current_reschedule_count >= max_reschedule_time)
{
uart_puts(ann);
uart_puts("exiting\n");
sys_exit(0);
}
}
}
void task_do_exec(void(*start_func)())
{
/* CAUTION: kernel stack may explode if you keep doing exec */
uint64_t current_task_id = task_get_current_task_id();
/* setup register and eret */
asm volatile(
"mov x0, %0\n"
"msr sp_el0, x0\n"
: : "r"((uint64_t)(task_user_stack_pool[current_task_id]))); /* stack grows from high to low */
asm volatile(
"mov x0, %0\n"
"msr elr_el1, x0\n"
: : "r"(start_func));
asm volatile(
"eor x0, x0, x0\n"
"msr spsr_el1, x0\n"
"eret");
}
void task_user_demo(void)
{
char string_buff[0x10];
uint64_t current_task_id = task_get_current_task_id();
irq_int_enable();
string_longlong_to_char(string_buff, (int64_t)current_task_id);
uart_puts(ANSI_YELLOW"[Privilege task that will exec to user mode] "ANSI_RESET);
uart_puts("In kernel mode with irq enable ID: ");
uart_puts(string_buff);
uart_putc('\n');
task_do_exec(task_user_context1_demo);
}
void task_user_context1_demo(void)
{
int demo_purpose_var_1 = 1;
char string_buff[0x20];
uint64_t task_id = task_user_get_current_task_id();
syscall_uart_puts(ANSI_YELLOW"[Privilege task that exec\"ed\" to user mode] "ANSI_RESET);
syscall_uart_puts("Task id: ");
string_longlong_to_char(string_buff, (long)task_id);
syscall_uart_puts(string_buff);
syscall_uart_puts(" demo_purpose_var_1 address: ");
string_ulonglong_to_hex_char(string_buff, (uint64_t)&demo_purpose_var_1);
syscall_uart_puts(string_buff);
syscall_uart_puts(" demo_purpose_var_1 value: ");
string_longlong_to_char(string_buff, demo_purpose_var_1);
syscall_uart_puts(string_buff);
syscall_uart_puts(ANSI_YELLOW"\n[Privilege task that exec\"ed\" to user mode] "ANSI_RESET"Let's exec in user mode\n");
syscall_exec(task_user_context2_demo);
}
void task_user_context2_demo(void)
{
int demo_purpose_var_2 = 3;
char string_buff[0x80];
int second_meeseek_id;
uint64_t task_id = task_user_get_current_task_id();
syscall_uart_puts(ANSI_BLUE"[I'm Mr.Meeseeks. Look at me] "ANSI_RESET);
syscall_uart_puts("Task id: ");
string_longlong_to_char(string_buff, (long)task_id);
syscall_uart_puts(string_buff);
syscall_uart_puts(" demo_purpose_var_2 address: ");
string_ulonglong_to_hex_char(string_buff, (uint64_t)&demo_purpose_var_2);
syscall_uart_puts(string_buff);
syscall_uart_puts(" demo_purpose_var_2 value: ");
string_longlong_to_char(string_buff, demo_purpose_var_2);
syscall_uart_puts(string_buff);
syscall_uart_puts(" Let's call another meeseeks.\n");
second_meeseek_id = syscall_fork();
if(second_meeseek_id == 0)
{
int third_meeseek_id;
uint64_t current_sp;
char current_sp_hex[0x10];
char ann[0x80] = ANSI_MAGENTA"[I'm the second meeseeks] "ANSI_RESET;
asm volatile("mov %0, sp" : "=r"(current_sp));
string_ulonglong_to_hex_char(current_sp_hex, current_sp);
syscall_uart_puts(ann);
syscall_uart_puts("sp: ");
syscall_uart_puts(current_sp_hex);
syscall_uart_puts(" I fork a new meeseeks and exit when I recieve input\n");
syscall_uart_gets(string_buff, '\n', 0x20 - 2);
third_meeseek_id = syscall_fork();
if(third_meeseek_id == 0)
{
int fourth_meeseek_id = syscall_fork();
for(int i = 0; i < 100000; ++i);
int fifth_meeseek_id = syscall_fork();
if(fourth_meeseek_id == 0)
{
if(fifth_meeseek_id == 0)
{
ann[0] = '\0';
string_concat(ann, ANSI_BLACK ANSI_BG_RED"[I'm the sixth meeseeks]"ANSI_RESET" ");
}
else
{
ann[0] = '\0';
string_concat(ann, ANSI_BLACK ANSI_BG_GREEN"[I'm the fourth meeseeks]"ANSI_RESET" ");
}
}
else
{
if(fifth_meeseek_id == 0)
{
ann[0] = '\0';
string_concat(ann, ANSI_BLACK ANSI_BG_YELLOW"[I'm the fifth meeseeks]"ANSI_RESET" ");
}
else
{
ann[0] = '\0';
string_concat(ann, ANSI_CYAN"[I'm the third meeseeks] "ANSI_RESET);
}
}
while(demo_purpose_var_2 < 6)
{
syscall_uart_puts(ann);
string_longlong_to_char(string_buff, demo_purpose_var_2);
syscall_uart_puts("demo_purpose_var_2: ");
syscall_uart_puts(string_buff);
string_ulonglong_to_hex_char(string_buff, (uint64_t)&demo_purpose_var_2);
syscall_uart_puts(" &demo_purpose_var_2: ");
syscall_uart_puts(string_buff);
syscall_uart_puts("\n");
for(int i = 0; i < 100000; ++i);
++demo_purpose_var_2;
}
/* busy waiting until the first meeseeks kill us all */
while(1);
}
else
{
syscall_uart_puts(ann);
syscall_uart_puts("Owee new mission accomplished. [Poof]\n");
syscall_exit(0);
}
}
else
{
uint64_t current_sp;
char current_sp_hex[0x10];
char ann[] = ANSI_BLUE"[I'm the first meeseeks] "ANSI_RESET;
asm volatile("mov %0, sp" : "=r"(current_sp));
string_ulonglong_to_hex_char(current_sp_hex, current_sp);
syscall_uart_puts(ann);
syscall_uart_puts("sp: ");
syscall_uart_puts(current_sp_hex);
syscall_uart_puts(" New meeseeks has id of ");
string_longlong_to_char(string_buff, second_meeseek_id);
syscall_uart_puts(string_buff);
syscall_uart_puts("\n");
while(1)
{
asm volatile("mov %0, sp" : "=r"(current_sp));
string_ulonglong_to_hex_char(current_sp_hex, current_sp);
syscall_uart_puts(ann);
syscall_uart_puts("sp: ");
syscall_uart_puts(current_sp_hex);
syscall_uart_puts(" I won't quit until you enter 's', press 'k' to kill all other meeseekses.\n");
syscall_uart_gets(string_buff, '\n', 0x20 - 2);
if(string_buff[0] == 's')
{
shell();
}
if(string_buff[0] == 'k')
{
/* In the demo scenario, the thrid meeseeks has task id 2 */
syscall_uart_puts(ann);
syscall_signal(3, SIGKILL);
syscall_signal(5, SIGKILL);
syscall_signal(6, SIGKILL);
syscall_signal(7, SIGKILL);
syscall_uart_puts("SIGKILL sent.\n");
}
}
}
}
uint64_t task_get_current_task_signal(void)
{
uint64_t current_task_id = task_get_current_task_id();
return kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].signal;
}
void task_start_waiting(void)
{
char id_char[0x10];
uint64_t current_task_id = task_get_current_task_id();
uart_puts(ANSI_GREEN"[scheduler]"ANSI_RESET" Task id: ");
string_longlong_to_char(id_char, (long)current_task_id);
uart_puts(id_char);
uart_puts(" has entered the wait queue\n");
task_guard_section();
SET_BIT(kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].flag, 2);
task_unguard_section();
schedule_enqueue_wait(current_task_id);
schedule_yield();
return;
}
void task_end_waiting(void)
{
char id_char[0x10];
/* put the first task in the wait queue back to running queue */
uint64_t task_id = schedule_dequeue_wait();
/* Some task in wait queue might be zombie */
while(CHECK_BIT(kernel_task_pool[TASK_ID_TO_IDX(task_id)].flag, TASK_STATE_ZOMBIE))
{
task_id = schedule_dequeue_wait();
}
uart_puts(ANSI_GREEN"[scheduler]"ANSI_RESET" Task id: ");
string_longlong_to_char(id_char, (long)task_id);
uart_puts(id_char);
uart_puts(" has left the wait queue\n");
task_guard_section();
CLEAR_BIT(kernel_task_pool[TASK_ID_TO_IDX(task_id)].flag, 2);
schedule_enqueue(task_id, (unsigned)kernel_task_pool[TASK_ID_TO_IDX(task_id)].priority);
task_unguard_section();
return;
}
void task_guard_section(void)
{
uint64_t current_task_id = task_get_current_task_id();
SET_BIT(kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].flag, TASK_STATE_GUARD);
return;
}
void task_unguard_section(void)
{
uint64_t current_task_id = task_get_current_task_id();
CLEAR_BIT(kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].flag, TASK_STATE_GUARD);
return;
}
int task_is_guarded(void)
{
uint64_t current_task_id = task_get_current_task_id();
return CHECK_BIT(kernel_task_pool[TASK_ID_TO_IDX(current_task_id)].flag, TASK_STATE_GUARD);
}
| [
"hchsu0426@cs.nctu.edu.tw"
] | hchsu0426@cs.nctu.edu.tw |
455c609576cffc589fdf41b6f52cece5dd8ab1aa | 0b12d6110fe8a54ccb3829f69707a229bfb35282 | /naruto/daemon/condition/iceball_cd.c | 94ffbc51b4bb02f5338ef7263597759ac56ca5d4 | [] | no_license | MudRen/mudos-game-naruto | b8f913deba70f7629c0bab117521508d1393e3b6 | 000f286645e810e1cd786130c52d7b9c1747cae8 | refs/heads/master | 2023-09-04T05:49:01.137753 | 2023-08-28T12:19:10 | 2023-08-28T12:19:10 | 245,764,270 | 1 | 0 | null | 2020-03-08T06:29:36 | 2020-03-08T06:29:36 | null | BIG5 | C | false | false | 467 | c | // 冰封球的短CD
#include <ansi.h>
inherit CONDITION;
private void create()
{
seteuid(getuid());
DAEMON_D->register_condition_daemon("iceball_cd");
}
// 每 update 一次 消秏時效一點..
void condition_update(object me, string cnd, mixed cnd_data)
{
if( !mapp(cnd_data) || (cnd_data["duration"]--) < 1 ) {
tell_object(me, NOR"[冰念匯集完畢。]\n"NOR);
me->delete_condition(cnd);
return;
}
} | [
"zwshen0603@gmail.com"
] | zwshen0603@gmail.com |
86ac8a7a1318cf6f4309af01e9531c4c414c7dd6 | aa0411560b7c406c77bafb5ce0857c309916fa0d | /KernighanAndRitchie_2019/chapterFour/queue.c | 901c1c8ede15dc442ce55957df29868c992cd28b | [] | no_license | sumedh105/CPrograms | 9f0c317ff7723e450aeac7cff34ab79e4c7e3755 | 5ead5a7565ded6582a0e972b03f5b9d774d16b49 | refs/heads/master | 2021-07-16T01:04:38.961129 | 2020-05-22T19:01:08 | 2020-05-22T19:01:08 | 141,177,327 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,335 | c | #include <stdio.h>
#include <stdlib.h>
#define MAXVAL 50
void enqueue(int);
int dequeue();
void display();
int queue[MAXVAL] = {0};
int queueBottom = 0;
int queueTop = 0;
int main()
{
int choice = 0;
int num = 0;
int result = 0;
while (1)
{
printf("\nEnter the choice\n");
printf("\n1. Enqueue\n");
printf("\n2. Dequeue\n");
printf("\n3. Display\n");
printf("\n4. Exit\n");
scanf("%d", &choice);
switch (choice)
{
case 1:
printf("\nEnter the number to be enqueued\n");
scanf("%d", &num);
enqueue(num);
break;
case 2:
result = dequeue();
printf("\nThe dequeued element is: %d\n", result);
break;
case 3:
display();
break;
case 4:
exit(0);
break;
default:
break;
}
}
return 0;
}
void enqueue(int num)
{
if (queueTop <= MAXVAL)
{
queue[queueTop++] = num;
}
else
{
printf("\nerror: the queue is full, cannot push the element in a queue\n");
}
}
int dequeue()
{
int num;
if (queueBottom <= queueTop)
{
num = queue[queueBottom++];
return num;
}
else
{
printf("\nerror: cannot dequeue an element, the queue is empty\n");
}
}
void display()
{
int index = 0;
printf("\nThe queue contents are:\n");
for (index = queueBottom; index < queueTop; ++index)
{
printf("\nqueue[%d]: %d\n", index, queue[index]);
}
}
| [
"sumedh105@gmail.com"
] | sumedh105@gmail.com |
de6782d3717528cd0c7ba2334395c8e3a73a0b61 | 4b8de7f7fd1bb62bb4808f81ec8c509fbbc00cd3 | /0510/stcreate2.c | 810456f52065425e5a65ef857e3565c75ed057cb | [] | no_license | ks2019875071/SysProgramming | b0fc350ceddf620e603ff240cf624844b48f72aa | a7766d70b921a239dbaf0c6256b5bf72642fe707 | refs/heads/main | 2023-04-25T11:33:02.803973 | 2021-05-24T09:47:53 | 2021-05-24T09:47:53 | 345,569,217 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 581 | c | #include <stdio.h>
#include "student.h"
/* 구조체를 이용하여 학생 정보를 파일에 저장한다. */
int main(int argc, char* argv[])
{
struct student record;
FILE *fp;
if (argc != 2) {
fprintf(stderr, "사용법: %s 파일이름\n", argv[0]);
return 1;
}
fp = fopen(argv[1], "wb");
printf("%-9s %-7s %-4s\n", "학번", "이름", "점수");
while (scanf("%d %s %d", &record.id, record.name, &record.score) == 3) {
fseek(fp, (record.id - START_ID)*sizeof(record), SEEK_SET);
fwrite(&record, sizeof(record), 1, fp);
}
fclose(fp);
return 0;
}
| [
"noreply@github.com"
] | ks2019875071.noreply@github.com |
4292395e800729455fda3fae255b12db40860da4 | 5ad092691a7feba2575033187f4f501f143eef66 | /lab5/lab5.c | 23f3f897a97c75d49f53817efe027ff7f42b2a36 | [] | no_license | abhimanyudwivedi/usp-and-cd-vtu-lab | c9468c84d139a41a9f292590682bd2c46c92e438 | 65fcc17bf14b16984a20e2d4e86d86719f2c7c4f | refs/heads/master | 2021-01-01T17:08:28.344014 | 2017-07-22T06:35:59 | 2017-07-22T06:35:59 | 98,008,842 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 153 | c | #include<stdio.h>
int main(int argc,char **argv)
{
extern char **environ;
int i=0;
while(environ[i])
{
printf("%s\n",environ[i++]);
}
return;
}
| [
"abhimanyudwivedi@gmail.com"
] | abhimanyudwivedi@gmail.com |
27344431e3c5d3fc27aad5a6c52590635eb93d8e | 17a53d473c9ae4f61adf6ca16e10515d5221eb3b | /kds/arpie_two/Generated_Code/PE_Types.h | c0f7c71097532650b2b7e9b6e91a50b92c5e867f | [] | no_license | hotchk155/arpie_2_firmware | ccb7e23cc02a6058fcaba7bd4f4b54bc90e6b34d | 75a5559f4e48c7d235139886202ff66a662566a5 | refs/heads/master | 2021-01-22T01:54:45.618593 | 2017-03-12T13:35:58 | 2017-03-12T13:35:58 | 81,017,310 | 0 | 0 | null | null | null | null | WINDOWS-1250 | C | false | false | 147,827 | h | /* ###################################################################
** This component module is generated by Processor Expert. Do not modify it.
** Filename : PE_Types.h
** Project : arpie_two
** Processor : MKE02Z64VLC4
** Component : PE_Types
** Version : Driver 01.01
** Compiler : GNU C Compiler
** Date/Time : 2017-02-17, 15:21, # CodeGen: 28
** Abstract :
** PE_Types.h - contains definitions of basic types,
** register access macros and hardware specific macros
** which can be used in user application.
** Contents :
** No public methods
**
** Copyright : 1997 - 2015 Freescale Semiconductor, Inc.
** All Rights Reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o Redistributions in binary form must reproduce the above copyright notice, this
** list of conditions and the following disclaimer in the documentation and/or
** other materials provided with the distribution.
**
** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
** contributors may be used to endorse or promote products derived from this
** software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
** http: www.freescale.com
** mail: support@freescale.com
** ###################################################################*/
/*!
** @file PE_Types.h
** @version 01.01
** @brief
** PE_Types.h - contains definitions of basic types,
** register access macros and hardware specific macros
** which can be used in user application.
*/
/*!
** @addtogroup PE_Types_module PE_Types module documentation
** @{
*/
#ifndef __PE_Types_H
#define __PE_Types_H
/* Standard ANSI C types */
#include <stdint.h>
#ifndef FALSE
#define FALSE 0x00u /* Boolean value FALSE. FALSE is defined always as a zero value. */
#endif
#ifndef TRUE
#define TRUE 0x01u /* Boolean value TRUE. TRUE is defined always as a non zero value. */
#endif
#ifndef NULL
#define NULL 0x00u
#endif
/* PE types definition */
#ifndef __cplusplus
#ifndef bool
typedef unsigned char bool;
#endif
#endif
typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long dword;
typedef unsigned long long dlong;
typedef unsigned char TPE_ErrCode;
#ifndef TPE_Float
typedef float TPE_Float;
#endif
#ifndef char_t
typedef char char_t;
#endif
/* Other basic data types */
typedef signed char int8;
typedef signed short int int16;
typedef signed long int int32;
typedef unsigned char uint8;
typedef unsigned short int uint16;
typedef unsigned long int uint32;
/**********************************************************/
/* Uniform multiplatform 8-bits peripheral access macros */
/**********************************************************/
/* Enable maskable interrupts */
#define __EI()\
do {\
/*lint -save -e950 Disable MISRA rule (1.1) checking. */\
__asm("CPSIE i");\
/*lint -restore Enable MISRA rule (1.1) checking. */\
} while(0)
/* Disable maskable interrupts */
#define __DI() \
do {\
/*lint -save -e950 Disable MISRA rule (1.1) checking. */\
__asm ("CPSID i");\
/*lint -restore Enable MISRA rule (1.1) checking. */\
} while(0)
/* Save status register and disable interrupts */
#define EnterCritical() \
do {\
uint8_t SR_reg_local;\
/*lint -save -e586 -e950 Disable MISRA rule (2.1,1.1) checking. */\
__asm ( \
"MRS R0, PRIMASK\n\t" \
"CPSID i\n\t" \
"STRB R0, %[output]" \
: [output] "=m" (SR_reg_local)\
:: "r0");\
/*lint -restore Enable MISRA rule (2.1,1.1) checking. */\
if (++SR_lock == 1u) {\
SR_reg = SR_reg_local;\
}\
} while(0)
/* Restore status register */
#define ExitCritical() \
do {\
if (--SR_lock == 0u) { \
/*lint -save -e586 -e950 Disable MISRA rule (2.1,1.1) checking. */\
__asm ( \
"ldrb r0, %[input]\n\t"\
"msr PRIMASK,r0;\n\t" \
::[input] "m" (SR_reg) \
: "r0"); \
/*lint -restore Enable MISRA rule (2.1,1.1) checking. */\
}\
} while(0)
#define PE_DEBUGHALT() \
/*lint -save -e586 -e950 Disable MISRA rule (2.1,1.1) checking. */\
__asm( "BKPT 255") \
/*lint -restore Enable MISRA rule (2.1,1.1) checking. */
#define PE_NOP() \
/*lint -save -e586 -e950 Disable MISRA rule (2.1,1.1) checking. */\
__asm( "NOP") \
/*lint -restore Enable MISRA rule (2.1,1.1) checking. */
#define PE_WFI() \
/*lint -save -e586 -e950 Disable MISRA rule (2.1,1.1) checking. */\
__asm("WFI") \
/*lint -restore Enable MISRA rule (2.1,1.1) checking. */
/* Interrupt definition template */
#if !defined(PE_ISR)
#define PE_ISR(ISR_name) void __attribute__ ((interrupt)) ISR_name(void)
#endif
/* Logical Device Drivers (LDD) types */
/*! Logical Device Driver API version */
#define PE_LDD_VERSION 0x0100U
/* LDD driver states */
#define PE_LDD_DRIVER_DISABLED_IN_CLOCK_CONFIGURATION 0x01U /*!< LDD driver is disabled in the selected clock configuration */
#define PE_LDD_DRIVER_DISABLED_BY_USER 0x02U /*!< LDD driver is disabled by the user */
#define PE_LDD_DRIVER_BUSY 0x04U /*!< LDD driver is busy */
/*! Macro to register component device structure */
#define PE_LDD_RegisterDeviceStructure(ComponentIndex, DeviceStructure) (PE_LDD_DeviceDataList[ComponentIndex] = DeviceStructure)
/*! Macro to unregister component device structure */
#define PE_LDD_UnregisterDeviceStructure(ComponentIndex) (PE_LDD_DeviceDataList[ComponentIndex] = NULL)
/*! Macro to get the component device structure */
#define PE_LDD_GetDeviceStructure(ComponentIndex) (PE_LDD_DeviceDataList[ComponentIndex])
/*
** ===========================================================================
** LDD component ID specifying the component instance in the project. This ID
** is used internally as an index to the array of LDD device structures.
** ===========================================================================
*/
#define PE_LDD_COMPONENT_I2CBus_ID 0x00U
#define PE_LDD_COMPONENT_UART0_ID 0x01U
/*
** ===================================================================
** Global HAL types and constants
** ===================================================================
*/
typedef uint32_t LDD_TPinMask; /*!< Pin mask type. */
typedef uint16_t LDD_TError; /*!< Error type. */
typedef uint32_t LDD_TEventMask; /*!< Event mask type. */
typedef uint8_t LDD_TClockConfiguration; /*!< CPU clock configuration type. */
typedef void LDD_TDeviceData; /*!< Pointer to private device structure managed and used by HAL components. */
typedef void* LDD_TDeviceDataPtr; /*!< Obsolete type for backward compatibility. */
typedef void LDD_TData; /*!< General pointer to data. */
typedef void LDD_TUserData; /*!< Pointer to this type specifies the user or RTOS specific data will be passed as an event or callback parameter. */
/*! Driver operation mode type. */
typedef enum {
DOM_NONE,
DOM_RUN,
DOM_WAIT,
DOM_SLEEP,
DOM_STOP
} LDD_TDriverOperationMode;
typedef uint16_t LDD_TDriverState; /*!< Driver state type. */
typedef void LDD_TCallbackParam; /*!< Pointer to this type specifies the user data to be passed as a callback parameter. */
typedef void (* LDD_TCallback)(LDD_TCallbackParam *CallbackParam); /*!< Callback type used for definition of callback functions. */
extern LDD_TDeviceData *PE_LDD_DeviceDataList[]; /*!< Array of LDD component device structures */
/* Fills a memory area block by a specified value. Function defined in PE_LDD.c */
extern void PE_FillMemory(register void* SourceAddressPtr, register uint8_t c, register uint32_t len);
/*
** ===================================================================
** RTOS specific types and constants
** ===================================================================
*/
/* {Default RTOS Adapter} RTOS specific definition of type of Ioctl() command constants */
/*
** ===================================================================
** Published RTOS settings and constants
** ===================================================================
*/
/* {Default RTOS Adapter} No published RTOS settings */
/*
** ===================================================================
** TimerUnit device types and constants
** ===================================================================
*/
#define LDD_TIMERUNIT_ON_CHANNEL_0 0x01u /*!< OnChannel0 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_1 0x02u /*!< OnChannel1 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_2 0x04u /*!< OnChannel2 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_3 0x08u /*!< OnChannel3 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_4 0x10u /*!< OnChannel4 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_5 0x20u /*!< OnChannel5 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_6 0x40u /*!< OnChannel6 event mask value */
#define LDD_TIMERUNIT_ON_CHANNEL_7 0x80u /*!< OnChannel7 event mask value */
#define LDD_TIMERUNIT_ON_COUNTER_RESTART 0x0100u /*!< OnCounterRestart event mask value */
/*! Direction of counting */
typedef enum {
DIR_UP, /*!< UP */
DIR_DOWN /*!< DOWN */
} LDD_TimerUnit_TCounterDirection;
/*! Output action type (flip-flop action on overrun or compare match) */
typedef enum {
OUTPUT_NONE, /*!< NONE */
OUTPUT_TOGGLE, /*!< TOGGLE */
OUTPUT_CLEAR, /*!< CLEAR */
OUTPUT_SET /*!< SET */
} LDD_TimerUnit_TOutAction;
/*! Input edge type */
typedef enum {
EDGE_NONE, /*!< NONE */
EDGE_RISING, /*!< RISING */
EDGE_FALLING, /*!< FALLING */
EDGE_BOTH /*!< BOTH */
} LDD_TimerUnit_TEdge;
typedef float LDD_TimerUnit_Tfloat; /*!< Float type */
/*
** ===================================================================
** CMT device types and constants
** ===================================================================
*/
#define LDD_CMT_ON_END 0x01u /*!< OnEnd event mask value */
/*
** ===================================================================
** PPG device types and constants
** ===================================================================
*/
#define LDD_PPG_ON_END 0x01u /*!< OnEnd event mask value */
typedef float LDD_PPG_Tfloat; /*!< Float type */
/*
** ===================================================================
** PWM types and constants
** ===================================================================
*/
#define LDD_PWM_ON_END 0x01u /*!< OnEnd event mask value */
/*
** ===================================================================
** Capture types and constants
** ===================================================================
*/
#define LDD_CAPTURE_ON_CAPTURE 0x01u /*!< OnCapture event mask value */
#define LDD_CAPTURE_ON_OVERRUN 0x02u /*!< OnOverrun event mask value */
/*
** ===================================================================
** TimerInt types and constants
** ===================================================================
*/
#define LDD_TIMERINT_ON_INTERRUPT 0x01u /*!< OnInterrupt event mask value */
/*
** ===================================================================
** TimerOut types and constants
** ===================================================================
*/
#define LDD_TIMEROUT_ON_INTERRUPT 0x01u /*!< OnInterrupt event mask value */
/*
** ===================================================================
** EventCntr types and constants
** ===================================================================
*/
#define LDD_EVENTCNTR_ON_END 0x01u /*!< OnEnd event mask value */
/*
** ===================================================================
** FreeCntr types and constants
** ===================================================================
*/
#define LDD_FREECNTR_ON_INTERRUPT 0x01u /*!< OnInterrupt event mask value */
/*
** ===================================================================
** RealTime types and constants
** ===================================================================
*/
typedef float LDD_RealTime_Tfloat; /*!< Float type */
/*
** ===================================================================
** TimeDate types and constants
** ===================================================================
*/
#define LDD_TIMEDATE_ON_ALARM 0x01u /*!< OnAlarm event mask value */
#define LDD_TIMEDATE_ON_SECOND 0x02u /*!< OnSecond event mask value */
/*!< Time struct */
typedef struct {
uint16_t Hour; /*!< Hours (0 - 23) */
uint16_t Min; /*!< Minutes (0 - 59) */
uint16_t Sec; /*!< Seconds (0 - 59) */
uint16_t Sec100; /*!< Hundredths of seconds (0 - 99) */
} LDD_TimeDate_TTimeRec;
/*!< Date struct */
typedef struct {
uint16_t Year; /*!< Years (1998 - 2099) */
uint16_t Month; /*!< Months (1 - 12) */
uint16_t Day; /*!< Days (1 - 31) */
uint16_t DayOfWeek; /*!< Day of week (0-Sunday, .. 6-Saturday) */
} LDD_TimeDate_TDateRec;
/*
** ===================================================================
** UART device types and constants
** ===================================================================
*/
#define LDD_SERIAL_RX_PIN 0x01u /*!< Receiver pin mask */
#define LDD_SERIAL_TX_PIN 0x02u /*!< Transmitter pin mask */
#define LDD_SERIAL_CTS_PIN 0x04u /*!< CTS pin mask */
#define LDD_SERIAL_RTS_PIN 0x08u /*!< RTS pin mask */
#define LDD_SERIAL_ON_BLOCK_RECEIVED 0x01u /*!< OnBlockReceived event mask */
#define LDD_SERIAL_ON_BLOCK_SENT 0x02u /*!< OnBlockSent event mask */
#define LDD_SERIAL_ON_BREAK 0x04u /*!< OnBreak event mask */
#define LDD_SERIAL_ON_TXCOMPLETE 0x08u /*!< OnTxComplete event mask */
#define LDD_SERIAL_ON_ERROR 0x10u /*!< OnError event mask */
#define LDD_SERIAL_RX_OVERRUN 0x01u /*!< Receiver overrun */
#define LDD_SERIAL_PARITY_ERROR 0x02u /*!< Parity error */
#define LDD_SERIAL_FRAMING_ERROR 0x04u /*!< Framing error */
#define LDD_SERIAL_NOISE_ERROR 0x08u /*!< Noise error */
typedef uint32_t LDD_SERIAL_TError; /*!< Serial communication error type */
typedef uint8_t LDD_SERIAL_TDataWidth; /*!< Bit length type. The number of bits transmitted by one character. */
typedef uint16_t LDD_SERIAL_TSize; /*!< Type specifying the length of the data or buffer. */
typedef uint8_t LDD_SERIAL_TBaudMode; /*!< Type specifying the baud mode. */
/*! Type specifying the parity. */
typedef enum {
LDD_SERIAL_PARITY_UNDEF, /*!< Undefined parity */
LDD_SERIAL_PARITY_NONE, /*!< Parity none */
LDD_SERIAL_PARITY_ODD, /*!< Parity odd */
LDD_SERIAL_PARITY_EVEN, /*!< Parity even */
LDD_SERIAL_PARITY_MARK, /*!< Parity mark */
LDD_SERIAL_PARITY_SPACE /*!< Parity space */
} LDD_SERIAL_TParity;
/*! Type specifying the stop bit length. */
typedef enum {
LDD_SERIAL_STOP_BIT_LEN_UNDEF, /*!< Undefined bit length */
LDD_SERIAL_STOP_BIT_LEN_1, /*!< 1 bit length */
LDD_SERIAL_STOP_BIT_LEN_1_5, /*!< 1.5 bit length */
LDD_SERIAL_STOP_BIT_LEN_2 /*!< 2 bit length */
} LDD_SERIAL_TStopBitLen;
/*! Communication statistics */
typedef struct {
uint32_t ReceivedChars; /*!< Number of received characters */
uint32_t SentChars; /*!< Number of transmitted characters */
uint32_t ReceivedBreaks; /*!< Number of received break characters */
uint32_t ParityErrors; /*!< Number of receiver parity errors */
uint32_t FramingErrors; /*!< Number of receiver framing errors */
uint32_t OverrunErrors; /*!< Number of receiver overrun errors */
uint32_t NoiseErrors; /*!< Number of receiver noise errors */
} LDD_SERIAL_TStats;
/*! Type specifying the loop mode operation. */
typedef enum {
LOOPMODE_UNDEF, /*!< Undefined loop mode */
LOOPMODE_NORMAL, /*!< Normal operation */
LOOPMODE_AUTO_ECHO, /*!< Auto echo mode */
LOOPMODE_LOCAL_LOOPBACK, /*!< Local loopback mode */
LOOPMODE_REMOTE_LOOPBACK /*!< Remote loopback mode */
} LDD_SERIAL_TLoopMode;
/*
** ===================================================================
** ADC device types and constants
** ===================================================================
*/
#define LDD_ADC_CHANNEL_0_PIN 0x01u /*!< Channel 0 pin mask */
#define LDD_ADC_CHANNEL_1_PIN 0x02u /*!< Channel 1 pin mask */
#define LDD_ADC_CHANNEL_2_PIN 0x04u /*!< Channel 2 pin mask */
#define LDD_ADC_CHANNEL_3_PIN 0x08u /*!< Channel 3 pin mask */
#define LDD_ADC_CHANNEL_4_PIN 0x10u /*!< Channel 4 pin mask */
#define LDD_ADC_CHANNEL_5_PIN 0x20u /*!< Channel 5 pin mask */
#define LDD_ADC_CHANNEL_6_PIN 0x40u /*!< Channel 6 pin mask */
#define LDD_ADC_CHANNEL_7_PIN 0x80u /*!< Channel 7 pin mask */
#define LDD_ADC_CHANNEL_8_PIN 0x0100u /*!< Channel 8 pin mask */
#define LDD_ADC_CHANNEL_9_PIN 0x0200u /*!< Channel 9 pin mask */
#define LDD_ADC_CHANNEL_10_PIN 0x0400u /*!< Channel 10 pin mask */
#define LDD_ADC_CHANNEL_11_PIN 0x0800u /*!< Channel 11 pin mask */
#define LDD_ADC_CHANNEL_12_PIN 0x1000u /*!< Channel 12 pin mask */
#define LDD_ADC_CHANNEL_13_PIN 0x2000u /*!< Channel 13 pin mask */
#define LDD_ADC_CHANNEL_14_PIN 0x4000u /*!< Channel 14 pin mask */
#define LDD_ADC_CHANNEL_15_PIN 0x8000u /*!< Channel 15 pin mask */
#define LDD_ADC_CHANNEL_16_PIN 0x00010000u /*!< Channel 16 pin mask */
#define LDD_ADC_CHANNEL_17_PIN 0x00020000u /*!< Channel 17 pin mask */
#define LDD_ADC_CHANNEL_18_PIN 0x00040000u /*!< Channel 18 pin mask */
#define LDD_ADC_CHANNEL_19_PIN 0x00080000u /*!< Channel 19 pin mask */
#define LDD_ADC_CHANNEL_20_PIN 0x00100000u /*!< Channel 20 pin mask */
#define LDD_ADC_CHANNEL_21_PIN 0x00200000u /*!< Channel 21 pin mask */
#define LDD_ADC_CHANNEL_22_PIN 0x00400000u /*!< Channel 22 pin mask */
#define LDD_ADC_CHANNEL_23_PIN 0x00800000u /*!< Channel 23 pin mask */
#define LDD_ADC_CHANNEL_24_PIN 0x01000000u /*!< Channel 24 pin mask */
#define LDD_ADC_CHANNEL_25_PIN 0x02000000u /*!< Channel 25 pin mask */
#define LDD_ADC_CHANNEL_26_PIN 0x04000000u /*!< Channel 26 pin mask */
#define LDD_ADC_CHANNEL_27_PIN 0x08000000u /*!< Channel 27 pin mask */
#define LDD_ADC_CHANNEL_28_PIN 0x10000000u /*!< Channel 28 pin mask */
#define LDD_ADC_CHANNEL_29_PIN 0x20000000u /*!< Channel 29 pin mask */
#define LDD_ADC_CHANNEL_30_PIN 0x40000000u /*!< Channel 30 pin mask */
#define LDD_ADC_CHANNEL_31_PIN 0x80000000u /*!< Channel 31 pin mask */
#define LDD_ADC_CHANNEL_32_PIN 0x01u /*!< Channel 32 pin mask */
#define LDD_ADC_CHANNEL_33_PIN 0x02u /*!< Channel 33 pin mask */
#define LDD_ADC_CHANNEL_34_PIN 0x04u /*!< Channel 34 pin mask */
#define LDD_ADC_CHANNEL_35_PIN 0x08u /*!< Channel 35 pin mask */
#define LDD_ADC_CHANNEL_36_PIN 0x10u /*!< Channel 36 pin mask */
#define LDD_ADC_CHANNEL_37_PIN 0x20u /*!< Channel 37 pin mask */
#define LDD_ADC_CHANNEL_38_PIN 0x40u /*!< Channel 38 pin mask */
#define LDD_ADC_CHANNEL_39_PIN 0x80u /*!< Channel 39 pin mask */
#define LDD_ADC_CHANNEL_40_PIN 0x0100u /*!< Channel 40 pin mask */
#define LDD_ADC_CHANNEL_41_PIN 0x0200u /*!< Channel 41 pin mask */
#define LDD_ADC_CHANNEL_42_PIN 0x0400u /*!< Channel 42 pin mask */
#define LDD_ADC_CHANNEL_43_PIN 0x0800u /*!< Channel 43 pin mask */
#define LDD_ADC_CHANNEL_44_PIN 0x1000u /*!< Channel 44 pin mask */
#define LDD_ADC_CHANNEL_45_PIN 0x2000u /*!< Channel 45 pin mask */
#define LDD_ADC_CHANNEL_46_PIN 0x4000u /*!< Channel 46 pin mask */
#define LDD_ADC_CHANNEL_47_PIN 0x8000u /*!< Channel 47 pin mask */
#define LDD_ADC_CHANNEL_48_PIN 0x00010000u /*!< Channel 48 pin mask */
#define LDD_ADC_CHANNEL_49_PIN 0x00020000u /*!< Channel 49 pin mask */
#define LDD_ADC_CHANNEL_50_PIN 0x00040000u /*!< Channel 50 pin mask */
#define LDD_ADC_CHANNEL_51_PIN 0x00080000u /*!< Channel 51 pin mask */
#define LDD_ADC_CHANNEL_52_PIN 0x00100000u /*!< Channel 52 pin mask */
#define LDD_ADC_CHANNEL_53_PIN 0x00200000u /*!< Channel 53 pin mask */
#define LDD_ADC_CHANNEL_54_PIN 0x00400000u /*!< Channel 54 pin mask */
#define LDD_ADC_CHANNEL_55_PIN 0x00800000u /*!< Channel 55 pin mask */
#define LDD_ADC_CHANNEL_56_PIN 0x01000000u /*!< Channel 56 pin mask */
#define LDD_ADC_CHANNEL_57_PIN 0x02000000u /*!< Channel 57 pin mask */
#define LDD_ADC_CHANNEL_58_PIN 0x04000000u /*!< Channel 58 pin mask */
#define LDD_ADC_CHANNEL_59_PIN 0x08000000u /*!< Channel 59 pin mask */
#define LDD_ADC_CHANNEL_60_PIN 0x10000000u /*!< Channel 60 pin mask */
#define LDD_ADC_CHANNEL_61_PIN 0x20000000u /*!< Channel 61 pin mask */
#define LDD_ADC_CHANNEL_62_PIN 0x40000000u /*!< Channel 62 pin mask */
#define LDD_ADC_CHANNEL_63_PIN 0x80000000u /*!< Channel 63 pin mask */
#define LDD_ADC_TRIGGER_0_PIN 0x01u /*!< Trigger 0 pin mask */
#define LDD_ADC_TRIGGER_1_PIN 0x02u /*!< Trigger 1 pin mask */
#define LDD_ADC_LOW_VOLT_REF_PIN 0x01u /*!< Low voltage reference pin mask */
#define LDD_ADC_HIGH_VOLT_REF_PIN 0x02u /*!< High voltage reference pin mask */
#define LDD_ADC_ON_MEASUREMENT_COMPLETE 0x40u /*!< OnMeasurementComplete event mask */
#define LDD_ADC_ON_ERROR 0x80u /*!< OnError event mask */
#define LDD_ADC_DMA_ERROR 0x01u /*!< DMA error mask */
typedef uint32_t LDD_ADC_TErrorMask; /*!< ADC error type */
/*! Structure pins for pin connection method */
typedef struct {
uint32_t Channel0_31PinMask; /*!< Channel pin mask for channels 0 through 31 */
uint32_t Channel32_63PinMask; /*!< Channel pin mask for channels 32 through 63 */
uint16_t TriggerPinMask; /*!< Trigger pin mask */
uint8_t VoltRefPinMask; /*!< Voltage reference pin mask */
} LDD_ADC_TPinMask;
/*! Structure used to describing one sample */
typedef struct {
uint8_t ChannelIdx; /*!< Channel index */
} LDD_ADC_TSample;
/*! Type specifying the ADC compare mode */
typedef enum {
LDD_ADC_LESS_THAN = 0x00u, /*!< Compare true if the result is less than the Low compare value */
LDD_ADC_GREATER_THAN_OR_EQUAL = 0x01u, /*!< Compare true if the result is greater than or equal to Low compare value */
LDD_ADC_INSIDE_RANGE_INCLUSIVE = 0x02u, /*!< Compare true if the result is greater than or equal to Low compare value and the result is less than or equal to High compare value */
LDD_ADC_INSIDE_RANGE_NOT_INCLUSIVE = 0x03u, /*!< Compare true if the result is greater than Low compare value and the result is less than High compare value */
LDD_ADC_OUTSIDE_RANGE_INCLUSIVE = 0x04u, /*!< Compare true if the result is less than or equal to Low compare value or the result is greater than or equal to High compare value */
LDD_ADC_OUTSIDE_RANGE_NOT_INCLUSIVE = 0x05u /*!< Compare true if the result is less than Low compare value or the result is greater than High compare value */
} LDD_ADC_TCompareMode;
/*
** ===================================================================
** I2C device types and constants
** ===================================================================
*/
#define LDD_I2C_SDA_PIN 0x01u /*!< SDA pin mask */
#define LDD_I2C_SCL_PIN 0x02u /*!< SCL pin mask */
#define LDD_I2C_ON_MASTER_BLOCK_SENT 0x0001u /*!< OnMasterBlockSent event mask */
#define LDD_I2C_ON_MASTER_BLOCK_RECEIVED 0x0002u /*!< OnMasterBlockReceived event mask */
#define LDD_I2C_ON_SLAVE_BLOCK_SENT 0x0004u /*!< OnSlaveBlockSent event mask */
#define LDD_I2C_ON_SLAVE_BLOCK_RECEIVED 0x0008u /*!< OnSlaveBlockReceived event mask */
#define LDD_I2C_ON_SLAVE_TX_REQUEST 0x0010u /*!< OnSlaveTxRequest event mask */
#define LDD_I2C_ON_SLAVE_RX_REQUEST 0x0020u /*!< OnSlaveRxRequest event mask */
#define LDD_I2C_ON_ERROR 0x0040u /*!< OnError event mask */
#define LDD_I2C_ON_SLAVE_SM_BUS_CALL_ADDR 0x0080u /*!< OnSlaveSMBusCallAddr event mask */
#define LDD_I2C_ON_SLAVE_SM_BUS_ALERT_RESPONSE 0x0100u /*!< OnSlaveSMBusAlertResponse event mask */
#define LDD_I2C_ON_SLAVE_GENERAL_CALL_ADDR 0x0200u /*!< OnSlaveGeneralCallAddr event mask */
#define LDD_I2C_ON_MASTER_BYTE_RECEIVED 0x0400u /*!< OnMasterByteReceived event mask */
#define LDD_I2C_ON_SLAVE_BYTE_RECEIVED 0x0800u /*!< OnMasterByteReceived event mask */
#define LDD_I2C_ON_BUS_START_DETECTED 0x1000u /*!< OnBusStartDetected event mask */
#define LDD_I2C_ON_BUS_STOP_DETECTED 0x2000u /*!< OnBusStopDetected event mask */
#define LDD_I2C_SLAVE_TX_UNDERRUN 0x0001u /*!< SlaveTxUnderrun error mask */
#define LDD_I2C_SLAVE_RX_OVERRUN 0x0002u /*!< SlaveRxOverrun error mask */
#define LDD_I2C_ARBIT_LOST 0x0004u /*!< ArbitLost error mask */
#define LDD_I2C_MASTER_NACK 0x0008u /*!< MasterNACK error mask */
#define LDD_I2C_SCL_LOW_TIMEOUT 0x0010u /*!< SCLLowTimeout error mask */
#define LDD_I2C_SDA_LOW_TIMEOUT 0x0020u /*!< SDALowTimeout error mask */
#define LDD_I2C_SLAVE_NACK 0x0040u /*!< SlaveNACK error mask */
typedef uint16_t LDD_I2C_TSize; /*!< Type specifying the length of the data or buffer. */
typedef uint16_t LDD_I2C_TAddr; /*!< Type specifying the address variable */
typedef uint16_t LDD_I2C_TErrorMask; /*!< Type specifying the error mask type. */
typedef bool LDD_I2C_TMode; /*!< Type specifynng the Actual operating mode */
/*! Type specifying the address type */
typedef enum {
LDD_I2C_ADDRTYPE_7BITS, /*!< 7 bits address */
LDD_I2C_ADDRTYPE_10BITS, /*!< 10 bits address */
LDD_I2C_ADDRTYPE_GENERAL_CALL /*!< General call address */
} LDD_I2C_TAddrType;
/*! Type specifying generate the stop condition */
typedef enum {
LDD_I2C_NO_SEND_STOP, /*!< Do not send stop signal */
LDD_I2C_SEND_STOP /*!< Send stop signal */
} LDD_I2C_TSendStop;
/*! Type specifying the I2C state of BUS. */
typedef enum {
LDD_I2C_BUSY, /*!< The bus is busy */
LDD_I2C_IDLE /*!< The bus is idle */
} LDD_I2C_TBusState;
/*! Type specifying the I2C byte acknowledge response. */
typedef enum {
LDD_I2C_ACK_BYTE, /*!< Byte acknowledged */
LDD_I2C_NACK_BYTE /*!< Byte not acknowledged */
} LDD_I2C_TAckType;
/*! Communication statistics */
typedef struct {
uint32_t MasterSentChars; /*!< Number of master transmitted characters. */
uint32_t MasterReceivedChars; /*!< Number of master received characters. */
uint32_t MasterNacks; /*!< Number of no acknowledges. */
uint32_t ArbitLost; /*!< Number of lost the bus arbitration. */
uint32_t SlaveSentChars; /*!< Number of slave transmitted characters. */
uint32_t SlaveReceivedChars; /*!< Number of slave received characters. */
uint32_t SlaveTxUnderrun; /*!< Number of slave underrun. */
uint32_t SlaveRxOverrun; /*!< Number of slave overrun. */
uint32_t SlaveGeneralCallAddr; /*!< Number of a general call address. */
uint32_t SlaveSmBusCallAddr; /*!< Number of a SMBus call address. */
uint32_t SlaveSmBusAlertResponse; /*!< Number of slave SMBus alert response received. */
uint32_t SCLLowTimeout; /*!< Number of SCL low timeout occur. */
uint32_t SDALowTimeout; /*!< Number of SCL low timeout occur. */
} LDD_I2C_TStats;
/*
** ===================================================================
** SegLCD device types and constants
** ===================================================================
*/
#define LDD_SEGLCD_ON_FRAME_FREQUENCY 0x0001u /*!< OnFrameFrequency event mask */
#define LDD_SEGLCD_ON_FAULT_DETECT_COMPLETE 0x0002u /*!< OnFaultDetectComplete event mask */
typedef uint8_t LDD_SegLCD_TPinIndex; /*!< Type specifying the segment LCD pin index variable */
typedef uint8_t LDD_SegLCD_TFrontplaneData; /*!< Type specifying the frontplane/backplane segment variable */
typedef uint8_t LDD_SegLCD_TFaultValue; /*!< Type specifying the frontplane/backplane segment variable */
/*! Types specifying the segment LCD blinking. */
typedef enum {
LDD_SEGLCD_BLINK_OFF, /*!< Disables display blinking */
LDD_SEGLCD_BLINK_ALL, /*!< Display blank during the blink period */
LDD_SEGLCD_BLINK_ALL_ALTERNATE /*!< Blinking between alternate backplane */
} LDD_SegLCD_TBlinking;
/*! Segment LCD blank state type. */
typedef enum {
LDD_SEGLCD_BLANK_STATE, /*!< Blank display mode */
LDD_SEGLCD_NORMAL_STATE, /*!< Normal display mode */
LDD_SEGLCD_ALTERNATE_STATE /*!< Alternate display mode */
} LDD_SegLCD_TSetBlank;
/*! Segment LCD pin type (frontplane/backplane) */
typedef enum {
LDD_SEGLCD_BACKPLANE_PIN, /*!< Backplane pin */
LDD_SEGLCD_FRONTPLANE_PIN /*!< Frontplane pin */
} LDD_SegLCD_TPinType;
/*
** ===================================================================
** GPIO device types and constants
** ===================================================================
*/
#define LDD_GPIO_PIN_0 0x01u /*!< Pin 0 inside the port */
#define LDD_GPIO_PIN_1 0x02u /*!< Pin 1 inside the port */
#define LDD_GPIO_PIN_2 0x04u /*!< Pin 2 inside the port */
#define LDD_GPIO_PIN_3 0x08u /*!< Pin 3 inside the port */
#define LDD_GPIO_PIN_4 0x10u /*!< Pin 4 inside the port */
#define LDD_GPIO_PIN_5 0x20u /*!< Pin 5 inside the port */
#define LDD_GPIO_PIN_6 0x40u /*!< Pin 6 inside the port */
#define LDD_GPIO_PIN_7 0x80u /*!< Pin 7 inside the port */
#define LDD_GPIO_PIN_8 0x0100u /*!< Pin 8 inside the port */
#define LDD_GPIO_PIN_9 0x0200u /*!< Pin 9 inside the port */
#define LDD_GPIO_PIN_10 0x0400u /*!< Pin 10 inside the port */
#define LDD_GPIO_PIN_11 0x0800u /*!< Pin 11 inside the port */
#define LDD_GPIO_PIN_12 0x1000u /*!< Pin 12 inside the port */
#define LDD_GPIO_PIN_13 0x2000u /*!< Pin 13 inside the port */
#define LDD_GPIO_PIN_14 0x4000u /*!< Pin 14 inside the port */
#define LDD_GPIO_PIN_15 0x8000u /*!< Pin 15 inside the port */
#define LDD_GPIO_PIN_16 0x00010000u /*!< Pin 16 inside the port */
#define LDD_GPIO_PIN_17 0x00020000u /*!< Pin 17 inside the port */
#define LDD_GPIO_PIN_18 0x00040000u /*!< Pin 18 inside the port */
#define LDD_GPIO_PIN_19 0x00080000u /*!< Pin 19 inside the port */
#define LDD_GPIO_PIN_20 0x00100000u /*!< Pin 20 inside the port */
#define LDD_GPIO_PIN_21 0x00200000u /*!< Pin 21 inside the port */
#define LDD_GPIO_PIN_22 0x00400000u /*!< Pin 22 inside the port */
#define LDD_GPIO_PIN_23 0x00800000u /*!< Pin 23 inside the port */
#define LDD_GPIO_PIN_24 0x01000000u /*!< Pin 24 inside the port */
#define LDD_GPIO_PIN_25 0x02000000u /*!< Pin 25 inside the port */
#define LDD_GPIO_PIN_26 0x04000000u /*!< Pin 26 inside the port */
#define LDD_GPIO_PIN_27 0x08000000u /*!< Pin 27 inside the port */
#define LDD_GPIO_PIN_28 0x10000000u /*!< Pin 28 inside the port */
#define LDD_GPIO_PIN_29 0x20000000u /*!< Pin 29 inside the port */
#define LDD_GPIO_PIN_30 0x40000000u /*!< Pin 30 inside the port */
#define LDD_GPIO_PIN_31 0x80000000u /*!< Pin 31 inside the port */
#define LDD_GPIO_ON_PORT_EVENT 0x01u /*!< OnPortEvent event mask */
typedef uint32_t LDD_GPIO_TBitField; /*!< Abstract type specifying the bit field within the port. */
/*! Defines condition when event is invoked. */
typedef enum {
LDD_GPIO_DISABLED = 0x00u, /*!< Event doesn't invoke */
LDD_GPIO_LOW = 0x00080000u, /*!< Event when logic zero */
LDD_GPIO_HIGH = 0x000C0000u, /*!< Event when logic one */
LDD_GPIO_RISING = 0x00090000u, /*!< Event on rising edge */
LDD_GPIO_FALLING = 0x000A0000u, /*!< Event on falling edge */
LDD_GPIO_BOTH = 0x000B0000u /*!< Event on rising and falling edge */
} LDD_GPIO_TEventCondition; /*!< Defines condition when event is invoked. */
#define LDD_GPIO_EVENT_CONDITIONS_MASK 0x000F0000u
/*
** ===================================================================
** BITSIO device types and constants
** ===================================================================
*/
#define LDD_BITSIO_PIN_0 0x01U /*!< Pin 0 inside pin list of component */
#define LDD_BITSIO_PIN_1 0x02U /*!< Pin 1 inside pin list of component */
#define LDD_BITSIO_PIN_2 0x04U /*!< Pin 2 inside pin list of component */
#define LDD_BITSIO_PIN_3 0x08U /*!< Pin 3 inside pin list of component */
#define LDD_BITSIO_PIN_4 0x10U /*!< Pin 4 inside pin list of component */
#define LDD_BITSIO_PIN_5 0x20U /*!< Pin 5 inside pin list of component */
#define LDD_BITSIO_PIN_6 0x40U /*!< Pin 6 inside pin list of component */
#define LDD_BITSIO_PIN_7 0x80U /*!< Pin 7 inside pin list of component */
#define LDD_BITSIO_PIN_8 0x0100U /*!< Pin 8 inside pin list of component */
#define LDD_BITSIO_PIN_9 0x0200U /*!< Pin 9 inside pin list of component */
#define LDD_BITSIO_PIN_10 0x0400U /*!< Pin 10 inside pin list of component */
#define LDD_BITSIO_PIN_11 0x0800U /*!< Pin 11 inside pin list of component */
#define LDD_BITSIO_PIN_12 0x1000U /*!< Pin 12 inside pin list of component */
#define LDD_BITSIO_PIN_13 0x2000U /*!< Pin 13 inside pin list of component */
#define LDD_BITSIO_PIN_14 0x4000U /*!< Pin 14 inside pin list of component */
#define LDD_BITSIO_PIN_15 0x8000U /*!< Pin 15 inside pin list of component */
#define LDD_BITSIO_PIN_16 0x00010000U /*!< Pin 16 inside pin list of component */
#define LDD_BITSIO_PIN_17 0x00020000U /*!< Pin 17 inside pin list of component */
#define LDD_BITSIO_PIN_18 0x00040000U /*!< Pin 18 inside pin list of component */
#define LDD_BITSIO_PIN_19 0x00080000U /*!< Pin 19 inside pin list of component */
#define LDD_BITSIO_PIN_20 0x00100000U /*!< Pin 20 inside pin list of component */
#define LDD_BITSIO_PIN_21 0x00200000U /*!< Pin 21 inside pin list of component */
#define LDD_BITSIO_PIN_22 0x00400000U /*!< Pin 22 inside pin list of component */
#define LDD_BITSIO_PIN_23 0x00800000U /*!< Pin 23 inside pin list of component */
#define LDD_BITSIO_PIN_24 0x01000000U /*!< Pin 24 inside pin list of component */
#define LDD_BITSIO_PIN_25 0x02000000U /*!< Pin 25 inside pin list of component */
#define LDD_BITSIO_PIN_26 0x04000000U /*!< Pin 26 inside pin list of component */
#define LDD_BITSIO_PIN_27 0x08000000U /*!< Pin 27 inside pin list of component */
#define LDD_BITSIO_PIN_28 0x10000000U /*!< Pin 28 inside pin list of component */
#define LDD_BITSIO_PIN_29 0x20000000U /*!< Pin 29 inside pin list of component */
#define LDD_BITSIO_PIN_30 0x40000000U /*!< Pin 30 inside pin list of component */
#define LDD_BITSIO_PIN_31 0x80000000U /*!< Pin 31 inside pin list of component */
/*
** ===================================================================
** Ethernet device types and constants
** ===================================================================
*/
#define LDD_ETH_MDC_PIN 0x01u /*!< MDC pin mask */
#define LDD_ETH_MDIO_PIN 0x02u /*!< MDIO pin mask */
#define LDD_ETH_COL_PIN 0x04u /*!< COL pin mask */
#define LDD_ETH_CRS_PIN 0x08u /*!< CRS pin mask */
#define LDD_ETH_TXCLK_PIN 0x10u /*!< TXCLK pin mask */
#define LDD_ETH_TXD0_PIN 0x20u /*!< TXD0 pin mask */
#define LDD_ETH_TXD1_PIN 0x40u /*!< TXD1 pin mask */
#define LDD_ETH_TXD2_PIN 0x80u /*!< TXD2 pin mask */
#define LDD_ETH_TXD3_PIN 0x0100u /*!< TXD3 pin mask */
#define LDD_ETH_TXEN_PIN 0x0200u /*!< TXEN pin mask */
#define LDD_ETH_TXER_PIN 0x0400u /*!< TXER pin mask */
#define LDD_ETH_RXCLK_PIN 0x0800u /*!< RXCLK pin mask */
#define LDD_ETH_RXDV_PIN 0x1000u /*!< RXDV pin mask */
#define LDD_ETH_RXD0_PIN 0x2000u /*!< RXD0 pin mask */
#define LDD_ETH_RXD1_PIN 0x4000u /*!< RXD1 pin mask */
#define LDD_ETH_RXD2_PIN 0x8000u /*!< RXD2 pin mask */
#define LDD_ETH_RXD3_PIN 0x00010000u /*!< RXD3 pin mask */
#define LDD_ETH_RXER_PIN 0x00020000u /*!< RXER pin mask */
#define LDD_ETH_ON_FRAME_TRANSMITTED 0x01u /*!< OnFrameTransmitted event mask */
#define LDD_ETH_ON_FRAME_TRANSMITTED_TIMESTAMPED 0x02u /*!< OnFrameTransmittedTimestamped event mask */
#define LDD_ETH_ON_FRAME_RECEIVED 0x04u /*!< OnFrameReceived event mask */
#define LDD_ETH_ON_FRAME_RECEIVED_TIMESTAMPED 0x08u /*!< OnFrameReceivedTimestamped event mask */
#define LDD_ETH_ON_MII_FINISHED 0x10u /*!< OnMIIFinished event mask */
#define LDD_ETH_ON_FATAL_ERROR 0x20u /*!< OnFatalError event mask */
#define LDD_ETH_ON_WAKE_UP 0x40u /*!< OnWakeUp event mask */
typedef uint8_t LDD_ETH_TMACAddress[6]; /*!< Ethernet MAC address */
/*! Ethernet duplex mode */
typedef enum {
LDD_ETH_FULL_DUPLEX, /*!< Full duplex mode */
LDD_ETH_HALF_DUPLEX /*!< Half duplex mode */
} LDD_ETH_TDuplexMode;
/*! Ethernet address filter mode options */
typedef enum {
LDD_ETH_PROMISC, /*!< Promiscuous mode */
LDD_ETH_REJECT_BC, /*!< Reject broadcast frames */
LDD_ETH_ACCEPT_BC /*!< Accept broadcast frames */
} LDD_ETH_TFilterMode;
/*! Ethernet sleep mode options */
typedef enum {
LDD_ETH_ENABLED, /*!< Sleep mode enabled */
LDD_ETH_ENABLED_WITH_WAKEUP, /*!< Sleep mode enabled, waiting for wake-up */
LDD_ETH_DISABLED /*!< Sleep mode disabled */
} LDD_ETH_TSleepMode;
/*! Ethernet frame buffer (fragment) descriptor */
typedef struct {
uint8_t *DataPtr; /*!< Pointer to buffer data */
uint16_t Size; /*!< Buffer data size */
} LDD_ETH_TBufferDesc;
typedef LDD_ETH_TBufferDesc* LDD_ETH_TBufferDescPtr; /*!< Frame buffer descriptor pointer type */
/*! Ethernet communication statistics */
typedef struct {
uint32_t TxRMONDropEvents; /*!< Count of frames not counted correctly */
uint32_t TxRMONOctets; /*!< Octet count for frames transmitted without error */
uint32_t TxRMONPackets; /*!< Transmitted packet count */
uint32_t TxRMONBroadcastPackets; /*!< Transmitted broadcast packets */
uint32_t TxRMONMulticastPackets; /*!< Transmitted multicast packets */
uint32_t TxRMONCRCAlignErrors; /*!< Transmitted packets with CRC or alignment error */
uint32_t TxRMONUndersizePackets; /*!< Transmitted packets smaller than 64 bytes with good CRC */
uint32_t TxRMONOversizePackets; /*!< Transmitted packets greater than max. frame length with good CRC */
uint32_t TxRMONFragments; /*!< Transmitted packets smaller than 64 bytes with bad CRC */
uint32_t TxRMONJabbers; /*!< Transmitted packets greater than max. frame length with bad CRC */
uint32_t TxRMONCollisions; /*!< Transmit collision count */
uint32_t TxRMONPackets64Octets; /*!< Transmitted 64 byte packets */
uint32_t TxRMONPackets65To127Octets; /*!< Transmitted 65 to 127 byte packets */
uint32_t TxRMONPackets128To255Octets; /*!< Transmitted 128 to 255 byte packets */
uint32_t TxRMONPackets256To511Octets; /*!< Transmitted 256 to 511 byte packets */
uint32_t TxRMONPackets512To1023Octets; /*!< Transmitted 512 to 1023 byte packets */
uint32_t TxRMONPackets1024To2047Octets; /*!< Transmitted 1024 to 2047 byte packets */
uint32_t TxRMONPacketsGreaterThan2048Octets; /*!< Transmitted packets greater than 2048 byte */
uint32_t TxIEEEDrop; /*!< Count of frames not counted correctly */
uint32_t TxIEEEFrameOK; /*!< Frames transmitted OK */
uint32_t TxIEEESingleCollision; /*!< Frames transmitted with single collision */
uint32_t TxIEEEMultipleCollisions; /*!< Frames transmitted with multiple collisions */
uint32_t TxIEEEDeferralDelay; /*!< Frames transmitted after deferral delay */
uint32_t TxIEEELateCollision; /*!< Frames transmitted with late collision */
uint32_t TxIEEEExcessiveCollision; /*!< Frames transmitted with excessive collisions */
uint32_t TxIEEEFIFOUnderrun; /*!< Frames transmitted with transmit FIFO underrun */
uint32_t TxIEEECarrierSenseError; /*!< Frames transmitted with carrier sense error */
uint32_t TxIEEESQEError; /*!< Frames transmitted with SQE error */
uint32_t TxIEEEPauseFrame; /*!< Flow control pause frames transmitted */
uint32_t TxIEEEOctetsOK; /*!< Octet count for frames transmitted without error */
uint32_t RxRMONDropEvents; /*!< Count of frames not counted correctly */
uint32_t RxRMONOctets; /*!< Octet count for frames recieved without error */
uint32_t RxRMONPackets; /*!< Received packet count */
uint32_t RxRMONBroadcastPackets; /*!< Received broadcast packets */
uint32_t RxRMONMulticastPackets; /*!< Received multicast packets */
uint32_t RxRMONCRCAlignErrors; /*!< Received packets with CRC or alignment error */
uint32_t RxRMONUndersizePackets; /*!< Received packets smaller than 64 bytes with good CRC */
uint32_t RxRMONOversizePackets; /*!< Received packets greater than max. frame length with good CRC */
uint32_t RxRMONFragments; /*!< Received packets smaller than 64 bytes with bad CRC */
uint32_t RxRMONJabbers; /*!< Received packets greater than max. frame length with bad CRC */
uint32_t RxRMONPackets64Octets; /*!< Received 64 byte packets */
uint32_t RxRMONPackets65To127Octets; /*!< Received 65 to 127 byte packets */
uint32_t RxRMONPackets128To255Octets; /*!< Received 128 to 255 byte packets */
uint32_t RxRMONPackets256To511Octets; /*!< Received 256 to 511 byte packets */
uint32_t RxRMONPackets512To1023Octets; /*!< Received 512 to 1023 byte packets */
uint32_t RxRMONPackets1024To2047Octets; /*!< Received 1024 to 2047 byte packets */
uint32_t RxRMONPacketsGreaterThan2048Octets; /*!< Received packets greater than 2048 byte */
uint32_t RxIEEEDrop; /*!< Count of frames not counted correctly */
uint32_t RxIEEEFrameOK; /*!< Frames received OK */
uint32_t RxIEEECRCError; /*!< Frames received with CRC error */
uint32_t RxIEEEAlignmentError; /*!< Frames received with alignment error */
uint32_t RxIEEEFIFOOverflow; /*!< Receive FIFO overflow count */
uint32_t RxIEEEPauseFrame; /*!< Flow control pause frames received */
uint32_t RxIEEEOctetsOK; /*!< Octet count for frames received without error */
} LDD_ETH_TStats;
/*
** ===================================================================
** FlexCAN device types and constants
** ===================================================================
*/
typedef uint8_t LDD_CAN_TMBIndex; /*!< CAN message buffer index */
typedef uint32_t LDD_CAN_TAccMask; /*!< Type specifying the acceptance mask variable. */
typedef uint32_t LDD_CAN_TMessageID; /*!< Type specifying the ID mask variable. */
typedef uint8_t LDD_CAN_TErrorCounter; /*!< Type specifying the error counter variable. */
typedef uint32_t LDD_CAN_TErrorMask; /*!< Type specifying the error mask variable. */
typedef uint16_t LDD_CAN_TBufferMask; /*!< Type specifying the message buffer mask variable. */
#define LDD_CAN_RX_PIN 0x01U /*!< Rx pin mask */
#define LDD_CAN_TX_PIN 0x02U /*!< Tx pin mask */
#define LDD_CAN_ON_FULL_RXBUFFER 0x01U /*!< OnFullRxBuffer event mask */
#define LDD_CAN_ON_FREE_TXBUFFER 0x02U /*!< OnFreeTxBuffer event mask */
#define LDD_CAN_ON_BUSOFF 0x04U /*!< OnBusOff event mask */
#define LDD_CAN_ON_TXWARNING 0x08U /*!< OnTransmitterWarning event mask */
#define LDD_CAN_ON_RXWARNING 0x10U /*!< OnReceiverWarning event mask */
#define LDD_CAN_ON_ERROR 0x20U /*!< OnError event mask */
#define LDD_CAN_ON_WAKEUP 0x40U /*!< OnWakeUp event mask */
#define LDD_CAN_BIT0_ERROR 0x4000UL /*!< Bit0 error detect error mask */
#define LDD_CAN_BIT1_ERROR 0x8000UL /*!< Bit1 error detect error mask */
#define LDD_CAN_ACK_ERROR 0x2000UL /*!< Acknowledge error detect error mask */
#define LDD_CAN_CRC_ERROR 0x1000UL /*!< Cyclic redundancy check error detect error mask */
#define LDD_CAN_FORM_ERROR 0x0800UL /*!< Message form error detect error mask */
#define LDD_CAN_STUFFING_ERROR 0x0400UL /*!< Bit stuff error detect error mask */
#define LDD_CAN_MESSAGE_ID_EXT 0x80000000UL /*!< Value specifying extended Mask, ID */
/*! Type specifying the CAN frame type. */
typedef enum {
LDD_CAN_MB_RX_NOT_ACTIVE = 0x00U,
LDD_CAN_MB_RX_FULL = 0x02U,
LDD_CAN_MB_RX_EMPTY = 0x04U,
LDD_CAN_MB_RX_OVERRUN = 0x06U,
LDD_CAN_MB_RX_BUSY = 0x01U,
LDD_CAN_MB_RX_RANSWER = 0x0AU
} LDD_CAN_TRxBufferState;
/*! Type specifying the CAN frame type. */
typedef enum {
LDD_CAN_DATA_FRAME, /*!< Data frame type received or transmitted */
LDD_CAN_REMOTE_FRAME, /*!< Remote frame type */
LDD_CAN_RESPONSE_FRAME /*!< Response frame type - Tx buffer send data after receiving remote frame with the same ID */
} LDD_CAN_TFrameType;
/*! Type specifying the CAN communication statistics. */
typedef struct {
uint32_t TxFrames; /*!< Transmitted frame counter */
uint32_t TxWarnings; /*!< Transmission warning counter */
uint32_t RxFrames; /*!< Received frame counter */
uint32_t RxWarnings; /*!< Reception warning counter */
uint32_t BusOffs; /*!< Bus off counter */
uint32_t Wakeups; /*!< Wakeup counter */
uint32_t Bit0Errors; /*!< Bit0 error counter */
uint32_t Bit1Errors; /*!< Bit1 error counter */
uint32_t AckErrors; /*!< ACK error counter */
uint32_t CrcErrors; /*!< CRC error counter */
uint32_t FormErrors; /*!< Message form error counter */
uint32_t BitStuffErrors; /*!< Bit stuff error counter */
uint32_t Errors; /*!< Error counter */
} LDD_CAN_TStats;
/*! Type specifying the CAN frame features. */
typedef struct {
LDD_CAN_TMessageID MessageID; /*!< Message ID */
LDD_CAN_TFrameType FrameType; /*!< Type of the frame DATA/REMOTE */
uint8_t *Data; /*!< Message data buffer */
uint8_t Length; /*!< Message length */
uint16_t TimeStamp; /*!< Message time stamp */
uint8_t LocPriority; /*!< Local Priority Tx Buffers */
} LDD_CAN_TFrame;
/*
** ===================================================================
** USB device types and constants
** ===================================================================
*/
/* Events' masks */
#define LDD_USB_ON_DEVICE_RESET 0x00000001u /*!< OnDeviceReset event mask */
#define LDD_USB_ON_DEVICE_SPEED_DETECT 0x00000002u /*!< OnDeviceSpeedDetect event mask */
#define LDD_USB_ON_DEVICE_SUSPEND 0x00000004u /*!< OnDeviceSuspend event mask */
#define LDD_USB_ON_DEVICE_RESUME 0x00000008u /*!< OnDeviceResume event mask */
#define LDD_USB_ON_DEVICE_SETUP_PACKET 0x00000010u /*!< OnDeviceSetupPacket event mask */
#define LDD_USB_ON_DEVICE_SOF 0x00000020u /*!< OnDeviceSof event mask */
#define LDD_USB_ON_DEVICE_1MS_TIMER 0x00000040u /*!< OnDevice1msTimer event mask */
#define LDD_USB_ON_DEVICE_1_MS_TIMER 0x00000040u /*!< OnDevice1msTimer event mask */
#define LDD_USB_ON_DEVICE_ERROR 0x00000080u /*!< OnDeviceError event mask */
#define LDD_USB_ON_HOST_DEVICE_DEATTACH 0x00000100u /*!< OnHostDeviceAttach event mask */
#define LDD_USB_ON_HOST_RESET_RECOVERY 0x00000200u /*!< OnHostResetRecovery event mask */
#define LDD_USB_ON_HOST_RESUME_RECOVERY 0x00000400u /*!< OnHostResumeRecovery event mask */
#define LDD_USB_ON_HOST_1MS_TIMER 0x00000800u /*!< 1 ms timer event mask */
#define LDD_USB_ON_HOST_1_MS_TIMER 0x00000800u /*!< 1 ms timer event mask */
#define LDD_USB_ON_HOST_ERROR 0x00001000u /*!< OnHostError event mask */
#define LDD_USB_ON_OTG_DEVICE 0x00002000u /*!< OnOtgDevice event mask */
#define LDD_USB_ON_OTG_HOST 0x00004000u /*!< OnOtgHost event mask */
#define LDD_USB_ON_OTG_STATE_CHANGE 0x00008000u /*!< OnOtgStageChange event mask */
#define LDD_USB_ON_SIGNAL_CHANGE 0x00010000u /*!< OnSignalChange event mask */
/* Data pins' masks */
#define LDD_USB_DP_PIN 0x00000001u /*!< Data+ pin mask */
#define LDD_USB_DM_PIN 0x00000002u /*!< Data- pin mask */
/* Pullup/pulldown pin masks */
#define LDD_USB_DP_PU_PIN 0x00000004u /*!< Data+ pull-up pin mask */
#define LDD_USB_DM_PU_PIN 0x00000008u /*!< Data- pull-up pin mask */
#define LDD_USB_DP_PD_PIN 0x00000010u /*!< Data+ pull-down pin mask */
#define LDD_USB_DM_PD_PIN 0x00000020u /*!< Data- pull-down pin mask */
/* VBUS pins' mask */
#define LDD_USB_DEVICE_VBUS_DETECT_PIN 0x00000040u /*!< VBUS detect pin mask */
#define LDD_USB_HOST_VBUS_ENABLE_PIN 0x00000080u /*!< VBUS enable pin mask */
#define LDD_USB_HOST_VBUS_OVERCURRENT_PIN 0x00000100u /*!< VBUS overcurrent pin mask */
/* OTG pins' masks */
#define LDD_USB_OTG_ID_PIN 0x00000200u /*!< ID pin mask */
#define LDD_USB_OTG_VBUS_VALID_PIN 0x00000400u /*!< VBUS valid pin mask */
#define LDD_USB_OTG_SESSION_VALID_PIN 0x00000800u /*!< SESSION valid pin mask */
#define LDD_USB_OTG_B_SESSION_END_PIN 0x00004000u /*!< B SESSION end pin mask */
#define LDD_USB_OTG_VBUS_ENABLE_PIN 0x00008000u /*!< VBUS drive pin mask */
#define LDD_USB_OTG_VBUS_CHARGE_PIN 0x00010000u /*!< VBUS charge pin mask */
#define LDD_USB_OTG_VBUS_DISCHARGE_PIN 0x00020000u /*!< VBUS discharge pin mask */
/* ULPI pins' masks */
#define LDD_USB_ULPI_CLK_PIN 0x00080000u /*!< ULPI_CLK pin mask */
#define LDD_USB_ULPI_DIR_PIN 0x00100000u /*!< ULPI_DIR pin mask */
#define LDD_USB_ULPI_NXT_PIN 0x00200000u /*!< ULPI_NXT pin mask */
#define LDD_USB_ULPI_STP_PIN 0x00400000u /*!< ULPI_STOP pin mask */
#define LDD_USB_ULPI_DATA_0_PIN 0x00800000u /*!< ULPI_DATA_0 pin mask */
#define LDD_USB_ULPI_DATA_1_PIN 0x01000000u /*!< ULPI_DATA_1 pin mask */
#define LDD_USB_ULPI_DATA_2_PIN 0x02000000u /*!< ULPI_DATA_2 pin mask */
#define LDD_USB_ULPI_DATA_3_PIN 0x04000000u /*!< ULPI_DATA_3 pin mask */
#define LDD_USB_ULPI_DATA_4_PIN 0x08000000u /*!< ULPI_DATA_4 pin mask */
#define LDD_USB_ULPI_DATA_5_PIN 0x10000000u /*!< ULPI_DATA_5 pin mask */
#define LDD_USB_ULPI_DATA_6_PIN 0x20000000u /*!< ULPI_DATA_6 pin mask */
#define LDD_USB_ULPI_DATA_7_PIN 0x40000000u /*!< ULPI_DATA_7 pin mask */
/* Alternate clock pin*/
#define LDD_USB_CLKIN_PIN 0x80000000u /*!< Alternate clock pin mask */
#define LDD_USB_ALT_CLK_PIN 0x80000000u /*!< Alternate clock pin mask */
/* DeviceSetUsbStatus()/DeviceGetUsbStatus methods Cmd/CmdStatusPtr param. values */
#define LDD_USB_CMD_GET_EP_STATUS 0x00u /*!< Get endpoint status command ID */
#define LDD_USB_CMD_SET_EP_HALT_FATURE 0x01u /*!< Set endpoint HALT feature command ID */
#define LDD_USB_CMD_CLR_EP_HALT_FATURE 0x02u /*!< Clear endpoint HALT feature command ID */
#define LDD_USB_CMD_EP_STATUS_HALT_MASK 0x01u /*!< Endpoint halt status mask */
/* DeviceSetUsbStatus()/DeviceGetUsbStatus methods Recipient param. values */
/* (see USB 2.0, chapter 9.3.4 wIndex description)*/
#define LDD_USB_ID_EP0_OUT 0x00u /*!< EP0 OUT component ID */
#define LDD_USB_ID_EP0_IN 0x80u /*!< EP0 IN component ID */
#define LDD_USB_ID_EP1_OUT 0x01u /*!< EP1 OUT component ID */
#define LDD_USB_ID_EP1_IN 0x81u /*!< EP1 IN component ID */
#define LDD_USB_ID_EP2_OUT 0x02u /*!< EP2 OUT component ID */
#define LDD_USB_ID_EP2_IN 0x82u /*!< EP2 IN component ID */
#define LDD_USB_ID_EP3_OUT 0x03u /*!< EP3 OUT component ID */
#define LDD_USB_ID_EP3_IN 0x83u /*!< EP3 IN component ID */
#define LDD_USB_ID_EP4_OUT 0x04u /*!< EP4 OUT component ID */
#define LDD_USB_ID_EP4_IN 0x84u /*!< EP4 IN component ID */
#define LDD_USB_ID_EP5_OUT 0x05u /*!< EP5 OUT component ID */
#define LDD_USB_ID_EP5_IN 0x85u /*!< EP5 IN component ID */
#define LDD_USB_ID_EP6_OUT 0x06u /*!< EP6 OUT component ID */
#define LDD_USB_ID_EP6_IN 0x86u /*!< EP6 IN component ID */
#define LDD_USB_ID_EP7_OUT 0x07u /*!< EP7 OUT component ID */
#define LDD_USB_ID_EP7_IN 0x87u /*!< EP7 IN component ID */
#define LDD_USB_ID_EP8_OUT 0x08u /*!< EP8 OUT component ID */
#define LDD_USB_ID_EP8_IN 0x88u /*!< EP8 IN component ID */
#define LDD_USB_ID_EP9_OUT 0x09u /*!< EP9 OUT component ID */
#define LDD_USB_ID_EP9_IN 0x89u /*!< EP9 IN component ID */
#define LDD_USB_ID_EP10_OUT 0x0Au /*!< EP10 OUT component ID */
#define LDD_USB_ID_EP10_IN 0x8Au /*!< EP10 IN component ID */
#define LDD_USB_ID_EP11_OUT 0x0Bu /*!< EP11 OUT component ID */
#define LDD_USB_ID_EP11_IN 0x8Bu /*!< EP11 IN component ID */
#define LDD_USB_ID_EP12_OUT 0x0Cu /*!< EP12 OUT component ID */
#define LDD_USB_ID_EP12_IN 0x8Cu /*!< EP12 IN component ID */
#define LDD_USB_ID_EP13_OUT 0x0Du /*!< EP13 OUT component ID */
#define LDD_USB_ID_EP13_IN 0x8Du /*!< EP13 IN component ID */
#define LDD_USB_ID_EP14_OUT 0x0Eu /*!< EP14 OUT component ID */
#define LDD_USB_ID_EP14_IN 0x8Eu /*!< EP14 IN component ID */
#define LDD_USB_ID_EP15_OUT 0x0Fu /*!< EP15 OUT component ID */
#define LDD_USB_ID_EP15_IN 0x8Fu /*!< EP15 IN component ID */
#define LDD_USB_ID_EP_MASK 0x8Fu /*!< EP15 IN component ID */
/* Token PID */
#define LDD_USB_PID_OUT 0x01u /*!< OUT */
#define LDD_USB_PID_IN 0x09u /*!< IN */
#define LDD_USB_PID_SOF 0x05u /*!< SOF */
#define LDD_USB_PID_SETUP 0x0Du /*!< SETUP */
/* Data PID */
#define LDD_USB_PID_DATA0 0x03u /*!< DATA0 */
#define LDD_USB_PID_DATA1 0x0Bu /*!< DATA1 */
#define LDD_USB_PID_DATA2 0x07u /*!< DATA2 */
#define LDD_USB_PID_MDATA 0x0Fu /*!< MDATA */
/* Handshake PID */
#define LDD_USB_PID_ACK 0x02u /*!< ACK */
#define LDD_USB_PID_NACK 0x0Au /*!< NACK */
#define LDD_USB_PID_STALL 0x0Eu /*!< STALL */
#define LDD_USB_PID_NYET 0x06u /*!< NYET */
/* Special PID */
#define LDD_USB_PID_PRE 0x0Cu /*!< PRE */
#define LDD_USB_PID_ERR 0x0Cu /*!< ERR */
#define LDD_USB_PID_SPLIT 0x08u /*!< SPLIT */
#define LDD_USB_PID_PING 0x04u /*!< PING */
/* Data direction */
#define LDD_USB_DIR_OUT 0x00u /*!< Recipient is Device */
#define LDD_USB_DIR_IN 0x80u /*!< Recipient is Host */
#define LDD_USB_DIR_MASK 0x80u /*!< Bit mask for data transfer direction */
/* Flags used in the TD.Head.Flags variable */
/* The following flag can be used to force zero-length termination(ZLT) of the transfer.
Note: ZLT can be set for all transfer during the initialization of the endpoint.
*/
#define LDD_USB_DEVICE_TRANSFER_FLAG_ZLT 0x01u
/* If the TRANSFER_FLAG_EXT_PARAM is defined all variables of the TD are used
and TD must NOT be freed until transfer is done or is cancelled
(TransferState != LDD_USB_TRANSFER_PENDING)
If not defined only the Head member of TD is used and TD can be freed after
Send/Recv() method returns.
*/
#define LDD_USB_DEVICE_TRANSFER_FLAG_EXT_PARAM 0x02u
#define ERR_COMPONET_SPECIFIC 0x100u
/* Device mode USB specific error codes */
#define ERR_USB_DEVICE_DISABLED (ERR_COMPONET_SPECIFIC + 0x00u) /*!< Device mode is disabled (by the user or by the clock configuration) */
#define ERR_USB_DEVICE_DISABLED_BY_OTG (ERR_COMPONET_SPECIFIC + 0x01u) /*!< Device mode is disabled by the OTG driver */
#define ERR_USB_DEVICE_VBUS_OFF (ERR_COMPONET_SPECIFIC + 0x02u) /*!< No VBUS is detected */
#define ERR_USB_DEVICE_VBUS_ON (ERR_COMPONET_SPECIFIC + 0x03u) /*!< VBUS is detected */
#define ERR_USB_DEVICE_ENABLED (ERR_COMPONET_SPECIFIC + 0x04u) /*!< Device is enabled */
#define ERR_USB_DEVICE_SUSPENDED (ERR_COMPONET_SPECIFIC + 0x05u) /*!< Device is suspended */
#define ERR_USB_DEVICE_SUSPENDED_RESUME_READY (ERR_COMPONET_SPECIFIC + 0x06u) /*!< Device is suspended and ready to generate resume signaling */
#define ERR_USB_DEVICE_RESUME_PENDING (ERR_COMPONET_SPECIFIC + 0x07u) /*!< Device generates resume signaling */
/* Host mode USB specific error codes */
#define ERR_USB_HOST_DISABLED (ERR_COMPONET_SPECIFIC + 0x00u) /*!< Host mode is disabled (by the user or by the clock configuration) */
#define ERR_USB_HOST_DISABLED_BY_OTG (ERR_COMPONET_SPECIFIC + 0x01u) /*!< Host mode is disabled by the OTG driver */
#define ERR_USB_HOST_PORT_POWERED_OFF (ERR_COMPONET_SPECIFIC + 0x02u) /*!< Port is power off */
#define ERR_USB_HOST_PORT_DISCONNECTED (ERR_COMPONET_SPECIFIC + 0x03u) /*!< Port is power on */
#define ERR_USB_HOST_PORT_DISABLED (ERR_COMPONET_SPECIFIC + 0x04u) /*!< Device is connected to the port */
#define ERR_USB_HOST_PORT_RESETING (ERR_COMPONET_SPECIFIC + 0x05u) /*!< Port generates reset signaling */
#define ERR_USB_HOST_PORT_RESET_RECOVERING (ERR_COMPONET_SPECIFIC + 0x06u) /*!< Port waits 10ms for reset recovery */
#define ERR_USB_HOST_PORT_ENABLED (ERR_COMPONET_SPECIFIC + 0x07u) /*!< PortDevice is connected, reset and ready to use */
#define ERR_USB_HOST_PORT_SUSPENDED (ERR_COMPONET_SPECIFIC + 0x08u) /*!< Port is suspended */
#define ERR_USB_HOST_PORT_RESUME_READY (ERR_COMPONET_SPECIFIC + 0x09u) /*!< Port can generate resume signaling */
#define ERR_USB_HOST_PORT_RESUMING (ERR_COMPONET_SPECIFIC + 0x0Au) /*!< Port generates resume signaling */
#define ERR_USB_HOST_PORT_RESUME_RECOVERING (ERR_COMPONET_SPECIFIC + 0x0Bu) /*!< Port generates resume signaling */
/* OTG mode USB specific error codes */
#define ERR_USB_OTG_DISABLED (ERR_COMPONET_SPECIFIC + 0x00u) /*!< OTG device is DISABLED state */
#define ERR_USB_OTG_ENABLED_PENDING (ERR_COMPONET_SPECIFIC + 0x01u) /*!< OTG device is in ENABLED_PENDING state */
#define ERR_USB_OTG_A_IDLE (ERR_COMPONET_SPECIFIC + 0x02u) /*!< OTG device is in A_IDLE state */
#define ERR_USB_OTG_A_WAIT_VRISE (ERR_COMPONET_SPECIFIC + 0x03u) /*!< OTG device is in WAIT_VRISE state */
#define ERR_USB_OTG_A_WAIT_VFALL (ERR_COMPONET_SPECIFIC + 0x05u) /*!< OTG device is in A_WAIT_VFALL state */
#define ERR_USB_OTG_A_WAIT_BCON (ERR_COMPONET_SPECIFIC + 0x07u) /*!< OTG device is in A_WAIT_BCON state */
#define ERR_USB_OTG_A_VBUS_ERROR (ERR_COMPONET_SPECIFIC + 0x09u) /*!< OTG device is in A_VBUS_ERROR state */
#define ERR_USB_OTG_A_SUSPEND (ERR_COMPONET_SPECIFIC + 0x0Au) /*!< OTG device is in A_SUSPEND state */
#define ERR_USB_OTG_B_IDLE (ERR_COMPONET_SPECIFIC + 0x0Cu) /*!< OTG device is in B_IDLE state */
#define ERR_USB_OTG_B_SRP_INIT (ERR_COMPONET_SPECIFIC + 0x0Eu) /*!< OTG device is in B_SRP_INIT state */
#define ERR_USB_OTG_B_WAIT_ACON (ERR_COMPONET_SPECIFIC + 0x0Fu) /*!< OTG device is in B_WAIT_ACON state */
#define ERR_USB_OTG_A_HOST (ERR_COMPONET_SPECIFIC + 0x10u) /*!< OTG device is in A_HOST state */
#define ERR_USB_OTG_A_PERIPHERAL (ERR_COMPONET_SPECIFIC + 0x11u) /*!< OTG device is in A_PERIPHERAL state */
#define ERR_USB_OTG_B_HOST (ERR_COMPONET_SPECIFIC + 0x12u) /*!< OTG device is in B_HOST state */
#define ERR_USB_OTG_B_PERIPHERAL (ERR_COMPONET_SPECIFIC + 0x13u) /*!< OTG device is in B_PERIPHERAL state */
/*! Device speed symbolic names */
typedef enum {
LDD_USB_LOW_SPEED = 0x00u, /*!< Low-speed - 6 Mb/s mode */
LDD_USB_FULL_SPEED = 0x01u, /*!< Full-speed - 12 Mb/s mode */
LDD_USB_HIGH_SPEED = 0x02u, /*!< High-speed - 480 Mb/s mode */
LDD_USB_SPEED_UNKNOWN = 0xFFu /*!< Unkown speed mode */
} LDD_USB_TBusSpeed;
/*! Transfer type symbolic names */
typedef enum {
LDD_USB_CONTROL = 0x00u, /*!< Conrol transfer type */
LDD_USB_ISOCHRONOUS = 0x01u, /*!< Isochronous transfer type */
LDD_USB_BULK = 0x02u, /*!< Bulk transfer type */
LDD_USB_INTERRUPT = 0x03u /*!< Interrupt transfer type */
} LDD_USB_TTransferType;
/*! Transfer state symbolic names */
typedef enum {
LDD_USB_TRANSFER_NONE = 0x00u, /*!< Default valeu for new TD */
LDD_USB_TRANSFER_DONE = 0x01u, /*!< Transfer done */
LDD_USB_TRANSFER_ERROR_CANCELLED = 0x02u, /*!< Transfer cancelled by the user */
LDD_USB_TRANSFER_ERROR_STALLED = 0x03u, /*!< Transfer stalled */
LDD_USB_TRANSFER_ERROR_BUS_TIMEOUT = 0x04u, /*!< Bus timeute detected */
LDD_USB_TRANSFER_ERROR_DATA = 0x05u, /*!< Data error deteceted */
LDD_USB_TRANSFER_ERROR_PID = 0x06u, /*!< PID error deteceted */
LDD_USB_TRANSFER_ERROR_EOF = 0x07u, /*!< EOF error deteceted */
LDD_USB_TRANSFER_ERROR_CRC16 = 0x08u, /*!< CRC16 error deteceted */
LDD_USB_TRANSFER_ERROR_DFN8 = 0x09u, /*!< DFN8 error deteceted */
LDD_USB_TRANSFER_ERROR_DMA = 0x0Au, /*!< DMA error deteceted */
LDD_USB_TRANSFER_ERROR_BTS = 0x0Bu, /*!< BTS error deteceted */
LDD_USB_TRANSFER_ERROR = 0x0Fu, /*!< Transfer error deteceted */
LDD_USB_TRANSFER_QUEUED = 0x10u, /*!< Transfer queued */
LDD_USB_TRANSFER_PENDING = 0x30u /*!< Transfer in proggress */
} LDD_USB_TTransferState;
/*! Setup data packet structure, uint16_t items must be in little-endian format */
typedef struct LDD_USB_TSDP_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request code */
uint16_t wValue; /*!< Word-sized field that varies according to request */
uint16_t wIndex; /*!< Word-sized field that varies according to request, typically used to pass an index or offset */
uint16_t wLength; /*!< Number of bytes to transfer if there is a data stage */
} LDD_USB_TSDP;
/*! Endpoint descriptor structure, uint16_t items must be in little-endian format */
typedef struct LDD_USB_TEpDescriptor_Struct {
uint8_t bLength; /*!< Size of this descriptor in bytes */
uint8_t bDescriptorType; /*!< Descriptor type */
uint8_t bEndpointAddress; /*!< Endpoint address */
uint8_t bmAttributes; /*!< Endpoint attributes */
uint16_t wMaxPacketSize; /*!< Maximum packet size the endpoint is capable of sending or receiving */
uint8_t bInterval; /*!< Interval for polling endpoint for data transfers */
} LDD_USB_TEpDescriptor;
/*! Standard device descriptor structure, uint16_t items must be in little-endian format */
typedef struct LDD_USB_TDevDescriptor_Struct {
uint8_t bLength; /*!< Size of this descriptor in bytes */
uint8_t bDescriptorType; /*!< Descriptor type */
uint16_t bcdUSB; /*!< USB specification release number in binary-coded Decimal */
uint8_t bDeviceClass; /*!< Class code (assigned by the USB-IF) */
uint8_t bDeviceSubClass; /*!< Subclass code (assigned by the USB-IF) */
uint8_t bDeviceProtocol; /*!< Protocol code (assigned by the USB-IF) */
uint8_t bMaxPacketSize0; /*!< Maximum packet size for endpoint zero */
uint16_t idVendor; /*!< Vendor ID (assigned by the USB-IF) */
uint16_t idProduct; /*!< Product ID (assigned by the manufacturer) */
uint16_t bcdDevice; /*!< Device release number in binary-coded decimal */
uint8_t iManufacturer; /*!< Index of string descriptor describing manufacturer */
uint8_t iProduct; /*!< Index of string descriptor describing product */
uint8_t iSerialNumber; /*!< Index of string descriptor describing the device’s serial number */
uint8_t bNumConfigurations; /*!< Number of possible configurations */
} LDD_USB_TDevDescriptor;
/*! Device transfer descriptor structure forward declaration */
struct LDD_USB_Device_TTD_Struct;
/*! Device transfer done callback prototype */
typedef void (LDD_USB_Device_TTransferDoneCalback)(LDD_TDeviceData *DevDataPtr, struct LDD_USB_Device_TTD_Struct *TrParamPtr);
/*! Device transfer descriptor structure - head part */
typedef struct LDD_USB_Device_TTD_Head_Struct {
uint8_t EpNum; /*!< Endpoint number */
LDD_TData *BufferPtr; /*!< Buffer address */
uint16_t BufferSize; /*!< Buffer size */
uint8_t Flags; /*!< Transfer flags - see constants definition */
} LDD_USB_Device_TTD_Head;
/*! Device transfer descriptor structure */
typedef struct LDD_USB_Device_TTD_Struct {
/* Requierd variables */
LDD_USB_Device_TTD_Head Head; /*!< Td head data, not changed by the driver */
/* Optional items - the following items are used */
/* only if Head.Flags & LDD_USB_DEVICE_TRANSFER_FLAG_EXT_PARAM != 0 */
LDD_USB_TTransferState TransferState; /*!< Transfer state. Set by the driver */
uint16_t TransmittedDataSize; /*!< Transmitted data size. Set by the driver */
LDD_USB_Device_TTransferDoneCalback *CallbackFnPtr; /*!< Address of the callback function. Must be set by the caller */
uint8_t *ParamPtr; /*!< User parameter. Not changed by the driver */
} LDD_USB_Device_TTD;
/*! USB device states symbolic names */
typedef enum {
LDD_USB_DEVICE_DISABLED = ERR_USB_DEVICE_DISABLED, /*!< Device mode is disabled (by the user or by the clock configuration) */
LDD_USB_DEVICE_DISABLED_BY_OTG = ERR_USB_DEVICE_DISABLED_BY_OTG, /*!< Device mode is disabled by the OTG driver */
LDD_USB_DEVICE_VBUS_OFF = ERR_USB_DEVICE_VBUS_OFF, /*!< No VBUS is detected */
LDD_USB_DEVICE_VBUS_ON = ERR_USB_DEVICE_VBUS_ON, /*!< VBUS is detected */
LDD_USB_DEVICE_ENABLED = ERR_USB_DEVICE_ENABLED, /*!< Device is enabled - reset by the host */
LDD_USB_DEVICE_SUSPENDED = ERR_USB_DEVICE_SUSPENDED, /*!< Device is suspended - Bus is idle more then 3 ms */
LDD_USB_DEVICE_SUSPENDED_RESUME_READY = ERR_USB_DEVICE_SUSPENDED_RESUME_READY, /*!< Device can generate resume signaling - Bus is idle more then 5 ms. */
LDD_USB_DEVICE_RESUME_PENDING = ERR_USB_DEVICE_RESUME_PENDING /*!< Device generates resume signaling */
} LDD_USB_Device_TState;
/*! USB host mode states symbolic names */
typedef enum {
LDD_USB_HOST_DISABLED = ERR_USB_HOST_DISABLED, /*!< Host mode is disabled (by the user or by the clock configuration) */
LDD_USB_HOST_DISABLED_BY_OTG = ERR_USB_HOST_DISABLED_BY_OTG, /*!< Host mode is disabled by the OTG driver */
LDD_USB_HOST_PORT_POWERED_OFF = ERR_USB_HOST_PORT_POWERED_OFF, /*!< Port is powered-off */
LDD_USB_HOST_PORT_DISCONNECTED = ERR_USB_HOST_PORT_DISCONNECTED, /*!< No device is connected */
LDD_USB_HOST_PORT_DISABLED = ERR_USB_HOST_PORT_DISABLED, /*!< Device is connected to the port */
LDD_USB_HOST_PORT_RESETING = ERR_USB_HOST_PORT_RESETING, /*!< Port generates reset signaling */
LDD_USB_HOST_PORT_RESET_RECOVERING = ERR_USB_HOST_PORT_RESET_RECOVERING, /*!< Port waits 10 ms for reset recovery */
LDD_USB_HOST_PORT_ENABLED = ERR_USB_HOST_PORT_ENABLED, /*!< Device is connected, reset and ready to use */
LDD_USB_HOST_PORT_SUSPENDED = ERR_USB_HOST_PORT_SUSPENDED, /*!< Port is suspended */
LDD_USB_HOST_PORT_RESUME_READY = ERR_USB_HOST_PORT_RESUME_READY, /*!< Port is ready to generate resume signaling */
LDD_USB_HOST_PORT_RESUMING = ERR_USB_HOST_PORT_RESUMING, /*!< Port generates resume signaling */
LDD_USB_HOST_PORT_RESUME_RECOVERING = ERR_USB_HOST_PORT_RESUME_RECOVERING /*!< Port waits 10 ms for resume recovery */
} LDD_USB_Host_TState;
/*! USB otg mode states symbolic names */
typedef enum {
LDD_USB_OTG_DISABLED = ERR_USB_OTG_DISABLED, /*!< OTG device is in DISABLED state */
LDD_USB_OTG_ENABLED = ERR_USB_OTG_ENABLED_PENDING, /*!< OTG device is in ENABLED_PENDING state */
LDD_USB_OTG_A_IDLE = ERR_USB_OTG_A_IDLE, /*!< OTG device is in A_IDLE state */
LDD_USB_OTG_A_WAIT_VRISE = ERR_USB_OTG_A_WAIT_VRISE, /*!< OTG device is in A_WAIT_VRISE state */
LDD_USB_OTG_A_WAIT_VFALL = ERR_USB_OTG_A_WAIT_VFALL, /*!< OTG device is in A_WAIT_VFALL state */
LDD_USB_OTG_A_WAIT_BCON = ERR_USB_OTG_A_WAIT_BCON, /*!< OTG device is in A_WAIT_BCON state */
LDD_USB_OTG_A_VBUS_ERROR = ERR_USB_OTG_A_VBUS_ERROR, /*!< OTG device is in A_VBUS_ERROR state */
LDD_USB_OTG_A_SUSPEND = ERR_USB_OTG_A_SUSPEND, /*!< OTG device is in A_SUSPEND state */
LDD_USB_OTG_B_IDLE = ERR_USB_OTG_B_IDLE, /*!< OTG device is in B_IDLE state */
LDD_USB_OTG_B_SRP_INIT = ERR_USB_OTG_B_SRP_INIT, /*!< OTG device is in B_SRP_INIT state */
LDD_USB_OTG_B_WAIT_ACON = ERR_USB_OTG_B_WAIT_ACON, /*!< OTG device is in B_WAIT_ACON state */
LDD_USB_OTG_A_HOST = ERR_USB_OTG_A_HOST, /*!< OTG device is in A_HOST state */
LDD_USB_OTG_A_PERIPHERAL = ERR_USB_OTG_A_PERIPHERAL, /*!< OTG device is in A_PERIPHERAL state */
LDD_USB_OTG_B_HOST = ERR_USB_OTG_B_HOST, /*!< OTG device is in B_HOST state */
LDD_USB_OTG_B_PERIPHERAL = ERR_USB_OTG_B_PERIPHERAL /*!< OTG device is in B_PERIPHERAL state */
} LDD_USB_Otg_TState;
/*! USB Otg commands symbolic names */
typedef enum {
LDD_USB_OTG_CMD_SET_A_BUS_REQUEST, /*!< A-device application wants to use the bus */
LDD_USB_OTG_CMD_CLR_A_BUS_REQUEST, /*!< A-device application doesn't want to use the bus */
LDD_USB_OTG_CMD_SET_B_BUS_REQUEST, /*!< B-device application wants to use the bus */
LDD_USB_OTG_CMD_CLR_B_BUS_REQUEST, /*!< B-device application doesn't want to use the bus */
LDD_USB_OTG_CMD_SET_A_BUS_DROP, /*!< A-device application needs to power down the bus */
LDD_USB_OTG_CMD_CLR_A_BUS_DROP, /*!< A-device application doesn't need to power down the bus */
LDD_USB_OTG_CMD_SET_A_SUSPEND_REQUEST, /*!< A-device application wants to suspend the bus */
LDD_USB_OTG_CMD_CLR_A_SUSPEND_REQUEST, /*!< A-device application doesn't want to suspend the bus */
LDD_USB_OTG_CMD_SET_A_SET_B_HNP_EN_REQUEST, /*!< A-device sets HNP enabled feature on B-device */
LDD_USB_OTG_CMD_CLR_A_SET_B_HNP_EN_REQUEST, /*!< A-device clears HNP enabled feature on B-device */
LDD_USB_OTG_CMD_SET_B_HNP_EN_REQUEST, /*!< Enable B-device HNP */
LDD_USB_OTG_CMD_CLR_B_HNP_EN_REQUEST /*!< Disable B-device HNP */
} LDD_USB_Otg_TCmd;
/*! USB host port control commands symbolic names */
typedef enum {
LDD_USB_HOST_PORT_CMD_POWER_ON, /*!< Power-on the bus */
LDD_USB_HOST_PORT_CMD_POWER_OFF, /*!< Power-off the bus */
LDD_USB_HOST_PORT_CMD_RESET, /*!< Perform the bus reset signaling and call event after the reset recovery interval elapse */
LDD_USB_HOST_PORT_CMD_RESUME, /*!< Perform the bus resume signaling and call event after the resume recovery interval elapse */
LDD_USB_HOST_PORT_CMD_SUSPEND, /*!< Suspend the bus and transceiver */
LDD_USB_HOST_PORT_CMD_DISABLE /*!< Disable the port */
} LDD_USB_Host_TPortControlCmd;
/*! USB host handle prototypes */
typedef void LDD_USB_Host_TPipeHandle; /*!< Pipe handle prototype */
typedef void LDD_USB_Host_TTransferHandle; /*!< Transfer handle prototype */
/*! USB host pipe descriptor structure */
typedef struct LDD_USB_Host_TPipeDescr_Struct {
uint8_t DevAddress; /*!< Device address */
LDD_USB_TBusSpeed DevSpeed; /*!< Device speed */
uint8_t EpNumber; /*!< EP number */
uint8_t EpDir; /*!< EP direction */
LDD_USB_TTransferType TransferType; /*!< EP Transfer type */
uint16_t MaxPacketSize; /*!< EP max. packet size */
uint8_t TrPerUFrame; /*!< Transaction pre microframe */
uint32_t Interval; /*!< Interval for polling endpoint for data transfers */
uint32_t NAKCount; /*!< NAK count */
uint8_t Flags; /*!< 1 = ZLT */
} LDD_USB_Host_TPipeDescr;
/*! USB host transfer done callback prototype */
typedef void (LDD_USB_Host_TTransferDoneCalback)(
LDD_TDeviceData *DevDataPtr, /*!< User value passed as parameter of the Init() method */
LDD_TData *BufferPtr, /*!< Buffer address */
uint16_t BufferSize, /*!< Transferred data size */
uint8_t *ParamPtr, /*!< User value passed in Send()/Recv() method */
LDD_USB_TTransferState Status /*!< Transfer status */
);
/*! USB host transfer descriptor structure */
typedef struct LDD_USB_Host_TTD_Struct {
LDD_TData *BufferPtr; /*!< Buffer address */
uint16_t BufferSize; /*!< Buffer size */
uint8_t Flags; /*!< Transfer flags */
LDD_USB_Host_TTransferDoneCalback *CallbackFnPtr; /*!< Address of the callback function. Must be set by the caller */
uint8_t *ParamPtr; /*!< User parameter. Not changed by the driver */
LDD_USB_TSDP *SDPPrt; /*!< Setup data buffer pointer */
} LDD_USB_Host_TTD;
/*! Following USB constants and types are for test purpose only */
/* Request types */
#define LDD_USB_REQ_TYPE_STANDARD 0x00u /*!< Standard request */
#define LDD_USB_REQ_TYPE_CLASS 0x20u /*!< Class request */
#define LDD_USB_REQ_TYPE_VENDOR 0x40u /*!< Vendor request */
#define LDD_USB_REQ_TYPE_MASK 0x60u /*!< Bit mask for request type (bmRequestType) */
/* Request recepient */
#define LDD_USB_REQ_RECP_DEVICE 0x00u /*!< Recipient = Device */
#define LDD_USB_REQ_RECP_INTERFACE 0x01u /*!< Recipient = Interface */
#define LDD_USB_REQ_RECP_ENDPOINT 0x02u /*!< Recipient = Endpoint */
#define LDD_USB_REQ_RECP_OTHER 0x03u /*!< Recipient = Other */
#define LDD_USB_REQ_RECP_MASK 0x03u /*!< Bit mask for recipient */
/* Standard request codes (bRequest) */
#define LDD_USB_REQ_GET_STATUS 0x00u /*!< GET_STATUS request code */
#define LDD_USB_REQ_CLEAR_FEATURE 0x01u /*!< CLEAR_FEATURE request code */
#define LDD_USB_REQ_SET_FEATURE 0x03u /*!< SET_FEATURE request code */
#define LDD_USB_REQ_GET_STATE 0x04u /*!< GET_STATE request code (for Hub Class only)*/
#define LDD_USB_REQ_SET_ADDRESS 0x05u /*!< SET_ADDRESS request code */
#define LDD_USB_REQ_GET_DESCRIPTOR 0x06u /*!< GET_DESCRIPTOR request code */
#define LDD_USB_REQ_SET_DESCRIPTOR 0x07u /*!< SET_DESCRIPTOR request code, this request is not supported */
#define LDD_USB_REQ_GET_CONFIGURATION 0x08u /*!< GET_CONFIGURATION request code */
#define LDD_USB_REQ_SET_CONFIGURATION 0x09u /*!< SET_CONFIGURATION request code */
#define LDD_USB_REQ_GET_INTERFACE 0x0Au /*!< GET_INTERFACE request code */
#define LDD_USB_REQ_SET_INTERFACE 0x0Bu /*!< SET_INTERFACE request code */
#define LDD_USB_REQ_SYNCH_FRAME 0x0Cu /*!< SYNCH_FRAME request code */
/* Standard request words for device (bmRequestType | bRequest) */
#define LDD_USB_STD_REQ_GET_DEV_STATUS 0x0080u /*!< GET_DEVICE_STATUS bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_CLR_DEV_FEATURE 0x0100u /*!< CLEAR_DEVICE_FEATURE bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_DEV_FEATURE 0x0300u /*!< SET_DEVICE_FEATURE bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_ADDRESS 0x0500u /*!< SET_DEVICE_ADDRESS bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_GET_DESCRIPTOR 0x0680u /*!< GET_DESCRIPTOR bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_DESCRIPTOR 0x0700u /*!< SET_DESCRIPTOR bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_GET_CONFIGURATION 0x0880u /*!< GET_DEVICE_CONFIGURATION bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_CONFIGURATION 0x0900u /*!< SET_DEVICE_CONFIGURATION bmRequestType and bRequest word */
/* Standard request words for interface (bmRequestType | bRequest) */
#define LDD_USB_STD_REQ_GET_INT_STATUS 0x0081u /*!< GET_INTERFACE_STATUS bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_CLR_INT_FEATURE 0x0101u /*!< CLEAR_INTERFACE_FEATURE bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_INT_FEATURE 0x0301u /*!< SET_INTERFACE_FEATURE bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_GET_INTERFACE 0x0A81u /*!< GET_DEVICE_INTERFACE bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_INTERFACE 0x0B01u /*!< SET_DEVICE_INTERFACE bmRequestType and bRequest word */
/* Standard request words for endpoint (bmRequestType | bRequest) */
#define LDD_USB_STD_REQ_GET_EP_STATUS 0x0082u /*!< GET_ENDPOINT_STATUS bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_CLR_EP_FEATURE 0x0102u /*!< CLEAR_ENDPOINT_FEATURE bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SET_EP_FEATURE 0x0302u /*!< ENDPOINT_ bmRequestType and bRequest word */
#define LDD_USB_STD_REQ_SYNCH_FRAME 0x0C12u /*!< SYNCH_DEVICE_FRAME bmRequestType and bRequest code */
#define LDD_USB_STATUS_DEVICE_SELF_POWERED_MASK 0x01u
#define LDD_USB_STATUS_DEVICE_REMOTE_WAKEUP_MASK 0x02u
/* Standard descriptors */
#define LDD_USB_DT_DEVICE 0x01u /*!< Device descriptor */
#define LDD_USB_DT_CONFIGURATION 0x02u /*!< Configuration descriptor */
#define LDD_USB_DT_STRING 0x03u /*!< String descriptor */
#define LDD_USB_DT_INTERFACE 0x04u /*!< Interface descriptor */
#define LDD_USB_DT_ENDPOINT 0x05u /*!< Endpoint descriptor */
#define LDD_USB_DT_DEVICE_QUALIFIER 0x06u /*!< Device qualifier descriptor */
#define LDD_USB_DT_OTHER_SPEED_CONFIGURATION 0x07u /*!< Other speed configuration descriptor */
#define LDD_USB_DT_INTERFACE_POWER 0x08u /*!< Interface-level power management descriptor */
#define LDD_USB_DT_OTG 0x09u /*!< OTG descriptor */
#define LDD_USB_DT_DEBUG 0x0Au /*!< Debug descriptor */
#define LDD_USB_DT_INTERFACE_ASSOCIATION 0x0Bu /*!< Interface association descriptor */
/* Standard feature selectors */
#define LDD_USB_FEATURE_EP_HALT 0x00u /*!< Endpoint HALT feature selector */
#define LDD_USB_FEATURE_DEV_REMOTE_WAKEUP 0x01u /*!< Remote Wake-up feature selector */
#define LDD_USB_FEATURE_DEV_TEST_MODE 0x02u /*!< Test mode feature selector */
/*! Get decriptor request structure */
typedef struct LDD_USB_TGetDecriptorRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint8_t bDescriptorIndex; /*!< Descriptor index */
uint8_t bDescriptorType; /*!< Descriptor type */
uint16_t wLanguageID; /*!< Language ID */
uint16_t wLength; /*!< Requested data size */
} LDD_USB_TGetDecriptorRequest;
/*! Get endpoint status request structure */
typedef struct LDD_USB_TEndpointStatusRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint16_t wValue; /*!< Not used, should be set to zero */
uint8_t bEndpoint; /*!< Endpoint address */
uint8_t bIndexHigh; /*!< Not used, should be set to zero */
uint16_t wLength; /*!< Reqested data size, should be set to 2 */
} LDD_USB_TEndpointStatusRequest;
/*! Clear/Set endpoint feature request structure */
typedef struct LDD_USB_TEndpointFeatureRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint16_t wFeatureSelector; /*!< Feature selector */
uint8_t bEndpoint; /*!< Endpoint address */
uint8_t bIndexHigh; /*!< Not used, should be set to zero */
uint16_t wLength; /*!< Not used, should be set to zero */
} LDD_USB_TEndpointFeatureRequest;
/*! Clear/Set interface request structure */
typedef struct LDD_USB_TInterfaceFeatureRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint16_t wFeatureSelector; /*!< Feature selector */
uint16_t wInterface; /*!< Interface index */
uint16_t wLength; /*!< Not used, should be set to zero */
} LDD_USB_TInterfaceFeatureRequest;
/*! Clear/Set device request structure */
typedef struct LDD_USB_TDeviceFeatureRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint16_t wFeatureSelector; /*!< Feature selector */
uint16_t wIndex; /*!< Not used, should be set to zero */
uint16_t wLength; /*!< Not used, should be set to zero */
} LDD_USB_TDeviceFeatureRequest;
/*! Get interface request structure */
typedef struct LDD_USB_TGetInterfaceRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint16_t wWalue; /*!< Not used, should be zero */
uint16_t wInterface; /*!< Interface index */
uint16_t wLength; /*!< Reqested data size, should be set to 1 */
} LDD_USB_TGetInterfaceRequest;
/*! Set interface request structure */
typedef struct LDD_USB_TSetInterfaceRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint16_t wAltSet; /*!< Alternate setting */
uint16_t wInterface; /*!< Interface index */
uint16_t wLength; /*!< Not used, should be set to zero */
} LDD_USB_TSetInterfaceRequest;
/*! Set address request structure */
typedef struct LDD_USB_TSetAddressRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint8_t DeviceAddress; /*!< Device address */
uint8_t bValueHigh; /*!< Not used, should be set to zero */
uint16_t wIndex; /*!< Not used, should be set to zero */
uint16_t wLength; /*!< Not used, should be set to zero */
} LDD_USB_TSetAddressRequest;
/*! Set address request structure */
typedef struct LDD_USB_TSetConfigRequest_Struct {
uint8_t bmRequestType; /*!< Characteristics of request */
uint8_t bRequest; /*!< Request ID */
uint8_t bValueHigh; /*!< Not used, should be set to zero */
uint8_t ConfigNumber; /*!< Configuration number */
uint16_t wIndex; /*!< Not used, should be set to zero */
uint16_t wLength; /*!< Not used, should be set to zero */
} LDD_USB_TSetConfigRequest;
/*
** ===================================================================
** DAC device types and constants
** ===================================================================
*/
#define LDD_DAC_OUTPUT_PIN_0 0x01u /*!< DAC output pin 0 mask */
#define LDD_DAC_ON_BUFFER_END 0x01U /*!< OnBufferEnd event mask */
#define LDD_DAC_ON_BUFFER_START 0x02U /*!< OnBufferStart event mask */
#define LDD_DAC_ON_BUFFER_WATERMARK 0x04U /*!< OnBufferWatermark event mask */
#define LDD_DAC_ON_COMPLETE LDD_DMA_ON_COMPLETE /*!< OnComplete event mask */
#define LDD_DAC_ON_ERROR LDD_DMA_ON_ERROR /*!< OnError event mask */
/*! Type specifying the DAC buffer work mode */
typedef enum {
LDD_DAC_BUFFER_NORMAL_MODE = 0x00U, /*!< Normal (cyclic) mode */
LDD_DAC_BUFFER_SWING_MODE = 0x01U, /*!< Swing mode */
LDD_DAC_BUFFER_SCAN_MODE = 0x02U /*!< One-time scan mode */
} LDD_DAC_TBufferMode;
/*! Type specifying the DAC buffer watermark levels */
typedef enum {
LDD_DAC_BUFFER_WATERMARK_L1 = 0x00U,
LDD_DAC_BUFFER_WATERMARK_L2 = 0x01U,
LDD_DAC_BUFFER_WATERMARK_L3 = 0x02U,
LDD_DAC_BUFFER_WATERMARK_L4 = 0x03U
} LDD_DAC_TBufferWatermark;
#define LDD_DAC_DMA_ERROR 0x01u /*!< DMA error mask */
typedef void* LDD_DAC_TDataPtr; /*!< Type specifying the pointer to the DAC data variable */
typedef uint32_t LDD_DAC_TData; /*!< The DAC data variable type */
typedef uint32_t LDD_DAC_TErrorMask; /*!< Error mask */
typedef uint32_t LDD_DAC_TArrayLength; /*!< Array length type */
/*
** ===================================================================
** FLASH device types and constants
** ===================================================================
*/
#define LDD_FLASH_ON_OPERATION_COMPLETE 0x02u /*!< OnOperationComplete event mask */
#define LDD_FLASH_ON_ERROR 0x04u /*!< OnError event mask */
#define LDD_FLASH_READ_COLLISION_ERROR 0x40u /*!< Read collision error flag's mask */
#define LDD_FLASH_ACCESS_ERROR 0x20u /*!< Access error flag's mask */
#define LDD_FLASH_PROTECTION_VIOLATION 0x10u /*!< Protection violation error flag's mask */
#define LDD_FLASH_ERASE_VERIFICATION_ERROR 0x08u /*!< Erase verification error flag's mask */
#define LDD_FLASH_MULTIPLE_WRITE_ERROR 0x04u /*!< Multiple write to one flash memory location error flag's mask */
/*! Type specifying HW commands for a flash device */
typedef enum {
LDD_FLASH_READ_1S_BLOCK = 0x00u, /*!< Checks if an entire program flash or data flash logical block has been erased to the specified margin level */
LDD_FLASH_READ_1S_SECTION = 0x01u, /*!< Checks if a section of program flash or data flash memory is erased to the specified read margin level */
LDD_FLASH_WRITE_BYTE = 0x04u, /*!< Program byte */
LDD_FLASH_WRITE_WORD = 0x05u, /*!< Program word */
LDD_FLASH_WRITE_LONG_WORD = 0x06u, /*!< Program long word */
LDD_FLASH_WRITE_PHRASE = 0x07u, /*!< Program phrase */
LDD_FLASH_ERASE_FLASH_BLOCK = 0x08u, /*!< Erase flash memory block */
LDD_FLASH_ERASE_SECTOR = 0x09u, /*!< Erase sector */
LDD_FLASH_ERASE_ALL_FLASH_BLOCKS = 0x44u /*!< Erase all flash memory blocks */
} LDD_FLASH_TCommand;
/*! Type specifying possible FLASH component operation types */
typedef enum {
LDD_FLASH_NO_OPERATION, /*!< No operation - initial state */
LDD_FLASH_READ, /*!< Read operation */
LDD_FLASH_WRITE, /*!< Write operation */
LDD_FLASH_ERASE, /*!< Erase operation */
LDD_FLASH_ERASE_BLOCK, /*!< Erase block operation */
LDD_FLASH_VERIFY_ERASED_BLOCK /*!< Verify erased block operation */
} LDD_FLASH_TOperationType;
/*! Type specifying possible FLASH component operation states */
typedef enum {
LDD_FLASH_FAILED = 0x00u, /*!< Operation has failed */
LDD_FLASH_STOP = 0x01u, /*!< The operation has been stopped */
LDD_FLASH_IDLE = 0x02u, /*!< No operation in progress */
LDD_FLASH_STOP_REQ = 0x03u, /*!< The operation is in the STOP request mode */
LDD_FLASH_START = 0x04u, /*!< Start of the operation, no operation steps have been done yet */
LDD_FLASH_RUNNING = 0x05u /*!< Operation is in progress */
} LDD_FLASH_TOperationStatus;
typedef uint8_t LDD_FLASH_TErrorFlags; /*!< Type specifying FLASH component's error flags bit field */
typedef uint32_t LDD_FLASH_TAddress; /*!< Type specifying the Address parameter used by the FLASH component's methods */
typedef uint32_t LDD_FLASH_TDataSize; /*!< Type specifying the Size parameter used by the FLASH component's methods */
typedef uint16_t LDD_FLASH_TErasableUnitSize; /*!< Type specifying the Size output parameter of the GetErasableUnitSize method (pointer to a variable of this type is passed to the method) */
/*! Type specifying the FLASH component's rrror status information */
typedef struct {
LDD_FLASH_TOperationType CurrentOperation; /*!< Current operation */
LDD_FLASH_TCommand CurrentCommand; /*!< Last flash controller command */
LDD_FLASH_TErrorFlags CurrentErrorFlags; /*!< Bitfield with error flags. See FLASH2.h for details */
LDD_FLASH_TAddress CurrentAddress; /*!< Address of the flash memory location the error status is related to */
LDD_TData *CurrentDataPtr; /*!< Pointer to current input data the error status is related to */
LDD_FLASH_TDataSize CurrentDataSize; /*!< Size of the current input data to be programmed or erased in bytes */
} LDD_FLASH_TErrorStatus;
/*
** ===================================================================
** HSCMP device types and constants
** ===================================================================
*/
#define LDD_ANALOGCOMP_ON_COMPARE 0x01u /*!< OnCompare event mask */
/* Positive input pin masks */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_0_MASK 0x01U /*!< Mask for positive input pin 0 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_1_MASK 0x02U /*!< Mask for positive input pin 1 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_2_MASK 0x04U /*!< Mask for positive input pin 2 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_3_MASK 0x08U /*!< Mask for positive input pin 3 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_4_MASK 0x10U /*!< Mask for positive input pin 4 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_5_MASK 0x20U /*!< Mask for positive input pin 5 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_6_MASK 0x40U /*!< Mask for positive input pin 6 */
#define LDD_ANALOGCOMP_POSITIVE_INPUT_7_MASK 0x80U /*!< Mask for positive input pin 7 */
/* Negative input pin masks */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_0_MASK 0x0100U /*!< Mask for negative input pin 0 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_1_MASK 0x0200U /*!< Mask for negative input pin 1 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_2_MASK 0x0400U /*!< Mask for negative input pin 2 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_3_MASK 0x0800U /*!< Mask for negative input pin 3 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_4_MASK 0x1000U /*!< Mask for negative input pin 4 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_5_MASK 0x2000U /*!< Mask for negative input pin 5 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_6_MASK 0x4000U /*!< Mask for negative input pin 6 */
#define LDD_ANALOGCOMP_NEGATIVE_INPUT_7_MASK 0x8000U /*!< Mask for negative input pin 7 */
/* Output pin masks */
#define LDD_ANALOGCOMP_OUTPUT_PIN_MASK 0x00010000U /*!< Mask for output pin */
/* Window Sample pin masks */
#define LDD_ANALOGCOMP_WINDOWSAMPLE_PIN_MASK 0x00020000UL
/*! Type specifying comparator input number */
typedef enum {
LDD_ANALOGCOMP_INPUT_0 = 0x00U, /*!< Analog input 0 selected */
LDD_ANALOGCOMP_INPUT_1 = 0x01U, /*!< Analog input 1 selected */
LDD_ANALOGCOMP_INPUT_2 = 0x02U, /*!< Analog input 2 selected */
LDD_ANALOGCOMP_INPUT_3 = 0x03U, /*!< Analog input 3 selected */
LDD_ANALOGCOMP_INPUT_4 = 0x04U, /*!< Analog input 4 selected */
LDD_ANALOGCOMP_INPUT_5 = 0x05U, /*!< Analog input 5 selected */
LDD_ANALOGCOMP_INPUT_6 = 0x06U, /*!< Analog input 6 selected */
LDD_ANALOGCOMP_INPUT_7 = 0x07U, /*!< Analog input 7 selected */
LDD_ANALOGCOMP_INPUT_DISABLED = 0x08U /*!< Analog input disabled */
} LDD_AnalogComp_TComparatorInput;
/*! Type specifying current comparator output status */
typedef enum {
LDD_ANALOGCOMP_NO_EDGE = 0x00U, /*!< No edge detected on output */
LDD_ANALOGCOMP_FALLING_EDGE = 0x02U, /*!< Falling edge detected on output */
LDD_ANALOGCOMP_RISING_EDGE = 0x04U, /*!< Rising edge detected on output */
LDD_ANALOGCOMP_BOTH_EDGES = 0x06U /*!< Both edges detected on output */
} LDD_AnalogComp_TCompareStatus;
/*! Type specifying requested comparator mode */
typedef enum {
LDD_ANALOGCOMP_RISING_EDGE_MODE = 0x01U, /*!< Rising edge detection */
LDD_ANALOGCOMP_FALLING_EDGE_MODE = 0x00U, /*!< Falling edge detection */
LDD_ANALOGCOMP_BOTH_EDGES_MODE = 0x03U /*!< Both edges detection */
} LDD_AnalogComp_TComparatorMode;
typedef uint8_t LDD_AnalogComp_TOutputValue; /*!< Type specifying comparator output value */
/*
** ===================================================================
** SDHC component types and constants
** ===================================================================
*/
#define LDD_SDHC_CARD_DATA_WIDTH_1_BIT 0x01u /*!< Card supports 1 bit data bus */
#define LDD_SDHC_CARD_DATA_WIDTH_4_BIT 0x02u /*!< Card supports 4 bit data bus */
#define LDD_SDHC_CARD_DATA_WIDTH_8_BIT 0x04u /*!< Card supports 8 bit data bus */
#define LDD_SDHC_CARD_BLOCK_READ 0x01u /*!< Card supports block reading */
#define LDD_SDHC_CARD_BLOCK_WRITE 0x04u /*!< Card supports block writing */
#define LDD_SDHC_CARD_ERASE 0x08u /*!< Card supports block erasion */
#define LDD_SDHC_CARD_WRITE_PROTECTION 0x10u /*!< Card supports write protection */
#define LDD_SDHC_CARD_IO 0x80u /*!< Card supports IO */
#define LDD_SDHC_CLK_PIN 0x01u /*!< SD clock pin mask */
#define LDD_SDHC_CMD_PIN 0x02u /*!< SD command line pin mask */
#define LDD_SDHC_DAT0_PIN 0x04u /*!< SD data line 0 pin mask */
#define LDD_SDHC_DAT1_PIN 0x08u /*!< SD data line 1 pin mask */
#define LDD_SDHC_DAT2_PIN 0x10u /*!< SD data line 2 pin mask */
#define LDD_SDHC_DAT3_PIN 0x20u /*!< SD data line 3 pin mask */
#define LDD_SDHC_DAT4_PIN 0x40u /*!< SD data line 4 pin mask */
#define LDD_SDHC_DAT5_PIN 0x80u /*!< SD data line 5 pin mask */
#define LDD_SDHC_DAT6_PIN 0x0100u /*!< SD data line 6 pin mask */
#define LDD_SDHC_DAT7_PIN 0x0200u /*!< SD data line 7 pin mask */
#define LDD_SDHC_CD_PIN 0x0400u /*!< SD card detection pin mask */
#define LDD_SDHC_WP_PIN 0x0800u /*!< SD write protection pin mask */
#define LDD_SDHC_LCTL_PIN 0x1000u /*!< SD LED control pin mask */
#define LDD_SDHC_VS_PIN 0x2000u /*!< SD voltage control pin mask */
#define LDD_SDHC_ON_CARD_INSERTED 0x01u /*!< OnCardInserted event mask */
#define LDD_SDHC_ON_CARD_REMOVED 0x02u /*!< OnCardRemoved event mask */
#define LDD_SDHC_ON_FINISHED 0x04u /*!< OnFinished event mask */
/*! Card types */
typedef enum {
LDD_SDHC_SD, /*!< Secure Digital memory card */
LDD_SDHC_SDIO, /*!< Secure Digital IO card */
LDD_SDHC_SDCOMBO, /*!< Combined Secure Digital memory and IO card */
LDD_SDHC_MMC, /*!< MultiMediaCard memory card */
LDD_SDHC_CE_ATA /*!< Consumer Electronics ATA card */
} LDD_SDHC_TCardType;
/*! Card access properties */
typedef struct {
uint16_t MaxBlockLength; /*!< Max. transferable block length */
bool MisalignBlock; /*!< Indicates if the data block can be spread over more than one physical block of the memory device */
bool PartialBlock; /*!< Indicates whether partial block sizes can be used in block access */
} LDD_SDHC_TCardAccess;
/*! Card erasion properties */
typedef struct {
uint16_t SectorSize; /*!< The size of an erasable unit */
uint8_t Pattern; /*!< Memory content after erase */
} LDD_SDHC_TCardErase;
/*! Card write protection properties */
typedef struct {
uint16_t GroupSize; /*!< The size of write protected group in number of erase groups */
bool Permanent; /*!< Indicates whether card is permanently write protected (read-only) */
} LDD_SDHC_TCardWriteProtect;
/*! Card capabilities */
typedef struct {
uint8_t DataWidths; /*!< Bit mask of supported data bus widths */
uint8_t Operations; /*!< Bit mask of supported operations */
bool HighSpeed; /*!< Indicates whether the card supports high clock configuration (SD bus clock frequency higher than about 25MHz) */
bool HighCapacity; /*!< Indicates whether the card requires block addressing instead of byte addressing */
bool LowVoltage; /*!< Indicates whether the card supports the host's low voltage range */
LDD_SDHC_TCardAccess Read; /*!< Card data read access capabilities */
LDD_SDHC_TCardAccess Write; /*!< Card data write access capabilities */
LDD_SDHC_TCardErase Erase; /*!< Card data erasion capabilities */
LDD_SDHC_TCardWriteProtect WriteProtect; /*!< Write protection properties */
} LDD_SDHC_TCardCaps;
/*! Card features description */
typedef struct {
LDD_SDHC_TCardType Type; /*!< Card type */
uint16_t BlockLength; /*!< Physical memory block length */
uint32_t BlockCount; /*!< Number of physical memory blocks */
LDD_SDHC_TCardCaps Caps; /*!< Card capabilities */
} LDD_SDHC_TCardInfo;
/*! Transfer operations */
typedef enum {
LDD_SDHC_READ, /*!< Read operation */
LDD_SDHC_WRITE /*!< Write operation */
} LDD_SDHC_TTransferOperation;
/*! Transfer buffer descriptor */
typedef struct {
uint16_t Size; /*!< Buffer data size */
uint8_t *DataPtr; /*!< Pointer to buffer data */
} LDD_SDHC_TBufferDesc;
/*! Voltage options */
typedef enum {
LDD_SDHC_LOW_VOLTAGE, /*!< Low voltage */
LDD_SDHC_HIGH_VOLTAGE /*!< High voltage */
} LDD_SDHC_TVoltage;
/*! Write protection types */
typedef enum {
LDD_SDHC_GROUP, /*!< Write protection by groups */
LDD_SDHC_CARD /*!< Whole card write protection */
} LDD_SDHC_TWriteProtectType;
/*! Component states */
typedef enum {
LDD_SDHC_DISABLED, /*!< Disabled */
LDD_SDHC_RESET, /*!< Resetting card */
LDD_SDHC_IDLE, /*!< Idling */
LDD_SDHC_VOLTAGE_VALIDATION, /*!< Validating voltage */
LDD_SDHC_CARD_REGISTRATION, /*!< Registrating card */
LDD_SDHC_CARD_SELECTION, /*!< Selecting card */
LDD_SDHC_CARD_INFO_RETRIEVAL, /*!< Retrieving card info */
LDD_SDHC_TRANSFER, /*!< Transferring data */
LDD_SDHC_ERASION, /*!< Erasing blocks */
LDD_SDHC_IO_REG_TRANSFER, /*!< Transferring IO registers */
LDD_SDHC_DATA_WIDTH_SELECTION, /*!< Selecting data width */
LDD_SDHC_BUS_CLOCK_SELECTION, /*!< Selecting bus clock */
LDD_SDHC_WRITE_PROTECTION_SETUP, /*!< Setting up write protection */
LDD_SDHC_WRITE_PROTECTION_RETRIEVAL /*!< Retrieving write protection configuration */
} LDD_SDHC_TStatus;
/*! Operation completion error codes */
typedef enum {
LDD_SDHC_ERR_OK, /*!< No error */
LDD_SDHC_ERR_DMA, /*!< DMA or block size error */
LDD_SDHC_ERR_NOT_SUPPORTED, /*!< Initiated operation is not supported by the card (supported operations are contained in the card information structure) */
LDD_SDHC_ERR_TIMEOUT, /*!< Command or data timeout */
LDD_SDHC_ERR_COMMAND_CRC, /*!< Command CRC check failed */
LDD_SDHC_ERR_DATA_CRC, /*!< Data CRC check failed */
LDD_SDHC_ERR_ADDRESS_OUT_OF_RANGE, /*!< The card address is beyond the card capacity */
LDD_SDHC_ERR_ADDRESS_MISALIGN, /*!< The card address does not align with physical blocks of the card */
LDD_SDHC_ERR_BLOCK_LEN_ERROR, /*!< Block length exceeds the maximum value for the card */
LDD_SDHC_ERR_WP_VIOLATION, /*!< Attempt to program a write protected block */
LDD_SDHC_ERR_CARD_IS_LOCKED, /*!< The card is locked by the host */
LDD_SDHC_ERR_WP_ERASE_SKIP, /*!< Only partial address space was erased due to existing write protected blocks */
LDD_SDHC_ERR_INTERNAL_FAILURE, /*!< Internal component error */
LDD_SDHC_ERR_CARD_FAILURE /*!< The card was unable to complete the operation */
} LDD_SDHC_TError;
/*
** ===================================================================
** DMA device types and constants
** ===================================================================
*/
#define LDD_DMA_ON_COMPLETE 0x01U /*!< OnTransferComplete event mask. */
#define LDD_DMA_ON_ERROR 0x02U /*!< OnError event mask. */
#define LDD_DMA_CONFIGURATION_ERROR 0x40000000U /*!< Configuration error. */
#define LDD_DMA_SOURCE_BUS_ERROR 0x20000000U /*!< Bus error on a source read. */
#define LDD_DMA_DESTINATION_BUS_ERROR 0x10000000U /*!< Bus error on a destination write. */
/* eDMA device error constants for backward compatibility */
#define LDD_DMA_CHANNEL_PRIORITY_ERROR 0x4000U /*!< Channel priority error. */
#define LDD_DMA_SOURCE_ADDRESS_ERROR 0x80U /*!< Address inconsistency with transfer size error. */
#define LDD_DMA_SOURCE_OFFSET_ERROR 0x40U /*!< Offset inconsistency with transfer size error. */
#define LDD_DMA_DESTINATION_ADDRESS_ERROR 0x20U /*!< Address inconsistency with transfer size error. */
#define LDD_DMA_DESTINATION_OFFSET_ERROR 0x10U /*!< Offset inconsistency with transfer size error. */
#define LDD_DMA_COUNT_ERROR 0x08U /*!< Byte count inconsistency with transfer sizes or transfer count error. */
#define LDD_DMA_SCATTER_GATHER_ERROR 0x04U /*!< Scatter/gather configuration error. */
#define LDD_DMA_CHANNEL_0_MASK 0x01U /*!< DMA channel 0 mask. */
#define LDD_DMA_CHANNEL_1_MASK 0x02U /*!< DMA channel 1 mask. */
#define LDD_DMA_CHANNEL_2_MASK 0x04U /*!< DMA channel 2 mask. */
#define LDD_DMA_CHANNEL_3_MASK 0x08U /*!< DMA channel 3 mask. */
#define LDD_DMA_CHANNEL_4_MASK 0x10U /*!< DMA channel 4 mask. */
#define LDD_DMA_CHANNEL_5_MASK 0x20U /*!< DMA channel 5 mask. */
#define LDD_DMA_CHANNEL_6_MASK 0x40U /*!< DMA channel 6 mask. */
#define LDD_DMA_CHANNEL_7_MASK 0x80U /*!< DMA channel 7 mask. */
#define LDD_DMA_CHANNEL_8_MASK 0x0100U /*!< DMA channel 8 mask. */
#define LDD_DMA_CHANNEL_9_MASK 0x0200U /*!< DMA channel 9 mask. */
#define LDD_DMA_CHANNEL_10_MASK 0x0400U /*!< DMA channel 10 mask. */
#define LDD_DMA_CHANNEL_11_MASK 0x0800U /*!< DMA channel 11 mask. */
#define LDD_DMA_CHANNEL_12_MASK 0x1000U /*!< DMA channel 12 mask. */
#define LDD_DMA_CHANNEL_13_MASK 0x2000U /*!< DMA channel 13 mask. */
#define LDD_DMA_CHANNEL_14_MASK 0x4000U /*!< DMA channel 14 mask. */
#define LDD_DMA_CHANNEL_15_MASK 0x8000U /*!< DMA channel 15 mask. */
/* Action executed after request and transfer service completes */
#define LDD_DMA_NO_ACTION 0x00U /*!< No action performed after request serviced. */
#define LDD_DMA_DESTINATION_ADDRESS_ADJUSTMENT 0x01U /*!< Destination address adjustment after request serviced. */
#define LDD_DMA_SOURCE_ADDRESS_ADJUSTMENT 0x02U /*!< Source address adjustment after request serviced. */
#define LDD_DMA_ADDRESS_ADJUSTMENT 0x01U /*!< Address adjustment after transfer completed. */
#define LDD_DMA_SCATTER_GATHER 0x02U /*!< Scatter/gather performed after transfer completed. */
typedef void LDD_DMA_TData;
typedef uint8_t LDD_DMA_TTransactionSize; /* Type specifying the transfer size parameter used by the DMA component's methods. See the DMA_PDD header file for detail description of allowed values. */
typedef uint32_t LDD_DMA_TTransactionCount;
typedef uint32_t LDD_DMA_TRequestCount;
typedef uint32_t LDD_DMA_TTransferDataSize;
typedef uint32_t LDD_DMA_TAddress; /*!< Type specifying the address parameter used by the DMA component's methods. */
typedef int32_t LDD_DMA_TAddressOffset; /*!< Type specifying the address signed offset parameter used by the DMA component's methods. */
typedef uint32_t LDD_DMA_TByteCount; /*!< Type specifying the byte count/minor loop count parameter used by the DMA component's methods. */
typedef uint8_t LDD_DMA_TTransferSize; /*!< Type specifying the transfer size parameter used by the DMA component's methods. See the DMA_PDD header file for detail description of allowed values. */
typedef uint8_t LDD_DMA_TModuloSize; /*!< Type specifying the modulo size parameter used by the DMA component's methods. */
/*!< This value power of two represents size of used circular buffer (0U - buffer disabled). See the MCU manual for detail description of allowed values. */
typedef uint8_t LDD_DMA_TTriggerSource; /*!< Type specifying the trigger source signal number. See the MCU manual for detail description of allowed values. */
typedef uint8_t LDD_DMA_TChannelNumber; /*!< Type specifying the DMA channel number. See the MCU manual for detail description of allowed values. */
typedef uint8_t LDD_DMA_TRecordNumber; /*!< Type specifying the DMA descriptor record number. */
typedef uint16_t LDD_DMA_TChannelMask; /*!< Type specifying the DMA channel mask. For possible values see channel mask constants. */
typedef uint8_t LDD_DMA_TChannelPriority; /*!< Type specifying the DMA channel priority number. See the MCU manual for detail description of allowed values. */
typedef uint8_t LDD_DMA_TOuterLoopCount; /*!< Type specifying the transfer outer/major loop count. */
typedef uint8_t LDD_DMA_TAfterRequest; /*!< Type specifying the operation executed after request service is completed. */
typedef uint8_t LDD_DMA_TAfterTransfer; /*!< Type specifying the operation executed after transfer service is completed. */
typedef uint8_t LDD_DMA_TBandwidthControl; /*!< Type specifying the bandwidth control. See the DMA_PDD header file for detail description of allowed values. */
typedef uint32_t LDD_DMA_TErrorFlags; /*!< DMA controller error flags. See the DMA_LDD component's header file for detail description of allowed values. */
/*! Type specifying a DMA channel status. */
typedef enum {
LDD_DMA_IDLE, /*!< Channel is idle, no request is serviced nor transfer completed. */
LDD_DMA_BUSY, /*!< Channel is active, request is serviced. */
LDD_DMA_DONE, /*!< Transfer is completed, waiting to start of next transfer. */
LDD_DMA_ERROR /*!< Error detected. */
} LDD_DMA_TChannelStatus;
/*! Type specifying a DMA transfer state. */
typedef enum {
LDD_DMA_TRANSFER_IDLE, /*!< Channel is idle, no request is serviced nor transfer completed. */
LDD_DMA_TRANSFER_BUSY, /*!< Channel is active, request is serviced. */
LDD_DMA_TRANSFER_ERROR /*!< Error detected. */
} LDD_DMA_TTransferState;
/*! Type specifying the DMA transfer mode. */
typedef enum {
LDD_DMA_CYCLE_STEAL_TRANSFERS, /*!< Only single read/write transfer is done per one service request. */
LDD_DMA_SINGLE_TRANSFER, /*!< Transfer of all bytes defined by Data size is done after single service request. */
LDD_DMA_NESTED_TRANSFERS /*!< Sequence of transfers triggered by service requests. One request transfers number of bytes defined by Byte count value. */
} LDD_DMA_TTransferMode;
/*! Type specifying the DMA trigger source type. */
typedef enum {
LDD_DMA_SW_TRIGGER, /*!< Explicit software trigger. */
LDD_DMA_HW_TRIGGER, /*!< Peripheral device trigger. */
LDD_DMA_ALWAYS_ENABLED_TRIGGER /*!< Always enabled trigger. */
} LDD_DMA_TTriggerType;
/*! Type specifying the DMA channel linking mode. */
typedef enum {
LDD_DMA_LINKING_DISABLED, /*!< No linking. */
LDD_DMA_CYCLE_STEAL_AND_TRANSFER_COMPLETE_LINKING, /*!< Channel linked after each particular read-write operation and after transfer byte count reaches zero. */
LDD_DMA_CYCLE_STEAL_LINKING, /*!< Channel linked after each particular read-write operation. */
LDD_DMA_TRANSFER_COMPLETE_LINKING /*!< Channel linked after transfer byte count reaches zero. */
} LDD_DMA_TChannelLinkingMode;
/*! Type specifying the DMA error information structure. */
typedef struct {
LDD_DMA_TChannelNumber ChannelNumber; /*!< Last error recorded channel number. */
LDD_DMA_TErrorFlags ErrorFlags; /*!< Channel error flags. */
} LDD_DMA_TError;
/*! Type specifying the DMA Transfer descriptor information structure. */
typedef struct {
LDD_TUserData *UserDataPtr; /*!< User device data structure pointer to be returned by the DMA_LDD component's ISR to the dynamic callback of this transfer descriptor. */
LDD_DMA_TAddress SourceAddress; /*!< Address of a DMA transfer source data. */
bool SourceAddressIncrement; /*!< TRUE - Source address incrementrf after each elemental read operation. */
LDD_DMA_TTransferSize SourceTransferSize; /*!< Source data transfer size (size of a elemental read operation). See the DMA_PDD header file for detail description of allowed values. */
LDD_DMA_TModuloSize SourceModuloSize; /*!< Source address modulo size. For the description of allowed values see the LDD_DMA_TModuloSize type declaration. */
LDD_DMA_TAddress DestinationAddress; /*!< Address of a DMA transfer destination. */
bool DestinationAddressIncrement; /*!< TRUE - destination address incremented after each elemental write operation. */
LDD_DMA_TTransferSize DestinationTransferSize; /*!< Destination data transfer size (size of a elemental write operation). See the DMA_PDD header file for detail description of allowed values. */
LDD_DMA_TModuloSize DestinationModuloSize; /*!< Destination address modulo size. For the description of allowed values see the LDD_DMA_TModuloSize type declaration. */
LDD_DMA_TTransferMode TransferMode; /*!< Selects DMA transfer mode. For the description of allowed values see the LDD_DMA_TTransferMode type declaration. */
LDD_DMA_TByteCount ByteCount; /*!< Size of data in bytes to be transferred in single transfer. */
bool AutoAlign; /*!< TRUE - Auto-align mode is enabled. Transfers are optimized based on the transfer address and size. */
LDD_DMA_TChannelLinkingMode ChannelLinkingMode; /*!< Selects channel linking mode. For the description of allowed values see the LDD_DMA_TChannelLinkingMode type declaration. */
LDD_DMA_TChannelNumber InnerLoopLinkedChannel; /*!< Linked DMA channel number (used only if the ChannelLinkingMode item is set with LDD_DMA_CYCLE_STEAL_AND_TRANSFER_COMPLETE_LINKING or LDD_DMA_CYCLE_STEAL_LINKING). */
LDD_DMA_TChannelNumber OuterLoopLinkedChannel; /*!< Linked DMA channel number (used only if the ChannelLinkingMode item is set with LDD_DMA_CYCLE_STEAL_AND_TRANSFER_COMPLETE_LINKING or LDD_DMA_TRANSFER_COMPLETE_LINKING). */
bool ChannelAutoSelection; /*!< TRUE - DMA channel autoselection engine is used. FALSE - DMA fixed channel is used. */
LDD_DMA_TChannelNumber ChannelNumber; /*!< If ChannelAutoSelection is FALSE this item contains fixed channel number. If ChannelAutoSelection is TRUE then after allocation this item is filled by autoselected channel number. */
LDD_DMA_TTriggerType TriggerType; /*!< DMA transfer trigger type. For the description of allowed values see the LDD_DMA_TBTriggerType declaration. */
LDD_DMA_TTriggerSource TriggerSource; /*!< Trigger source number. For the description of allowed values see the LDD_DMA_TBTriggerType declaration. */
bool PeriodicTrigger; /*!< TRUE - periodic trigger is required, FALSE - periodic trigger is not required. */
bool DisableAfterRequest; /*!< TRUE - DMA transfer request is automatically disabled after transfer complete. */
bool AsynchronousRequests; /*!< TRUE - Enables the channel to support asynchronous DREQs while the MCU is in Stop mode. */
bool Interrupts; /*!< TRUE - interrupts are requested. */
bool OnComplete; /*!< TRUE - event is enabled during initialization. */
bool OnError; /*!< TRUE - event is enabled during initialization. */
void (*OnCompleteEventPtr)(LDD_TUserData* UserDataPtr); /*!< Pointer to the OnComplete event, NULL if event is not used. */
void (*OnErrorEventPtr)(LDD_TUserData* UserDataPtr); /*!< Pointer to the OnError event, NULL if event is not used. */
bool ChannelEnabled; /*!< TRUE - DMA channel is allocated and used by DMATransfer component. */
} LDD_DMA_TTransferDescriptor;
typedef LDD_DMA_TTransferDescriptor *LDD_DMA_TTransferDescriptorPtr; /*!< Type specifying address of the DMA Transfer descriptor structure. */
/*
** ===================================================================
** SPI device types and constants - SPIMaster_LDD
** ===================================================================
*/
#define LDD_SPIMASTER_INPUT_PIN 0x01U /*!< Input pin mask */
#define LDD_SPIMASTER_OUTPUT_PIN 0x02U /*!< Output pin mask */
#define LDD_SPIMASTER_CLK_PIN 0x04U /*!< Clock pin mask */
#define LDD_SPIMASTER_CS_0_PIN 0x08U /*!< Chip select 0 pin mask */
#define LDD_SPIMASTER_CS_1_PIN 0x10U /*!< Chip select 1 pin mask */
#define LDD_SPIMASTER_CS_2_PIN 0x20U /*!< Chip select 2 pin mask */
#define LDD_SPIMASTER_CS_3_PIN 0x40U /*!< Chip select 3 pin mask */
#define LDD_SPIMASTER_CS_4_PIN 0x80U /*!< Chip select 4 pin mask */
#define LDD_SPIMASTER_CS_5_PIN 0x0100U /*!< Chip select 5 pin mask */
#define LDD_SPIMASTER_CS_6_PIN 0x0200U /*!< Chip select 6 pin mask */
#define LDD_SPIMASTER_CS_7_PIN 0x0400U /*!< Chip select 7 pin mask */
#define LDD_SPIMASTER_CSS_PIN 0x0800U /*!< Chip select strobe pin mask */
#define LDD_SPIMASTER_ON_BLOCK_RECEIVED 0x01U /*!< OnBlockReceived event mask */
#define LDD_SPIMASTER_ON_BLOCK_SENT 0x02U /*!< OnBlockSent event mask */
#define LDD_SPIMASTER_ON_ERROR 0x04U /*!< OnError event mask */
#define LDD_SPIMASTER_RX_OVERFLOW 0x01U /*!< Receiver overflow */
#define LDD_SPIMASTER_PARITY_ERROR 0x02U /*!< Parity error */
#define LDD_SPIMASTER_RX_DMA_ERROR 0x04U /*!< Receive DMA channel error */
#define LDD_SPIMASTER_TX_DMA_ERROR 0x08U /*!< Transmit DMA channel error */
typedef uint32_t LDD_SPIMASTER_TError; /*!< Communication error type */
/*! Communication statistics */
typedef struct {
uint32_t RxChars; /*!< Number of received characters */
uint32_t TxChars; /*!< Number of transmitted characters */
uint32_t RxParityErrors; /*!< Number of receiver parity errors, which have occured */
uint32_t RxOverruns; /*!< Number of receiver overruns, which have occured */
} LDD_SPIMASTER_TStats;
/*
** ===================================================================
** SPI device types and constants - SPISlave_LDD
** ===================================================================
*/
#define LDD_SPISLAVE_INPUT_PIN 0x01U /*!< Input pin mask */
#define LDD_SPISLAVE_OUTPUT_PIN 0x02U /*!< Output pin mask */
#define LDD_SPISLAVE_CLK_PIN 0x04U /*!< Clock pin mask */
#define LDD_SPISLAVE_SS_PIN 0x08U /*!< Slave select pin mask */
#define LDD_SPISLAVE_ON_BLOCK_RECEIVED 0x01U /*!< OnBlockReceived event mask */
#define LDD_SPISLAVE_ON_BLOCK_SENT 0x02U /*!< OnBlockSent event mask */
#define LDD_SPISLAVE_ON_ERROR 0x04U /*!< OnError event mask */
#define LDD_SPISLAVE_RX_OVERFLOW 0x01U /*!< Receiver overflow */
#define LDD_SPISLAVE_TX_UNDERFLOW 0x02U /*!< Transmitter underflow */
#define LDD_SPISLAVE_PARITY_ERROR 0x04U /*!< Parity error */
#define LDD_SPISLAVE_RX_DMA_ERROR 0x08U /*!< Receive DMA channel error */
#define LDD_SPISLAVE_TX_DMA_ERROR 0x10U /*!< Transmit DMA channel error */
typedef uint32_t LDD_SPISLAVE_TError; /*!< Communication error type */
/*! Communication statistics */
typedef struct {
uint32_t RxChars; /*!< Number of received characters */
uint32_t TxChars; /*!< Number of transmitted characters */
uint32_t RxParityErrors; /*!< Number of receiver parity errors, which have occured */
uint32_t RxOverruns; /*!< Number of receiver overruns, which have occured */
uint32_t TxUnderruns; /*!< Number of transmitter underruns, which have occured */
} LDD_SPISLAVE_TStats;
/*
** ===================================================================
** I2S device types and constants
** ===================================================================
*/
#define LDD_SSI_INPUT_PIN 0x01U /*!< Input pin mask */
#define LDD_SSI_OUTPUT_PIN 0x02U /*!< Output pin mask */
#define LDD_SSI_RX_CLK_PIN 0x04U /*!< Rx clock pin mask */
#define LDD_SSI_TX_CLK_PIN 0x08U /*!< Tx clock pin mask */
#define LDD_SSI_RX_FS_PIN 0x10U /*!< Rx frame sync pin mask */
#define LDD_SSI_TX_FS_PIN 0x20U /*!< Tx frame sync pin mask */
#define LDD_SSI_MCLK_PIN 0x40U /*!< Master clock pin mask */
#define LDD_SSI_INPUT_PIN_CHANNEL_0 0x80U /*!< Input pin mask for data channel 0 */
#define LDD_SSI_INPUT_PIN_CHANNEL_1 0x0100U /*!< Input pin mask for data channel 1 */
#define LDD_SSI_OUTPUT_PIN_CHANNEL_0 0x0200U /*!< Output pin mask for data channel 0 */
#define LDD_SSI_OUTPUT_PIN_CHANNEL_1 0x0400U /*!< Output pin mask for data channel 1 */
#define LDD_SSI_ON_BLOCK_RECEIVED 0x01u /*!< OnBlockReceived event mask */
#define LDD_SSI_ON_BLOCK_SENT 0x02u /*!< OnBlockSent event mask */
#define LDD_SSI_ON_ERROR 0x04u /*!< OnError event mask */
#define LDD_SSI_ON_BLOCK_RECEIVED_1 0x08u /*!< OnBlockReceived event mask for second channel */
#define LDD_SSI_ON_BLOCK_SENT_1 0x10u /*!< OnBlockSent event mask for second channel */
#define LDD_SSI_ON_RECEIVE_FRAME_SYNC 0x20u /*!< OnReceiveFrameSync event mask for second channel */
#define LDD_SSI_ON_TRANSMIT_FRAME_SYNC 0x40u /*!< OnTransmitFrameSync event mask for second channel */
#define LDD_SSI_ON_RECEIVE_LAST_SLOT 0x80u /*!< OnReceiveLastSlot event mask for second channel */
#define LDD_SSI_ON_TRANSMIT_LAST_SLOT 0x0100u /*!< OnTransmitLastSlot event mask for second channel */
#define LDD_SSI_ON_RECEIVE_COMPLETE 0x0200u /*!< OnReceiveComplete event mask for second channel */
#define LDD_SSI_ON_TRANSMIT_COMPLETE 0x0400u /*!< OnTransmitComplete event mask for second channel */
#define LDD_SSI_ON_A_C_9_7_TAG_UPDATED 0x0800u /*!< OnAC97TagUpdated event mask for second channel */
#define LDD_SSI_ON_AC_97_TAG_UPDATED 0x0800u /*!< OnAC97TagUpdated event mask for second channel */
#define LDD_SSI_ON_A_C_9_7_COMMAND_ADDRESS_UPDATED 0x1000u /*!< OnAC97CommandAddressUpdated event mask for second channel */
#define LDD_SSI_ON_AC_97_COMMAND_ADDRESS_UPDATED 0x1000u /*!< OnAC97CommandAddressUpdated event mask for second channel */
#define LDD_SSI_ON_A_C_9_7_COMMAND_DATA_UPDATED 0x2000u /*!< OnAC97CommandDataUpdated event mask for second channel */
#define LDD_SSI_ON_AC_97_COMMAND_DATA_UPDATED 0x2000u /*!< OnAC97CommandDataUpdated event mask for second channel */
#define LDD_SSI_RECEIVER (I2S_CR_RE_MASK) /*!< Receive section of the device. */
#define LDD_SSI_TRANSMITTER (I2S_CR_TE_MASK) /*!< Transmit section of the device. */
#define LDD_SSI_RX_OVERFLOW (I2S_ISR_ROE0_MASK) /*!< Receiver overflow */
#define LDD_SSI_RX_OVERFLOW_1 (I2S_ISR_ROE1_MASK) /*!< Receiver overflow 1 */
#define LDD_SSI_TX_UNDERFLOW (I2S_ISR_TUE0_MASK) /*!< Transmitter underflow */
#define LDD_SSI_TX_UNDERFLOW_1 (I2S_ISR_TUE1_MASK) /*!< Transmitter underflow 1 */
#define LDD_SSI_RX_FRAME_COMPLETE (I2S_ISR_RFRC_MASK) /*!< Receive frame is finished after disabling transfer */
#define LDD_SSI_TX_FRAME_COMPLETE (I2S_ISR_TFRC_MASK) /*!< Transmit frame is finished after disabling transfer */
#define LDD_SSI_RX_FRAME_SYNC (I2S_ISR_RFS_MASK) /*!< Receiver frame sync */
#define LDD_SSI_TX_FRAME_SYNC (I2S_ISR_TFS_MASK) /*!< Transmit frame sync */
#define LDD_SSI_RX_LAST_SLOT (I2S_ISR_RLS_MASK) /*!< Receive last time slot */
#define LDD_SSI_TX_LAST_SLOT (I2S_ISR_TLS_MASK) /*!< Transmit last time slot */
#define LDD_SSI_AC97_TAG (I2S_ISR_RXT_MASK) /*!< AC97 tag updated */
#define LDD_SSI_AC97_COMMAND_ADDRESS (I2S_ISR_CMDAU_MASK) /*!< AC97 command address updated */
#define LDD_SSI_AC97_COMMAND_DATA (I2S_ISR_CMDDU_MASK) /*!< AC97 command data updated */
typedef uint8_t LDD_SSI_TSectionMask; /*!< Device section type */
typedef uint32_t LDD_SSI_TError; /*!< Communication error type */
typedef uint32_t LDD_SSI_TComStatus; /*!< Communication status type */
/*! Group of pointers to data blocks. */
typedef struct {
LDD_TData *Channel0Ptr; /*!< Pointer to data block to send/received via data channel 0 */
LDD_TData *Channel1Ptr; /*!< Pointer to data block to send/received via data channel 1 */
} LDD_SSI_TDataBlocks;
/*! Command type */
typedef enum {
LDD_SSI_READ_COMMAND = 0x08u,
LDD_SSI_WRITE_COMMAND = 0x10u
} LDD_SSI_TAC97CommandType;
/*! AC97 command */
typedef struct {
LDD_SSI_TAC97CommandType Type; /*!< Command type */
uint32_t Address; /*!< Command address */
uint32_t Data; /*!< Command data */
} LDD_SSI_TAC97Command;
/*! Communication statistics */
typedef struct {
uint32_t RxChars; /*!< Number of received characters */
uint32_t TxChars; /*!< Number of transmitted characters */
uint32_t RxOverruns; /*!< Number of receiver overruns, which have occured */
uint32_t TxUnderruns; /*!< Number of transmitter underruns, which have occured */
uint32_t RxChars1; /*!< Number of received characters for second channel */
uint32_t TxChars1; /*!< Number of transmitted characters for second channel */
uint32_t RxOverruns1; /*!< Number of receiver overruns, which have occured for second channel */
uint32_t TxUnderruns1; /*!< Number of transmitter underruns, which have occured for second channel */
} LDD_SSI_TStats;
/*
** ===================================================================
** RTC device types and constants
** ===================================================================
*/
#define LDD_RTC_ON_SECOND 0x10u /*!< OnSecond event mask */
#define LDD_RTC_ON_MONOTONIC_OVERFLOW 0x08u /*!< OnMonotonicCounter event mask */
#define LDD_RTC_ON_ALARM 0x04u /*!< OnAlarm event mask */
#define LDD_RTC_ON_TIME_OVERFLOW 0x02u /*!< OnTimeOverflow event mask */
#define LDD_RTC_ON_TIME_INVALID 0x01u /*!< OnTimeInvalid event mask */
#define LDD_RTC_ON_STOPWATCH 0x0100u /*!< OnStopwatch event mask */
/*! Structure used for time operation */
typedef struct {
uint32_t Second; /*!< seconds (0 - 59) */
uint32_t Minute; /*!< minutes (0 - 59) */
uint32_t Hour; /*!< hours (0 - 23) */
uint32_t DayOfWeek; /*!< day of week (0-Sunday, .. 6-Saturday) */
uint32_t Day; /*!< day (1 - 31) */
uint32_t Month; /*!< month (1 - 12) */
uint32_t Year; /*!< year */
} LDD_RTC_TTime;
/*
** ===================================================================
** CRC device types and constants
** ===================================================================
*/
#define LDD_CRC_16_SEED_LOW 0x00U /*!< CRC 16bit seed low */
#define LDD_CRC_16_POLY_LOW 0x8005U /*!< CRC 16bit poly low */
#define LDD_CRC_32_SEED_LOW 0xFFFFU /*!< CRC 32bit seed low */
#define LDD_CRC_32_SEED_HIGH 0xFFFFU /*!< CRC 32bit seed high */
#define LDD_CRC_32_POLY_LOW 0x1DB7U /*!< CRC 32bit poly low */
#define LDD_CRC_32_POLY_HIGH 0x04C1U /*!< CRC 32bit poly high */
#define LDD_CRC_CCITT_SEED_LOW 0xFFFFU /*!< CRC CCITT seed low */
#define LDD_CRC_CCITT_POLY_LOW 0x1021U /*!< CRC CCITT poly low */
#define LDD_CRC_MODBUS_16_SEED_LOW 0xFFFFU /*!< CRC MODBUS16 seed low */
#define LDD_CRC_MODBUS_16_POLY_LOW 0x8005U /*!< CRC MODBUS16 poly low */
#define LDD_CRC_KERMIT_SEED_LOW 0x00U /*!< CRC KERMIT seed low */
#define LDD_CRC_KERMIT_POLY_LOW 0x1021U /*!< CRC KERMIT poly low */
#define LDD_CRC_DNP_SEED_LOW 0x00U /*!< CRC DNP seed low */
#define LDD_CRC_DNP_POLY_LOW 0x3D65U /*!< CRC DNP poly low */
/*! Transpose type */
typedef enum {
LDD_CRC_NO_TRANSPOSE = 0, /*!< No transposition */
LDD_CRC_BITS = 1, /*!< Bits are transposed */
LDD_CRC_BITS_AND_BYTES = 2, /*!< Bits and bytes are transposed */
LDD_CRC_BYTES = 3 /*!< Bytes are transposed */
} LDD_CRC_TTransposeType;
/*! CRC standard */
typedef enum {
LDD_CRC_16, /*!< CRC16 standard */
LDD_CRC_CCITT, /*!< CCITT standard */
LDD_CRC_MODBUS_16, /*!< MODBUS16 standard */
LDD_CRC_KERMIT, /*!< KERMIT standard */
LDD_CRC_DNP, /*!< DNP standard */
LDD_CRC_32, /*!< CRC32 standard */
LDD_CRC_USER /*!< User defined type */
} LDD_CRC_TCRCStandard;
/*! User CRC standard */
typedef struct {
bool Width32bit; /*!< 32bit CRC? */
bool ResultXORed; /*!< Result XORed? */
uint16_t SeedLow; /*!< Seed low value */
uint16_t SeedHigh; /*!< Seed high value */
uint16_t PolyLow; /*!< Poly low value */
uint16_t PolyHigh; /*!< Poly high value */
LDD_CRC_TTransposeType InputTransposeMode; /*!< Input transpose type */
LDD_CRC_TTransposeType OutputTransposeMode; /*!< Output transpose type */
} LDD_CRC_TUserCRCStandard;
/*
** ===================================================================
** RNG device types and constants
** ===================================================================
*/
#define LDD_RNG_LFSR_ERROR 0x01U /*!< Linear feedback shift register error */
#define LDD_RNG_OSCILLATOR_ERROR 0x02U /*!< Oscillator error */
#define LDD_RNG_SELF_TEST_ERROR 0x04U /*!< Self test error */
#define LDD_RNG_STATISTICAL_ERROR 0x08U /*!< LStatistical test error */
#define LDD_RNG_FIFO_UNDERFLOW_ERROR 0x10U /*!< FIFO underflow error */
#define LDD_RNG_SELF_TETS_RESEED_ERROR 0x00200000U /*!< Reseed self test fail */
#define LDD_RNG_SELF_TEST_PRNG_ERROR 0x00400000U /*!< PRNG self test fail */
#define LDD_RNG_SELF_TEST_TRNG_ERROR 0x00800000U /*!< TRNG self test fail */
#define LDD_RNG_MONOBIT_TEST_ERROR 0x01000000U /*!< Monobit test fail */
#define LDD_RNG_LENGTH_1_RUN_TEST_ERROR 0x02000000U /*!< Length 1 run test fail */
#define LDD_RNG_LENGTH_2_RUN_TEST_ERROR 0x04000000U /*!< Length 2 run test fail */
#define LDD_RNG_LENGTH_3_RUN_TEST_ERROR 0x08000000U /*!< Length 3 run test fail */
#define LDD_RNG_LENGTH_4_RUN_TEST_ERROR 0x10000000U /*!< Length 4 run test fail */
#define LDD_RNG_LENGTH_5_RUN_TEST_ERROR 0x20000000U /*!< Length 5 run test fail */
#define LDD_RNG_LENGTH_6_RUN_TEST_ERROR 0x40000000U /*!< Length 6 run test fail */
#define LDD_RNG_LONG_RUN_TEST_ERROR 0x80000000U /*!< Long run test fail */
#define LDD_RNG_ON_SEED_GENERATION_DONE 0x01U /*!< OnSeedGenerationDone event mask */
#define LDD_RNG_ON_SELF_TEST_DONE 0x02U /*!< OnSelfTestDone event mask */
#define LDD_RNG_ON_ERROR_LFSR 0x04U /*!< OnErrorLFSR event mask */
#define LDD_RNG_ON_OSC_ERROR 0x08U /*!< OnOscError event mask */
#define LDD_RNG_ON_SELF_TEST_ERROR 0x10U /*!< OnSelfTestError event mask */
#define LDD_RNG_ON_STATISTICAL_ERROR 0x20U /*!< OnStatisticalError event mask */
#define LDD_RNG_ON_FIFO_UNDER_FLOW_ERROR 0x40U /*!< OnFIFOUnderFlowError event mask */
#define LDD_RNG_ON_FIFOUNDER_FLOW_ERROR 0x40U /*!< OnFIFOUnderFlowError event mask */
#define LDD_RNG_STATUS_ERROR 0xFFFFU /*!< Error in RNG module flag */
#define LDD_RNG_STATUS_NEW_SEED_DONE 0x40U /*!< New seed done flag */
#define LDD_RNG_STATUS_SEED_DONE 0x20U /*!< Seed done flag */
#define LDD_RNG_STATUS_SELF_TEST_DONE 0x10U /*!< Self test done flag */
#define LDD_RNG_STATUS_RESEED_NEEDED 0x08U /*!< Reseed needed flag */
#define LDD_RNG_STATUS_SLEEP 0x04U /*!< RNG in sleep mode */
#define LDD_RNG_STATUS_BUSY 0x02U /*!< RNG busy flag */
/*
** ===================================================================
** RNGA device types and constants
** ===================================================================
*/
#define LDD_RNG_ON_ERROR 0x01U /*!< OnError event mask */
#define LDD_RNG_STATUS_SECURITY_VIOLATION 0x01U /*!< Security violation occured */
#define LDD_RNG_STATUS_LAST_READ_UNDERFLOW 0x02U /*!< Last read from RNGA caused underflow error */
#define LDD_RNG_STATUS_OUT_REG_UNDERFLOW 0x04U /*!< The RNGA Output Register has been read while empty since last read of the RNGA Status Register. */
#define LDD_RNG_STATUS_ERR_INT_PENDING 0x08U /*!< Error interrupt pending */
#define LDD_RNG_STATUS_SLEEP_MODE 0x10U /*!< Sleep mode enabled */
/*! RNGA sleep mode */
typedef enum {
LDD_RNG_SLEEP_ENABLED, /*!< RNGA is in sleep mode */
LDD_RNG_SLEEP_DISABLED /*!< RNGA is running */
} LDD_RNG_TSleepMode;
/*
** ===================================================================
** DryIce device types and constants
** ===================================================================
*/
#define LDD_DRY_ON_TAMPER_DETECTED 0x01U /*!< OnTamperDetected event mask */
/* Tamper flags */
#define LDD_DRY_TIME_OVERFLOW 0x04U /*!< RTC time overflow has occurred. */
#define LDD_DRY_MONOTONIC_OVERFLOW 0x08U /*!< RTC monotonic overflow has occurred. */
#define LDD_DRY_VOLTAGE_TAMPER 0x10U /*!< VBAT voltage is outside of the valid range. */
#define LDD_DRY_CLOCK_TAMPER 0x20U /*!< The 32.768 kHz clock source is outside the valid range. */
#define LDD_DRY_TEMPERATURE_TAMPER 0x40U /*!< The junction temperature is outside of specification. */
#define LDD_DRY_SECURITY_TAMPER 0x80U /*!< The (optional) security module asserted its tamper detect. */
#define LDD_DRY_FLASH_SECURITY 0x0100U /*!< The flash security is disabled. */
#define LDD_DRY_TEST_MODE 0x0200U /*!< Any test mode has been entered. */
/* Tamper flags indicating that the pin does not equal its expected value and was not filtered by the glitch filter (if enabled). */
#define LDD_DRY_TAMPER_PIN_0 0x00010000U /*!< Mismatch on tamper pin 0. */
#define LDD_DRY_TAMPER_PIN_1 0x00020000U /*!< Mismatch on tamper pin 1. */
#define LDD_DRY_TAMPER_PIN_2 0x00040000U /*!< Mismatch on tamper pin 2. */
#define LDD_DRY_TAMPER_PIN_3 0x00080000U /*!< Mismatch on tamper pin 3. */
#define LDD_DRY_TAMPER_PIN_4 0x00100000U /*!< Mismatch on tamper pin 4. */
#define LDD_DRY_TAMPER_PIN_5 0x00200000U /*!< Mismatch on tamper pin 5. */
#define LDD_DRY_TAMPER_PIN_6 0x00400000U /*!< Mismatch on tamper pin 6. */
#define LDD_DRY_TAMPER_PIN_7 0x00800000U /*!< Mismatch on tamper pin 7. */
#define LDD_DRY_SECURE_KEY_WORD_0 0x01U /*!< Secure key word 0 mask */
#define LDD_DRY_SECURE_KEY_WORD_1 0x02U /*!< Secure key word 1 mask */
#define LDD_DRY_SECURE_KEY_WORD_2 0x04U /*!< Secure key word 2 mask */
#define LDD_DRY_SECURE_KEY_WORD_3 0x08U /*!< Secure key word 3 mask */
#define LDD_DRY_SECURE_KEY_WORD_4 0x10U /*!< Secure key word 4 mask */
#define LDD_DRY_SECURE_KEY_WORD_5 0x20U /*!< Secure key word 5 mask */
#define LDD_DRY_SECURE_KEY_WORD_6 0x40U /*!< Secure key word 6 mask */
#define LDD_DRY_SECURE_KEY_WORD_7 0x80U /*!< Secure key word 7 mask */
/*
** ===================================================================
** NFC device types and constants
** ===================================================================
*/
/* Events' masks */
#define LDD_NFC_ON_CMD_ERROR 0x01U /*!< OnCmdError event mask */
#define LDD_NFC_ON_CMD_DONE 0x02U /*!< OnCmdDone event mask */
/* Pins' masks */
#define LDD_NFC_CE0_PIN 0x01U /*!< CE0 pin mask */
#define LDD_NFC_RB0_PIN 0x02U /*!< RB0 pin mask */
#define LDD_NFC_CE1_PIN 0x04U /*!< CE1 pin mask */
#define LDD_NFC_RB1_PIN 0x08U /*!< RB1 pin mask */
#define LDD_NFC_CE2_PIN 0x10U /*!< CE2 pin mask */
#define LDD_NFC_RB2_PIN 0x20U /*!< RB2 pin mask */
#define LDD_NFC_CE3_PIN 0x40U /*!< CE3 pin mask */
#define LDD_NFC_RB3_PIN 0x80U /*!< RB3 pin mask */
#define LDD_NFC_ALE_PIN 0x0100U /*!< ALE pin mask */
#define LDD_NFC_CLE_PIN 0x0200U /*!< CLE pin mask */
#define LDD_NFC_RE_PIN 0x0400U /*!< RE pin mask */
#define LDD_NFC_WE_PIN 0x0800U /*!< WE pin mask */
#define LDD_NFC_D0_PIN 0x00010000U /*!< D0 pin mask */
#define LDD_NFC_D1_PIN 0x00020000U /*!< D1 pin mask */
#define LDD_NFC_D2_PIN 0x00040000U /*!< D2 pin mask */
#define LDD_NFC_D3_PIN 0x00080000U /*!< D3 pin mask */
#define LDD_NFC_D4_PIN 0x00100000U /*!< D4 pin mask */
#define LDD_NFC_D5_PIN 0x00200000U /*!< D5 pin mask */
#define LDD_NFC_D6_PIN 0x00400000U /*!< D6 pin mask */
#define LDD_NFC_D7_PIN 0x00800000U /*!< D7 pin mask */
#define LDD_NFC_D8_PIN 0x01000000U /*!< D8 pin mask */
#define LDD_NFC_D9_PIN 0x02000000U /*!< D9 pin mask */
#define LDD_NFC_D10_PIN 0x04000000U /*!< D10 pin mask */
#define LDD_NFC_D11_PIN 0x08000000U /*!< D11 pin mask */
#define LDD_NFC_D12_PIN 0x10000000U /*!< D12 pin mask */
#define LDD_NFC_D13_PIN 0x20000000U /*!< D13 pin mask */
#define LDD_NFC_D14_PIN 0x40000000U /*!< D14 pin mask */
#define LDD_NFC_D15_PIN 0x80000000U /*!< D15 pin mask */
typedef uint32_t LDD_NFC_TTargetID; /*!< NFC target ID type */
/*! NCF command codes */
typedef enum {
LDD_NFC_CMD_NONE = 0x00U, /* No command */
LDD_NFC_CMD_RESET = 0x01U, /* Reset command */
LDD_NFC_CMD_ERASE = 0x02U, /* Erase command */
LDD_NFC_CMD_READ_ID = 0x03U, /* Read ID command */
LDD_NFC_CMD_READ_PAGES = 0x04U, /* Read pages command */
LDD_NFC_CMD_WRITE_PAGES = 0x05U, /* Write pages command */
LDD_NFC_CMD_ERASE_BLOCKS = 0x06U, /* Erase page command */
LDD_NFC_CMD_READ_RAW_PAGE = 0x07U, /* Read raw page command */
LDD_NFC_CMD_WRITE_RAW_PAGE = 0x08U /* Write raw page command */
} LDD_NFC_TeCmd;
/*
** ===================================================================
** LCDC device types and constants
** ===================================================================
*/
#define LDD_LCDC_ON_ERROR 0x01U /*!< OnError event mask */
#define LDD_LCDC_ON_START_OF_FRAME 0x02U /*!< OnStartOfFrame event mask */
#define LDD_LCDC_ON_END_OF_FRAME 0x04U /*!< OnEndOfFrame event mask */
#define LDD_LCDC_NO_ERR 0x00U /*!< No error */
#define LDD_LCDC_PLANE_0_UNDERRUN_ERR 0x01U /*!< Plane 0 underrurn error */
#define LDD_LCDC_PLANE_1_UNDERRUN_ERR 0x02U /*!< Plane 1 underrurn error */
#define LDD_LCDC_REVERSED_VERTICAL_SCAN 0x8000U /*!< Enable reversed vertical scan (flip along x-axis) */
/*! Bitmap description */
typedef struct {
LDD_TData *Address; /*!< Bitmap starting address */
uint16_t Width; /*!< Bitmap width */
uint16_t Height; /*!< Bitmap height */
uint16_t Format; /*!< Bitmap format */
} LDD_LCDC_TBitmap;
/*! Window description */
typedef struct {
uint16_t X; /*!< Window position in bitmap - X */
uint16_t Y; /*!< Window position in bitmap - Y */
uint16_t Width; /*!< Window width */
uint16_t Height; /*!< Window height */
} LDD_LCDC_TWindow;
/*! Cursor type */
typedef enum {
LDD_LCDC_DISABLED = 0, /*!< Cursor disabled */
LDD_LCDC_ALWAYS_1, /*!< Cursor 1''s, monochrome display only. */
LDD_LCDC_ALWAYS_0, /*!< Cursor 0''s, monochrome display only. */
LDD_LCDC_COLOR, /*!< Defined cursor color, color display only. */
LDD_LCDC_INVERTED, /*!< Inverted background, monochrome display only. */
LDD_LCDC_INVERTED_COLOR, /*!< Inverted cursor color, color display only. */
LDD_LCDC_AND, /*!< Cursor color AND backgroun, color display only. */
LDD_LCDC_OR, /*!< Cursor color OR backgroun, color display only. */
LDD_LCDC_XOR
} LDD_LCDC_CursorOperation;
/*! Plane identification */
typedef enum {
LDD_LCDC_PLANE_COMMON, /*!< Common for all planes */
LDD_LCDC_PLANE_0, /*!< Plane (layer) 0 */
LDD_LCDC_PLANE_1 /*!< Plane (layer) 1 */
} LDD_LCDC_TPlaneID;
/*
** ===================================================================
** Interrupt vector constants
** ===================================================================
*/
#define LDD_ivIndex_INT_Initial_Stack_Pointer 0x00u
#define LDD_ivIndex_INT_Initial_Program_Counter 0x01u
#define LDD_ivIndex_INT_NMI 0x02u
#define LDD_ivIndex_INT_Hard_Fault 0x03u
#define LDD_ivIndex_INT_Reserved4 0x04u
#define LDD_ivIndex_INT_Reserved5 0x05u
#define LDD_ivIndex_INT_Reserved6 0x06u
#define LDD_ivIndex_INT_Reserved7 0x07u
#define LDD_ivIndex_INT_Reserved8 0x08u
#define LDD_ivIndex_INT_Reserved9 0x09u
#define LDD_ivIndex_INT_Reserved10 0x0Au
#define LDD_ivIndex_INT_SVCall 0x0Bu
#define LDD_ivIndex_INT_Reserved12 0x0Cu
#define LDD_ivIndex_INT_Reserved13 0x0Du
#define LDD_ivIndex_INT_PendableSrvReq 0x0Eu
#define LDD_ivIndex_INT_SysTick 0x0Fu
#define LDD_ivIndex_INT_Reserved16 0x10u
#define LDD_ivIndex_INT_Reserved17 0x11u
#define LDD_ivIndex_INT_Reserved18 0x12u
#define LDD_ivIndex_INT_Reserved19 0x13u
#define LDD_ivIndex_INT_Reserved20 0x14u
#define LDD_ivIndex_INT_FTMRH 0x15u
#define LDD_ivIndex_INT_LVD_LVW 0x16u
#define LDD_ivIndex_INT_IRQ 0x17u
#define LDD_ivIndex_INT_I2C0 0x18u
#define LDD_ivIndex_INT_Reserved25 0x19u
#define LDD_ivIndex_INT_SPI0 0x1Au
#define LDD_ivIndex_INT_SPI1 0x1Bu
#define LDD_ivIndex_INT_UART0 0x1Cu
#define LDD_ivIndex_INT_UART1 0x1Du
#define LDD_ivIndex_INT_UART2 0x1Eu
#define LDD_ivIndex_INT_ADC0 0x1Fu
#define LDD_ivIndex_INT_ACMP0 0x20u
#define LDD_ivIndex_INT_FTM0 0x21u
#define LDD_ivIndex_INT_FTM1 0x22u
#define LDD_ivIndex_INT_FTM2 0x23u
#define LDD_ivIndex_INT_RTC 0x24u
#define LDD_ivIndex_INT_ACMP1 0x25u
#define LDD_ivIndex_INT_PIT_CH0 0x26u
#define LDD_ivIndex_INT_PIT_CH1 0x27u
#define LDD_ivIndex_INT_KBI0 0x28u
#define LDD_ivIndex_INT_KBI1 0x29u
#define LDD_ivIndex_INT_Reserved42 0x2Au
#define LDD_ivIndex_INT_ICS 0x2Bu
#define LDD_ivIndex_INT_WDOG_EWM 0x2Cu
#define LDD_ivIndex_INT_Reserved45 0x2Du
#define LDD_ivIndex_INT_Reserved46 0x2Eu
#define LDD_ivIndex_INT_Reserved47 0x2Fu
#endif /* __PE_Types_H */
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.5 [05.21]
** for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/
| [
"jason_hotchkiss@hotmail.com"
] | jason_hotchkiss@hotmail.com |
896db9f54aa801d054e5baf70bb6231f4f78cddc | 5c255f911786e984286b1f7a4e6091a68419d049 | /code/0896109a-1953-41b9-941a-83b145890a08.c | 23b80ac70c54ecfe00a39a5adc1a7bbf21ec0950 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 253 | c | #include <stdio.h>
int main() {
int i=4;
int j=14;
int k;
int l;
k = 53;
l = 54;
k = i/j;
l = i/j;
l = i/j;
l = l/j;
l = i%j;
l = l%j;
k = k-k*i;
printf("vulnerability");
printf("%d%d\n",k,l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
560e7d134155e59e329b27de06365c9163475f5c | 6ec06cce9aff96094da1d05c388cf8fcaa3ef923 | /kernel/vfs/read_write.c | 7840755dee0736236e914156191f6e5f8bca432d | [] | no_license | WeihanLikk/KOS | e45e9466bd8400bd852cac9a63e51c19137af55f | 67b0a1b4bd5425802554c941b4a6035e2cabff04 | refs/heads/master | 2022-09-06T22:22:30.637567 | 2019-01-11T08:42:15 | 2019-01-11T08:42:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,957 | c | #include <zjunix/vfs/vfs.h>
#include <zjunix/vfs/vfscache.h>
#include <zjunix/slab.h>
#include <zjunix/utils.h>
#include <driver/vga.h>
#include <zjunix/log.h>
extern struct cache *pcache;
/* TODO : modify ext2/fat32 initialization
modify macro READ_FILE/WRITE_FILE
function declaration page_to_cache
*/
u32 vfs_read( struct file *fp, char *buf, u32 count, u32 *ppos )
{
if ( !( fp->f_mode & FMODE_READ ) )
return -EBADF;
if ( !fp->f_op || !fp->f_op->read )
return -EINVAL;
return fp->f_op->read( fp, buf, count, ppos, READ_FILE );
}
u32 vfs_write( struct file *fp, char *buf, u32 count, u32 *ppos )
{
if ( !( fp->f_mode & FMODE_READ ) )
return -EBADF;
if ( !fp->f_op || !fp->f_op->write )
return -EINVAL;
return fp->f_op->write( fp, buf, count, ppos, WRITE_FILE );
}
u32 generic_file_read_write( struct file *fp, u8 *buf, u32 count, u32 *ppos, u32 isread )
{
struct inode *inode = fp->f_dentry->d_inode;
struct address_space *mapping = &( inode->i_data );
u32 pos = *ppos;
// TODO: page -- blksize
u32 blksize = inode->i_blksize;
u32 startPageNo = pos / blksize;
u32 startPageCur = pos % blksize;
u32 endPageNo, endPageCur;
if ( isread && pos + count < inode->i_size )
{
endPageNo = ( pos + count ) / blksize;
endPageCur = ( pos + count ) % blksize;
}
else
{
endPageNo = inode->i_size / blksize;
endPageCur = inode->i_size % blksize;
}
// kernel_printf( "StartPageNo = %d, endPageNo = %d, startPageCur = %d, endPageNo = %d\n", startPageNo, endPageNo, startPageCur, endPageCur );
u32 cur = 0;
for ( u32 pageNo = startPageNo; pageNo <= endPageNo; pageNo++ )
{
u32 r_page = mapping->a_op->bmap( inode, pageNo ); // file relative page address -> physical address
struct condition cond = {
.cond1 = (void *)( &r_page ),
.cond2 = (void *)( fp->f_dentry->d_inode ),
};
// TODO: pcache_look_up mechanism
struct vfs_page *curPage = (struct vfs_page *)pcache->c_op->look_up( pcache, &cond );
if ( !curPage )
{
curPage = page_to_cache( r_page, mapping );
if ( !curPage )
goto out;
}
// data copy
u32 curStartPageCur = ( pageNo == startPageNo ) ? startPageCur : 0;
u32 curEndPageCur = ( pageNo == endPageNo ) ? endPageCur : blksize;
u32 Count = curEndPageCur - curStartPageCur;
if ( isread )
kernel_memcpy( buf + cur, curPage->p_data + curStartPageCur, Count );
else
{
kernel_memcpy( curPage->p_data + curStartPageCur, buf + cur, Count );
// adopt write through mechanism
mapping->a_op->writepage( curPage );
}
cur += Count;
*ppos += Count;
// kernel_printf( "buf = %s\n", buf );
// kernel_printf( "Count = %d\n", Count );
}
if ( !isread && inode->i_size )
{
inode->i_size = pos + count;
struct dentry *parent = fp->f_dentry->d_parent;
// adopt write through mechanism
inode->i_sb->s_op->write_inode( inode, parent );
}
out:
fp->f_pos = *ppos;
return cur;
}
struct vfs_page *page_to_cache( u32 r_page, struct address_space *mapping )
{
struct vfs_page *newPage = (struct vfs_page *)kmalloc( sizeof( struct vfs_page ) );
if ( !newPage )
goto out;
newPage->p_state = P_CLEAR;
newPage->p_location = r_page;
newPage->p_mapping = mapping;
INIT_LIST_HEAD( &newPage->p_hash );
INIT_LIST_HEAD( &newPage->p_LRU );
INIT_LIST_HEAD( &newPage->p_list );
// NEED CHECK
if ( newPage->p_mapping->a_op->readpage( newPage ) )
{
release_page( newPage );
goto out;
}
pcache->c_op->add( pcache, (void *)newPage );
// NEED CHECK
list_add( &newPage->p_list, &mapping->a_cache );
out:
return newPage;
}
u32 generic_file_flush( struct file *fp )
{
struct address_space *mapping = &( fp->f_dentry->d_inode->i_data );
struct list_head *begin = &( mapping->a_cache );
struct list_head *a = begin;
struct vfs_page *page;
while ( a != begin )
{
page = container_of( a, struct vfs_page, p_list );
if ( page->p_state & P_DIRTY )
mapping->a_op->writepage( page );
a = a->next;
}
return 0;
} | [
"939336352@qq.com"
] | 939336352@qq.com |
dc5caf47840e8142bf49bda8201ba66fddcb2a41 | 725965d92e0eca570df597cbccc7c11d4731391d | /laplace_solver/advanced_multi_gpu_mpi_openacc/C/task1/poisson2d.solution.c | 84d9598fd3e2d9c373d976225d3b0ecd76406ddd | [] | no_license | StevenCHowell/accelerate | f5f42babcb4a950675eb48ac9427df2aa60eeb4f | b7d6790bcfc1940e3745fb2deb0d402c33475b10 | refs/heads/master | 2021-06-11T10:18:58.888662 | 2017-02-09T14:13:29 | 2017-02-09T14:13:29 | 72,563,485 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,663 | c | /*
* Copyright 2015 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#ifdef _OPENACC
#include <openacc.h>
#endif /*_OPENACC*/
#include "common.h"
#include <mpi.h>
#define NY 4096
#define NX 4096
real A[NY][NX];
real Aref[NY][NX];
real Anew[NY][NX];
real rhs[NY][NX];
int main(int argc, char** argv)
{
int iter_max = 1000;
const real tol = 1.0e-5;
int rank = 0;
int size = 1;
//Initialize MPI and determine rank and size
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
memset(A, 0, NY * NX * sizeof(real));
memset(Aref, 0, NY * NX * sizeof(real));
// set rhs
for (int iy = 1; iy < NY-1; iy++)
{
for( int ix = 1; ix < NX-1; ix++ )
{
const real x = -1.0 + (2.0*ix/(NX-1));
const real y = -1.0 + (2.0*iy/(NY-1));
rhs[iy][ix] = expr(-10.0*(x*x + y*y));
}
}
#if _OPENACC
acc_device_t device_type = acc_get_device_type();
if ( acc_device_nvidia == device_type )
{
int ngpus=acc_get_num_devices(acc_device_nvidia);
int devicenum=rank%ngpus;
acc_set_device_num(devicenum,acc_device_nvidia);
}
// Call acc_init after acc_set_device_num to avoid multiple contexts on device 0 in multi GPU systems
acc_init(device_type);
#endif /*_OPENACC*/
int ix_start = 1;
int ix_end = (NX - 1);
// Ensure correctness if NY%size != 0
int chunk_size = ceil( (1.0*NY)/size );
int iy_start = rank * chunk_size;
int iy_end = iy_start + chunk_size;
// Do not process boundaries
iy_start = max( iy_start, 1 );
iy_end = min( iy_end, NY - 1 );
if ( rank == 0) printf("Jacobi relaxation Calculation: %d x %d mesh\n", NY, NX);
if ( rank == 0) printf("Calculate reference solution and time serial execution.\n");
StartTimer();
poisson2d_serial( rank, iter_max, tol );
double runtime_serial = GetTimer();
//Wait for all processes to ensure correct timing of the parallel version
MPI_Barrier( MPI_COMM_WORLD );
if ( rank == 0) printf("Parallel execution.\n");
StartTimer();
int iter = 0;
real error = 1.0;
#pragma acc data copy(A) copyin(rhs) create(Anew)
while ( error > tol && iter < iter_max )
{
error = 0.0;
#pragma acc kernels
for (int iy = iy_start; iy < iy_end; iy++)
{
for( int ix = ix_start; ix < ix_end; ix++ )
{
Anew[iy][ix] = -0.25 * (rhs[iy][ix] - ( A[iy][ix+1] + A[iy][ix-1]
+ A[iy-1][ix] + A[iy+1][ix] ));
error = fmaxr( error, fabsr(Anew[iy][ix]-A[iy][ix]));
}
}
real globalerror = 0.0;
MPI_Allreduce( &error, &globalerror, 1, MPI_REAL_TYPE, MPI_MAX, MPI_COMM_WORLD );
error = globalerror;
#pragma acc kernels
for( int ix = ix_start; ix < ix_end; ix++ )
{
A[iy_start][ix] = Anew[iy_start][ix];
A[iy_end-1][ix] = Anew[iy_end-1][ix];
}
#pragma acc kernels async
for (int iy = iy_start+1; iy < iy_end-1; iy++)
{
for( int ix = ix_start; ix < ix_end; ix++ )
{
A[iy][ix] = Anew[iy][ix];
}
}
//Periodic boundary conditions
int top = (rank == 0) ? (size-1) : rank-1;
int bottom = (rank == (size-1)) ? 0 : rank+1;
#pragma acc host_data use_device( A )
{
//1. Sent row iy_start (first modified row) to top receive lower boundary (iy_end) from bottom
MPI_Sendrecv( &A[iy_start][ix_start], (ix_end-ix_start), MPI_REAL_TYPE, top , 0, &A[iy_end][ix_start], (ix_end-ix_start), MPI_REAL_TYPE, bottom, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE );
//2. Sent row (iy_end-1) (last modified row) to bottom receive upper boundary (iy_start-1) from top
MPI_Sendrecv( &A[(iy_end-1)][ix_start], (ix_end-ix_start), MPI_REAL_TYPE, bottom, 0, &A[(iy_start-1)][ix_start], (ix_end-ix_start), MPI_REAL_TYPE, top , 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE );
}
#pragma acc wait
#pragma acc kernels
for (int iy = iy_start; iy < iy_end; iy++)
{
A[iy][0] = A[iy][(NX-2)];
A[iy][(NX-1)] = A[iy][1];
}
if(rank == 0 && (iter % 100) == 0) printf("%5d, %0.6f\n", iter, error);
iter++;
}
MPI_Barrier( MPI_COMM_WORLD );
double runtime = GetTimer();
if (check_results( rank, ix_start, ix_end, iy_start, iy_end, tol ) && rank == 0)
{
printf( "Num GPUs: %d.\n", size );
printf( "%dx%d: 1 GPU: %8.4f s, %d GPUs: %8.4f s, speedup: %8.2f, efficiency: %8.2f%\n", NY,NX, runtime_serial/ 1000.0, size, runtime/ 1000.0, runtime_serial/runtime, runtime_serial/(size*runtime)*100 );
}
MPI_Finalize();
return 0;
}
#include "poisson2d_serial.h"
| [
"steven.howell@nist.gov"
] | steven.howell@nist.gov |
6ecfdfc20c25a8acacae7cf43e20ee95d9e4302a | 6327fb3c3f9b73156fca30d593cc693fb3c9d943 | /HEVC/src/HevcDecoder_Algo_Parser.c | 85d607012505e8b5be31eff912c89a9a28ca4e66 | [] | no_license | Papify/test-bench | c8ba4a043cc55b657410853c1497118545f67545 | a4381edad506bf1567469f146d2fd4fdc47edfc5 | refs/heads/master | 2021-01-01T15:59:52.566831 | 2014-11-28T16:02:26 | 2014-11-28T16:02:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 699,180 | c | // Source file is "L/RVC/src/org/sc29/wg11/mpegh/part2/main/synParser/Algo_Parser.cal"
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "types.h"
#include "fifo.h"
#include "util.h"
#include "scheduler.h"
#include "dataflow.h"
#include "cycle.h"
#define SIZE 8192
////////////////////////////////////////////////////////////////////////////////
// Instance
extern actor_t HevcDecoder_Algo_Parser;
////////////////////////////////////////////////////////////////////////////////
// Input FIFOs
extern fifo_u8_t *HevcDecoder_Algo_Parser_byte;
////////////////////////////////////////////////////////////////////////////////
// Input Fifo control variables
static unsigned int index_byte;
static unsigned int numTokens_byte;
#define SIZE_byte SIZE
#define tokens_byte HevcDecoder_Algo_Parser_byte->contents
extern connection_t connection_HevcDecoder_Algo_Parser_byte;
#define rate_byte connection_HevcDecoder_Algo_Parser_byte.rate
////////////////////////////////////////////////////////////////////////////////
// Predecessors
extern actor_t Source;
////////////////////////////////////////////////////////////////////////////////
// Output FIFOs
extern fifo_u16_t *HevcDecoder_Algo_Parser_CUInfo;
extern fifo_u8_t *HevcDecoder_Algo_Parser_IntraPredMode;
extern fifo_u16_t *HevcDecoder_Algo_Parser_SliceAddr;
extern fifo_u16_t *HevcDecoder_Algo_Parser_TilesCoord;
extern fifo_u8_t *HevcDecoder_Algo_Parser_LcuSizeMax;
extern fifo_u8_t *HevcDecoder_Algo_Parser_PartMode;
extern fifo_u8_t *HevcDecoder_Algo_Parser_IsPicSlcLcu;
extern fifo_u8_t *HevcDecoder_Algo_Parser_IsPicSlc;
extern fifo_u8_t *HevcDecoder_Algo_Parser_LFAcrossSlcTile;
extern fifo_u16_t *HevcDecoder_Algo_Parser_PictSize;
extern fifo_i16_t *HevcDecoder_Algo_Parser_Poc;
extern fifo_i16_t *HevcDecoder_Algo_Parser_SaoSe;
extern fifo_u8_t *HevcDecoder_Algo_Parser_SEI_MD5;
extern fifo_u8_t *HevcDecoder_Algo_Parser_SliceType;
extern fifo_i32_t *HevcDecoder_Algo_Parser_SplitTransform;
extern fifo_i8_t *HevcDecoder_Algo_Parser_TUSize;
extern fifo_i16_t *HevcDecoder_Algo_Parser_Coeff;
extern fifo_i32_t *HevcDecoder_Algo_Parser_StrongIntraSmoothing;
extern fifo_u16_t *HevcDecoder_Algo_Parser_DispCoord;
extern fifo_u16_t *HevcDecoder_Algo_Parser_PicSizeInMb;
extern fifo_u8_t *HevcDecoder_Algo_Parser_NumRefIdxLxActive;
extern fifo_u8_t *HevcDecoder_Algo_Parser_RefPicListModif;
extern fifo_i16_t *HevcDecoder_Algo_Parser_RefPoc;
extern fifo_i16_t *HevcDecoder_Algo_Parser_MvPredSyntaxElem;
extern fifo_i32_t *HevcDecoder_Algo_Parser_Cbf;
extern fifo_i32_t *HevcDecoder_Algo_Parser_DBFDisable;
extern fifo_i8_t *HevcDecoder_Algo_Parser_DbfSe;
extern fifo_i8_t *HevcDecoder_Algo_Parser_ReorderPics;
extern fifo_i16_t *HevcDecoder_Algo_Parser_WeightedPred;
extern fifo_i8_t *HevcDecoder_Algo_Parser_Qp;
////////////////////////////////////////////////////////////////////////////////
// Output Fifo control variables
static unsigned int index_CUInfo;
static unsigned int numFree_CUInfo;
#define NUM_READERS_CUInfo 5
#define SIZE_CUInfo SIZE
#define tokens_CUInfo HevcDecoder_Algo_Parser_CUInfo->contents
static unsigned int index_IntraPredMode;
static unsigned int numFree_IntraPredMode;
#define NUM_READERS_IntraPredMode 1
#define SIZE_IntraPredMode SIZE
#define tokens_IntraPredMode HevcDecoder_Algo_Parser_IntraPredMode->contents
static unsigned int index_SliceAddr;
static unsigned int numFree_SliceAddr;
#define NUM_READERS_SliceAddr 3
#define SIZE_SliceAddr SIZE
#define tokens_SliceAddr HevcDecoder_Algo_Parser_SliceAddr->contents
static unsigned int index_TilesCoord;
static unsigned int numFree_TilesCoord;
#define NUM_READERS_TilesCoord 5
#define SIZE_TilesCoord SIZE
#define tokens_TilesCoord HevcDecoder_Algo_Parser_TilesCoord->contents
static unsigned int index_LcuSizeMax;
static unsigned int numFree_LcuSizeMax;
#define NUM_READERS_LcuSizeMax 5
#define SIZE_LcuSizeMax SIZE
#define tokens_LcuSizeMax HevcDecoder_Algo_Parser_LcuSizeMax->contents
static unsigned int index_PartMode;
static unsigned int numFree_PartMode;
#define NUM_READERS_PartMode 5
#define SIZE_PartMode SIZE
#define tokens_PartMode HevcDecoder_Algo_Parser_PartMode->contents
static unsigned int index_IsPicSlcLcu;
static unsigned int numFree_IsPicSlcLcu;
#define NUM_READERS_IsPicSlcLcu 2
#define SIZE_IsPicSlcLcu SIZE
#define tokens_IsPicSlcLcu HevcDecoder_Algo_Parser_IsPicSlcLcu->contents
static unsigned int index_IsPicSlc;
static unsigned int numFree_IsPicSlc;
#define NUM_READERS_IsPicSlc 1
#define SIZE_IsPicSlc SIZE
#define tokens_IsPicSlc HevcDecoder_Algo_Parser_IsPicSlc->contents
static unsigned int index_LFAcrossSlcTile;
static unsigned int numFree_LFAcrossSlcTile;
#define NUM_READERS_LFAcrossSlcTile 2
#define SIZE_LFAcrossSlcTile SIZE
#define tokens_LFAcrossSlcTile HevcDecoder_Algo_Parser_LFAcrossSlcTile->contents
static unsigned int index_PictSize;
static unsigned int numFree_PictSize;
#define NUM_READERS_PictSize 5
#define SIZE_PictSize SIZE
#define tokens_PictSize HevcDecoder_Algo_Parser_PictSize->contents
static unsigned int index_Poc;
static unsigned int numFree_Poc;
#define NUM_READERS_Poc 3
#define SIZE_Poc SIZE
#define tokens_Poc HevcDecoder_Algo_Parser_Poc->contents
static unsigned int index_SaoSe;
static unsigned int numFree_SaoSe;
#define NUM_READERS_SaoSe 1
#define SIZE_SaoSe 16384
#define tokens_SaoSe HevcDecoder_Algo_Parser_SaoSe->contents
static unsigned int index_SEI_MD5;
static unsigned int numFree_SEI_MD5;
#define NUM_READERS_SEI_MD5 1
#define SIZE_SEI_MD5 SIZE
#define tokens_SEI_MD5 HevcDecoder_Algo_Parser_SEI_MD5->contents
static unsigned int index_SliceType;
static unsigned int numFree_SliceType;
#define NUM_READERS_SliceType 2
#define SIZE_SliceType SIZE
#define tokens_SliceType HevcDecoder_Algo_Parser_SliceType->contents
static unsigned int index_SplitTransform;
static unsigned int numFree_SplitTransform;
#define NUM_READERS_SplitTransform 2
#define SIZE_SplitTransform SIZE
#define tokens_SplitTransform HevcDecoder_Algo_Parser_SplitTransform->contents
static unsigned int index_TUSize;
static unsigned int numFree_TUSize;
#define NUM_READERS_TUSize 3
#define SIZE_TUSize SIZE
#define tokens_TUSize HevcDecoder_Algo_Parser_TUSize->contents
static unsigned int index_Coeff;
static unsigned int numFree_Coeff;
#define NUM_READERS_Coeff 1
#define SIZE_Coeff SIZE
#define tokens_Coeff HevcDecoder_Algo_Parser_Coeff->contents
static unsigned int index_StrongIntraSmoothing;
static unsigned int numFree_StrongIntraSmoothing;
#define NUM_READERS_StrongIntraSmoothing 1
#define SIZE_StrongIntraSmoothing SIZE
#define tokens_StrongIntraSmoothing HevcDecoder_Algo_Parser_StrongIntraSmoothing->contents
static unsigned int index_DispCoord;
static unsigned int numFree_DispCoord;
#define NUM_READERS_DispCoord 1
#define SIZE_DispCoord SIZE
#define tokens_DispCoord HevcDecoder_Algo_Parser_DispCoord->contents
static unsigned int index_PicSizeInMb;
static unsigned int numFree_PicSizeInMb;
#define NUM_READERS_PicSizeInMb 2
#define SIZE_PicSizeInMb SIZE
#define tokens_PicSizeInMb HevcDecoder_Algo_Parser_PicSizeInMb->contents
static unsigned int index_NumRefIdxLxActive;
static unsigned int numFree_NumRefIdxLxActive;
#define NUM_READERS_NumRefIdxLxActive 1
#define SIZE_NumRefIdxLxActive SIZE
#define tokens_NumRefIdxLxActive HevcDecoder_Algo_Parser_NumRefIdxLxActive->contents
static unsigned int index_RefPicListModif;
static unsigned int numFree_RefPicListModif;
#define NUM_READERS_RefPicListModif 1
#define SIZE_RefPicListModif SIZE
#define tokens_RefPicListModif HevcDecoder_Algo_Parser_RefPicListModif->contents
static unsigned int index_RefPoc;
static unsigned int numFree_RefPoc;
#define NUM_READERS_RefPoc 3
#define SIZE_RefPoc SIZE
#define tokens_RefPoc HevcDecoder_Algo_Parser_RefPoc->contents
static unsigned int index_MvPredSyntaxElem;
static unsigned int numFree_MvPredSyntaxElem;
#define NUM_READERS_MvPredSyntaxElem 1
#define SIZE_MvPredSyntaxElem SIZE
#define tokens_MvPredSyntaxElem HevcDecoder_Algo_Parser_MvPredSyntaxElem->contents
static unsigned int index_Cbf;
static unsigned int numFree_Cbf;
#define NUM_READERS_Cbf 1
#define SIZE_Cbf SIZE
#define tokens_Cbf HevcDecoder_Algo_Parser_Cbf->contents
static unsigned int index_DBFDisable;
static unsigned int numFree_DBFDisable;
#define NUM_READERS_DBFDisable 1
#define SIZE_DBFDisable SIZE
#define tokens_DBFDisable HevcDecoder_Algo_Parser_DBFDisable->contents
static unsigned int index_DbfSe;
static unsigned int numFree_DbfSe;
#define NUM_READERS_DbfSe 1
#define SIZE_DbfSe SIZE
#define tokens_DbfSe HevcDecoder_Algo_Parser_DbfSe->contents
static unsigned int index_ReorderPics;
static unsigned int numFree_ReorderPics;
#define NUM_READERS_ReorderPics 1
#define SIZE_ReorderPics SIZE
#define tokens_ReorderPics HevcDecoder_Algo_Parser_ReorderPics->contents
static unsigned int index_WeightedPred;
static unsigned int numFree_WeightedPred;
#define NUM_READERS_WeightedPred 1
#define SIZE_WeightedPred 16384
#define tokens_WeightedPred HevcDecoder_Algo_Parser_WeightedPred->contents
static unsigned int index_Qp;
static unsigned int numFree_Qp;
#define NUM_READERS_Qp 1
#define SIZE_Qp SIZE
#define tokens_Qp HevcDecoder_Algo_Parser_Qp->contents
////////////////////////////////////////////////////////////////////////////////
// Successors
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_InterPrediction;
extern actor_t HevcDecoder_SelectCU;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_SAO;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_SAO;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_SelectCU;
extern actor_t HevcDecoder_InterPrediction;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_SAO;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
extern actor_t HevcDecoder_DecodingPictureBuffer;
extern actor_t HevcDecoder_SAO;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_DecodingPictureBuffer;
extern actor_t HevcDecoder_SAO;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
extern actor_t HevcDecoder_DecodingPictureBuffer;
extern actor_t HevcDecoder_InterPrediction;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_SAO;
extern actor_t check_MD5_compute;
extern actor_t HevcDecoder_InterPrediction;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_xIT_IT_Splitter;
extern actor_t HevcDecoder_xIT_IT_Merger;
extern actor_t HevcDecoder_xIT_Block_Merger;
extern actor_t HevcDecoder_xIT_IT_Splitter;
extern actor_t HevcDecoder_IntraPrediction;
extern actor_t display;
extern actor_t display;
extern actor_t check_MD5_MD5SplitInfo;
extern actor_t HevcDecoder_generateInfo_GenerateRefList;
extern actor_t HevcDecoder_generateInfo_GenerateRefList;
extern actor_t HevcDecoder_DecodingPictureBuffer;
extern actor_t HevcDecoder_generateInfo_GenerateRefList;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_generateInfo_MvComponentPred;
extern actor_t HevcDecoder_DBFilter_GenerateBs;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
extern actor_t HevcDecoder_DecodingPictureBuffer;
extern actor_t HevcDecoder_InterPrediction;
extern actor_t HevcDecoder_DBFilter_DeblockFilt;
////////////////////////////////////////////////////////////////////////////////
// Parameter values of the instance
#define TILE_INDEX 0
#define TILE_SPLIT_ENABLE 0
////////////////////////////////////////////////////////////////////////////////
// State variables of the actor
#define HevcDecoder_Algo_Parser_NAL_BLA_W_LP 16
#define HevcDecoder_Algo_Parser_NAL_BLA_W_RADL 17
#define HevcDecoder_Algo_Parser_NAL_BLA_N_LP 18
#define HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS 0
#define HevcDecoder_Algo_Parser_USED 67
#define HevcDecoder_Algo_Parser_ST_CURR_BEF 0
#define HevcDecoder_Algo_Parser_DELTAPOC 3
#define HevcDecoder_Algo_Parser_ST_FOLL 2
#define HevcDecoder_Algo_Parser_NUM_PICS 2
#define HevcDecoder_Algo_Parser_ST_CURR_AFT 1
#define HevcDecoder_Algo_Parser_LT_CURR 3
#define HevcDecoder_Algo_Parser_LT_FOLL 4
#define HevcDecoder_Algo_Parser_FIFO_CPT_BITS 8
#define HevcDecoder_Algo_Parser_FIFO_SIZE 8
#define HevcDecoder_Algo_Parser_FIFO_IDX 9
#define HevcDecoder_Algo_Parser_EPR_VALUE 3
#define HevcDecoder_Algo_Parser_START_CODE_VALUE 1
#define HevcDecoder_Algo_Parser_START_CODE_FLAG 256
#define HevcDecoder_Algo_Parser_DEBUG_BITSTREAM 0
#define HevcDecoder_Algo_Parser_FIFO_DEPTH 9
#define HevcDecoder_Algo_Parser_DEBUG_PARSER 0
#define HevcDecoder_Algo_Parser_NAL_VPS 32
#define HevcDecoder_Algo_Parser_NAL_SEI_PREFIX 39
#define HevcDecoder_Algo_Parser_NAL_SEI_SUFFIX 40
#define HevcDecoder_Algo_Parser_NAL_SPS 33
#define HevcDecoder_Algo_Parser_NAL_PPS 34
#define HevcDecoder_Algo_Parser_NAL_TRAIL_R 0
#define HevcDecoder_Algo_Parser_NAL_TSA_N 2
#define HevcDecoder_Algo_Parser_NAL_TSA_R 3
#define HevcDecoder_Algo_Parser_NAL_TRAIL_N 1
#define HevcDecoder_Algo_Parser_NAL_STSA_N 4
#define HevcDecoder_Algo_Parser_NAL_STSA_R 5
#define HevcDecoder_Algo_Parser_NAL_RADL_N 6
#define HevcDecoder_Algo_Parser_NAL_RADL_R 7
#define HevcDecoder_Algo_Parser_NAL_RASL_N 8
#define HevcDecoder_Algo_Parser_NAL_RASL_R 9
#define HevcDecoder_Algo_Parser_NAL_IDR_N_LP 20
#define HevcDecoder_Algo_Parser_NAL_IDR_W_DLP 19
#define HevcDecoder_Algo_Parser_NAL_CRA_NUT 21
static const u8 HevcDecoder_Algo_Parser_default_scaling_list_intra[64] = {16, 16, 16, 16, 17, 18, 21, 24, 16, 16, 16, 16, 17, 19, 22, 25, 16, 16, 17, 18, 20, 22, 25, 29, 16, 16, 18, 21, 24, 27, 31, 36, 17, 17, 20, 24, 30, 35, 41, 47, 18, 19, 22, 27, 35, 44, 54, 65, 21, 22, 25, 31, 41, 54, 70, 88, 24, 25, 29, 36, 47, 65, 88, 115};
static const u8 HevcDecoder_Algo_Parser_default_scaling_list_inter[64] = {16, 16, 16, 16, 17, 18, 20, 24, 16, 16, 16, 17, 18, 20, 24, 25, 16, 16, 17, 18, 20, 24, 25, 28, 16, 17, 18, 20, 24, 25, 28, 33, 17, 18, 20, 24, 25, 28, 33, 41, 18, 20, 24, 25, 28, 33, 41, 54, 20, 24, 25, 28, 33, 41, 54, 71, 24, 25, 28, 33, 41, 54, 71, 91};
static const i8 HevcDecoder_Algo_Parser_hevc_diag_scan4x4_y[16] = {0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 3, 2, 3};
static const u8 HevcDecoder_Algo_Parser_hevc_diag_scan4x4_x[16] = {0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 1, 2, 3, 2, 3, 3};
static const i8 HevcDecoder_Algo_Parser_hevc_diag_scan8x8_y[64] = {0, 1, 0, 2, 1, 0, 3, 2, 1, 0, 4, 3, 2, 1, 0, 5, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 7, 6, 5, 4, 7, 6, 5, 7, 6, 7};
static const i8 HevcDecoder_Algo_Parser_hevc_diag_scan8x8_x[64] = {0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 5, 6, 7, 6, 7, 7};
#define HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS 1
#define HevcDecoder_Algo_Parser_PICT_WIDTH 4096
#define HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y 8
#define HevcDecoder_Algo_Parser_PICT_HEIGHT 2048
static const u8 HevcDecoder_Algo_Parser_log2_tab[256] = {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
#define HevcDecoder_Algo_Parser_PART_MODE_PICT 8
#define HevcDecoder_Algo_Parser_PART_MODE_SLICE_INDEP 10
#define HevcDecoder_Algo_Parser_PART_MODE_SLICE_DEP 9
#define HevcDecoder_Algo_Parser_PC_RPS_STRUCT_SIZE 131
#define HevcDecoder_Algo_Parser_P_SLICE 1
#define HevcDecoder_Algo_Parser_B_SLICE 0
#define HevcDecoder_Algo_Parser_DEBUG_CABAC 0
#define HevcDecoder_Algo_Parser_CHECK_CABAC 0
#define HevcDecoder_Algo_Parser_INTRA_DC 1
#define HevcDecoder_Algo_Parser_CTB_ADDR_TS_MAX 4096
#define HevcDecoder_Algo_Parser_NB_MAX_SE 30
#define HevcDecoder_Algo_Parser_NB_MAX_NUM_CTX 48
static const u8 HevcDecoder_Algo_Parser_NUM_SE_CONTEXT_INDEX[30] = {1, 1, 1, 3, 1, 3, 3, 1, 4, 1, 1, 1, 1, 5, 2, 2, 2, 2, 1, 1, 3, 5, 5, 30, 30, 4, 42, 24, 6, 2};
static const u8 HevcDecoder_Algo_Parser_InitContextIndex[30][3][48] = {{{0}, {0}, {0}}, {{153}, {153}, {153}}, {{160}, {185}, {200}}, {{107, 139, 126}, {107, 139, 126}, {139, 141, 157}}, {{154}, {154}, {154}}, {{197, 185, 201}, {197, 185, 201}, {154, 154, 154}}, {{154, 154, 154}, {154, 154, 154}, {154, 154, 154}}, {{134}, {149}, {154}}, {{154, 139, 154, 154}, {154, 139, 154, 154}, {184, 154, 154, 154}}, {{183}, {154}, {184}}, {{152}, {152}, {63}}, {{154}, {110}, {154}}, {{137}, {122}, {154}}, {{95, 79, 63, 31, 31}, {95, 79, 63, 31, 31}, {154, 154, 154, 154, 154}}, {{153, 153}, {153, 153}, {154, 154}}, {{153, 153}, {153, 153}, {154, 154}}, {{169, 198}, {140, 198}, {154, 154}}, {{169, 198}, {140, 198}, {154, 154}}, {{168}, {168}, {154}}, {{79}, {79}, {154}}, {{224, 167, 122}, {124, 138, 94}, {153, 138, 138}}, {{153, 111, 154, 154, 154}, {153, 111, 154, 154, 154}, {111, 141, 154, 154, 154}}, {{149, 92, 167, 154, 154}, {149, 107, 167, 154, 154}, {94, 138, 182, 154, 154}}, {{125, 110, 124, 110, 95, 94, 125, 111, 111, 79, 125, 126, 111, 111, 79, 108, 123, 93, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}, {125, 110, 94, 110, 95, 79, 125, 111, 110, 78, 110, 111, 111, 95, 94, 108, 123, 108, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}, {110, 110, 124, 125, 140, 153, 125, 127, 140, 109, 111, 143, 127, 111, 79, 108, 123, 63, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}}, {{125, 110, 124, 110, 95, 94, 125, 111, 111, 79, 125, 126, 111, 111, 79, 108, 123, 93, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}, {125, 110, 94, 110, 95, 79, 125, 111, 110, 78, 110, 111, 111, 95, 94, 108, 123, 108, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}, {110, 110, 124, 125, 140, 153, 125, 127, 140, 109, 111, 143, 127, 111, 79, 108, 123, 63, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154}}, {{121, 140, 61, 154}, {121, 140, 61, 154}, {91, 171, 134, 141}}, {{170, 154, 139, 153, 139, 123, 123, 63, 124, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 170, 153, 138, 138, 122, 121, 122, 121, 167, 151, 183, 140, 151, 183, 140}, {155, 154, 139, 153, 139, 123, 123, 63, 153, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 166, 183, 140, 136, 153, 154, 170, 153, 123, 123, 107, 121, 107, 121, 167, 151, 183, 140, 151, 183, 140}, {111, 111, 125, 110, 110, 94, 124, 108, 124, 107, 125, 141, 179, 153, 125, 107, 125, 141, 179, 153, 125, 107, 125, 141, 179, 153, 125, 140, 139, 182, 182, 152, 136, 152, 136, 153, 136, 139, 111, 136, 139, 111}}, {{154, 196, 167, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 122, 169, 208, 166, 167, 154, 152, 167, 182}, {154, 196, 196, 167, 154, 152, 167, 182, 182, 134, 149, 136, 153, 121, 136, 137, 169, 194, 166, 167, 154, 167, 137, 182}, {140, 92, 137, 138, 140, 152, 138, 139, 153, 74, 149, 92, 139, 107, 122, 152, 140, 179, 166, 182, 140, 227, 122, 197}}, {{107, 167, 91, 107, 107, 167}, {107, 167, 91, 122, 107, 167}, {138, 153, 136, 167, 152, 152}}, {{139, 139}, {139, 139}, {139, 139}}};
#define HevcDecoder_Algo_Parser_CT_idx 0
#define HevcDecoder_Algo_Parser_CT_x0 1
#define HevcDecoder_Algo_Parser_CT_y0 2
#define HevcDecoder_Algo_Parser_CT_log2CbSize 5
#define HevcDecoder_Algo_Parser_CT_ctDepth 6
#define HevcDecoder_Algo_Parser_NEW_LCU 2
#define HevcDecoder_Algo_Parser_SAO_NO_MERGE 0
static const u16 HevcDecoder_Algo_Parser_rangeTabLPS[64][4] = {{128, 176, 208, 240}, {128, 167, 197, 227}, {128, 158, 187, 216}, {123, 150, 178, 205}, {116, 142, 169, 195}, {111, 135, 160, 185}, {105, 128, 152, 175}, {100, 122, 144, 166}, {95, 116, 137, 158}, {90, 110, 130, 150}, {85, 104, 123, 142}, {81, 99, 117, 135}, {77, 94, 111, 128}, {73, 89, 105, 122}, {69, 85, 100, 116}, {66, 80, 95, 110}, {62, 76, 90, 104}, {59, 72, 86, 99}, {56, 69, 81, 94}, {53, 65, 77, 89}, {51, 62, 73, 85}, {48, 59, 69, 80}, {46, 56, 66, 76}, {43, 53, 63, 72}, {41, 50, 59, 69}, {39, 48, 56, 65}, {37, 45, 54, 62}, {35, 43, 51, 59}, {33, 41, 48, 56}, {32, 39, 46, 53}, {30, 37, 43, 50}, {29, 35, 41, 48}, {27, 33, 39, 45}, {26, 31, 37, 43}, {24, 30, 35, 41}, {23, 28, 33, 39}, {22, 27, 32, 37}, {21, 26, 30, 35}, {20, 24, 29, 33}, {19, 23, 27, 31}, {18, 22, 26, 30}, {17, 21, 25, 28}, {16, 20, 23, 27}, {15, 19, 22, 25}, {14, 18, 21, 24}, {14, 17, 20, 23}, {13, 16, 19, 22}, {12, 15, 18, 21}, {12, 14, 17, 20}, {11, 14, 16, 19}, {11, 13, 15, 18}, {10, 12, 15, 17}, {10, 12, 14, 16}, {9, 11, 13, 15}, {9, 11, 12, 14}, {8, 10, 12, 14}, {8, 9, 11, 13}, {7, 9, 11, 12}, {7, 9, 10, 12}, {7, 8, 10, 11}, {6, 8, 9, 11}, {6, 7, 9, 10}, {6, 7, 8, 9}, {2, 2, 2, 2}};
static const u8 HevcDecoder_Algo_Parser_transIdxLPS[64] = {0, 0, 1, 2, 2, 4, 4, 5, 6, 7, 8, 9, 9, 11, 11, 12, 13, 13, 15, 15, 16, 16, 18, 18, 19, 19, 21, 21, 22, 22, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 30, 30, 31, 32, 32, 33, 33, 33, 34, 34, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 63};
static const u8 HevcDecoder_Algo_Parser_transIdxMPS[64] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 62, 63};
#define HevcDecoder_Algo_Parser_SE_SAO_MERGE_FLAG 1
#define HevcDecoder_Algo_Parser_SAO_MERGE_LEFT 1
#define HevcDecoder_Algo_Parser_SAO_MERGE_UP 2
#define HevcDecoder_Algo_Parser_SAO_NOT_APPLIED 0
#define HevcDecoder_Algo_Parser_SE_SAO_TYPE_IDX 2
#define HevcDecoder_Algo_Parser_SAO_BAND 1
#define HevcDecoder_Algo_Parser_SAO_EDGE 2
#define HevcDecoder_Algo_Parser_DEBIN_TU9 8
#define HevcDecoder_Algo_Parser_DEBUG_TRACE1 0
#define HevcDecoder_Algo_Parser_SE_SPLIT_CODING_UNIT_FLAG 3
#define HevcDecoder_Algo_Parser_CT_x1 3
#define HevcDecoder_Algo_Parser_CT_y1 4
#define HevcDecoder_Algo_Parser_OTHER 16
#define HevcDecoder_Algo_Parser_PART_2Nx2N 0
#define HevcDecoder_Algo_Parser_INTRA 1
#define HevcDecoder_Algo_Parser_SE_CU_TRANSQUANT_BYPASS_FLAG 4
#define HevcDecoder_Algo_Parser_I_SLICE 2
#define HevcDecoder_Algo_Parser_SE_SKIP_FLAG 5
#define HevcDecoder_Algo_Parser_SKIP 2
#define HevcDecoder_Algo_Parser_INTER 0
#define HevcDecoder_Algo_Parser_PART_NxN 3
#define HevcDecoder_Algo_Parser_TEXT_LUMA 0
#define HevcDecoder_Algo_Parser_TEXT_CHROMA_U 1
#define HevcDecoder_Algo_Parser_TEXT_CHROMA_V 2
#define HevcDecoder_Algo_Parser_SE_PRED_MODE_FLAG 7
#define HevcDecoder_Algo_Parser_SE_PART_MODE 8
#define HevcDecoder_Algo_Parser_PART_2NxN 1
#define HevcDecoder_Algo_Parser_PART_Nx2N 2
#define HevcDecoder_Algo_Parser_PART_2NxnD 5
#define HevcDecoder_Algo_Parser_PART_2NxnU 4
#define HevcDecoder_Algo_Parser_PART_nRx2N 7
#define HevcDecoder_Algo_Parser_PART_nLx2N 6
#define HevcDecoder_Algo_Parser_SE_PREV_INTRA_LUMA_PRED_FLAG 9
#define HevcDecoder_Algo_Parser_DEBIN_TU2 1
#define HevcDecoder_Algo_Parser_INTRA_PLANAR 0
#define HevcDecoder_Algo_Parser_INTRA_ANGULAR_26 26
#define HevcDecoder_Algo_Parser_SE_INTRA_CHROMA_PRED_MODE 10
static const u8 HevcDecoder_Algo_Parser_partModeToNumPart[8] = {1, 2, 2, 4, 2, 2, 2, 2};
#define HevcDecoder_Algo_Parser_SE_NO_RESIDUAL_SYNTAX_FLAG 19
#define HevcDecoder_Algo_Parser_TT_idx 0
#define HevcDecoder_Algo_Parser_TT_x0 1
#define HevcDecoder_Algo_Parser_TT_y0 2
#define HevcDecoder_Algo_Parser_TT_xBase 5
#define HevcDecoder_Algo_Parser_TT_yBase 6
#define HevcDecoder_Algo_Parser_TT_log2TrafoSize 7
#define HevcDecoder_Algo_Parser_TT_trafoDepth 8
#define HevcDecoder_Algo_Parser_TT_blkIdx 9
#define HevcDecoder_Algo_Parser_PRED_L0 0
#define HevcDecoder_Algo_Parser_SE_MERGE_IDX 12
#define HevcDecoder_Algo_Parser_SE_MERGE_FLAG 11
#define HevcDecoder_Algo_Parser_SE_INTER_PRED_IDC 13
#define HevcDecoder_Algo_Parser_BI_PRED 2
#define HevcDecoder_Algo_Parser_PRED_L1 1
#define HevcDecoder_Algo_Parser_SE_REF_IDX_L0 14
#define HevcDecoder_Algo_Parser_SE_MVP_LX_FLAG 18
#define HevcDecoder_Algo_Parser_SE_ABS_MVD_GREATER0_FLAG 16
#define HevcDecoder_Algo_Parser_SE_SPLIT_TRANSFORM_FLAG 20
#define HevcDecoder_Algo_Parser_SE_CBF_CB_CR 22
#define HevcDecoder_Algo_Parser_TT_x1 3
#define HevcDecoder_Algo_Parser_TT_y1 4
#define HevcDecoder_Algo_Parser_SE_CBF_LUMA 21
#define HevcDecoder_Algo_Parser_SE_CU_QP_DELTA 6
#define HevcDecoder_Algo_Parser_DEBIN_TU5 4
#define HevcDecoder_Algo_Parser_SCAN_VER 2
#define HevcDecoder_Algo_Parser_SCAN_HOR 1
#define HevcDecoder_Algo_Parser_SCAN_ZIGZAG 0
static const u8 HevcDecoder_Algo_Parser_rem6[64] = {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3};
static const u8 HevcDecoder_Algo_Parser_div6[64] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10};
#define HevcDecoder_Algo_Parser_SE_TRANSFORM_SKIP_FLAG 29
#define HevcDecoder_Algo_Parser_SE_LAST_SIGNIFICANT_COEFF_X_PREFIX 23
#define HevcDecoder_Algo_Parser_SE_LAST_SIGNIFICANT_COEFF_Y_PREFIX 24
static const u8 HevcDecoder_Algo_Parser_diag_scan4x4_inv[4][4] = {{0, 2, 5, 9}, {1, 4, 8, 12}, {3, 7, 11, 14}, {6, 10, 13, 15}};
static const u8 HevcDecoder_Algo_Parser_diag_scan2x2_inv[2][2] = {{0, 2}, {1, 3}};
static const u8 HevcDecoder_Algo_Parser_diag_scan8x8_inv[8][8] = {{0, 2, 5, 9, 14, 20, 27, 35}, {1, 4, 8, 13, 19, 26, 34, 42}, {3, 7, 12, 18, 25, 33, 41, 48}, {6, 11, 17, 24, 32, 40, 47, 53}, {10, 16, 23, 31, 39, 46, 52, 57}, {15, 22, 30, 38, 45, 51, 56, 60}, {21, 29, 37, 44, 50, 55, 59, 62}, {28, 36, 43, 49, 54, 58, 61, 63}};
static const u8 HevcDecoder_Algo_Parser_horiz_scan8x8_inv[8][8] = {{0, 1, 2, 3, 16, 17, 18, 19}, {4, 5, 6, 7, 20, 21, 22, 23}, {8, 9, 10, 11, 24, 25, 26, 27}, {12, 13, 14, 15, 28, 29, 30, 31}, {32, 33, 34, 35, 48, 49, 50, 51}, {36, 37, 38, 39, 52, 53, 54, 55}, {40, 41, 42, 43, 56, 57, 58, 59}, {44, 45, 46, 47, 60, 61, 62, 63}};
#define HevcDecoder_Algo_Parser_SE_CODED_SUB_BLOCK_FLAG 25
static const u8 HevcDecoder_Algo_Parser_ctxInMap[16] = {0, 1, 4, 5, 2, 3, 4, 5, 6, 6, 8, 8, 7, 7, 8, 8};
#define HevcDecoder_Algo_Parser_SE_SIGNIFICANT_COEFF_FLAG 26
#define HevcDecoder_Algo_Parser_SE_COEFF_ABS_LEVEL_GREATER1_FLAG 27
#define HevcDecoder_Algo_Parser_SE_COEFF_ABS_LEVEL_GREATER2_FLAG 28
static u16 fifo[10];
static u8 zeroByte = 0;
static u16 se_idx;
static u32 cnt_i;
static u16 sps_id;
static u16 pps_id;
static u8 localizeAEB = 0;
#define NUM_ENTRY_MAX 64
static u32 entryOffsetsTab[64];
static i32 byPassFlag = 0;
static u8 TilesInfo[2];
static u32 counterByte = 0;
static u32 temporal_id = 0;
static u8 nal_unit_type;
static u8 vps_max_sub_layers_minus1;
static u8 vps_max_nuh_reserved_zero_layer_id;
static u8 vps_timing_info_present_flag;
static u16 vps_num_op_sets_minus1;
static u16 vps_num_hrd_parameters;
static u8 video_sequence_id = 0;
static i32 profile_present_flag = 1;
static i32 sub_layer_profile_present_flag;
static i32 sub_layer_level_present_flag;
static u16 sei_payloadType;
static u16 sei_payloadSize;
static u16 sei_payloadPosition;
static u8 sei_idx;
static u8 sei_cIdx;
static u8 sei_i;
static u8 sei_hash_type;
static u8 sps_max_sub_layers_minus1[15];
static u16 sps_pic_width_in_luma_samples[15];
static u16 sps_pic_height_in_luma_samples[15];
static u8 sps_separate_colour_plane_flag[15];
static u8 sps_chroma_format_idc[15];
static i32 sps_sub_layer_level_present_flag = 0;
static i32 sps_profile_present_flag = 1;
static i32 sps_sub_layer_profile_present_flag = 0;
static u8 sps_log2_max_pic_order_cnt_lsb_minus4[15];
static u32 max_poc_lsb[15];
static i32 sps_bit_depth_luma_minus8[15];
static i32 sps_bit_depth_chroma_minus8[15];
static u32 sps_num_reorder_pics[15];
static u8 sps_log2_min_coding_block_size[15];
static u8 sps_log2_min_pu_size[15];
static u8 sps_min_pu_width[15];
static u8 sps_log2_diff_max_min_coding_block_size[15];
static u8 sps_log2_min_transform_block_size[15];
static u8 sps_log2_diff_max_min_transform_block_size[15];
static u16 sps_maxCUWidth[15];
static u16 sps_addCUDepth[15];
static u8 sps_max_transform_hierarchy_depth_inter[15];
static u8 sps_max_transform_hierarchy_depth_intra[15];
static u8 sps_scaling_list_enabled_flag[15];
static u16 sps_ctb_width[15];
static u16 sps_ctb_height[15];
static u16 sps_log2_ctb_size[15];
static i32 min_cb_width;
static u8 sps_sample_adaptive_offset_enabled_flag[15];
static u8 sps_num_short_term_ref_pic_sets[15];
static u8 sps_pcm_enabled_flag[15];
static u8 amp_enabled_flag;
static u8 sps_sl[15][4][6][64];
static u8 sps_sl_dc[15][2][6];
static i32 sps_size_id = 0;
static i32 sps_size_id_matrixCase;
static i32 sps_matrix_id = 0;
static i32 sps_coef_num = 0;
static i32 sps_pos;
static i32 sps_scaling_list_delta_coef;
static i32 sps_next_coef;
static u32 log2_min_pcm_cb_size[15];
static u32 log2_max_pcm_cb_size[15];
static u32 pcm_bit_depth[15];
static u32 pcm_bit_depth_chroma[15];
static u32 pcm_loop_filter_disable_flag[15];
static i8 pcRPS[15][65][131];
static u8 sps_long_term_ref_pics_present_flag[15];
static u8 sps_temporal_mvp_enable_flag[15];
static i32 sps_strong_intra_smoothing_enable_flag[15];
static u8 sps_num_long_term_ref_pics_sps[15];
static u16 lt_ref_pic_poc_lsb_sps[32];
static u8 used_by_curr_pic_lt_sps_flag[32];
static u8 pps_sps_id[15];
static u8 pps_tiles_enabled_flag[15];
static u8 pps_dependent_slice_segments_enabled_flag[15];
static u8 pps_output_flag_present_flag[15];
static u8 pps_num_extra_slice_header_bits[15];
static u8 pps_sign_data_hiding_flag[15];
static u8 pps_cabac_init_present_flag[15];
static u8 pps_num_ref_idx_l0_default_active_minus1[15];
static u8 pps_num_ref_idx_l1_default_active_minus1[15];
static i32 pps_init_qp_minus26[15];
static u8 pps_transform_skip_enabled_flag[15];
static i32 pps_constrained_intra_pred_flag[15];
static u8 pps_cu_qp_delta_enabled_flag[15];
static u16 pps_diff_cu_qp_delta_depth[15];
static i8 pps_cb_qp_offset[15];
static i8 pps_cr_qp_offset[15];
static u8 pps_slice_chroma_qp_offsets_present_flag[15];
static u8 pps_weighted_pred_flag[15];
static u8 pps_weighted_bipred_flag[15];
static u8 pps_transquant_bypass_enable_flag[15];
static u8 pps_entropy_coding_sync_enabled_flag[15];
static u8 pps_num_tile_columns_minus1[15];
static u8 pps_num_tile_rows_minus1[15];
static u8 pps_uniform_spacing_flag[15];
static u16 pps_column_width[15][512];
static u16 pps_row_height[15][256];
static u8 pps_scaling_list_data_present_flag[15];
static i32 sum = 0;
static u8 pps_deblocking_filter_control_present_flag[15];
static u8 deblocking_filter_override_enabled_flag[15];
static u8 pps_loop_filter_across_slice_enabled_flag[15];
static u8 pps_lists_modification_present_flag[15];
static u8 pps_slice_segment_header_extension_present_flag[15];
static u8 pps_disable_deblocking_filter_flag[15];
static u8 pps_beta_offset[15];
static u8 pps_tc_offset[15];
static u8 pps_log2_parallel_merge_level[15];
static u8 pps_sl[15][4][6][64];
static u8 pps_sl_dc[15][2][6];
static i32 pps_matrix_id = 0;
static i32 pps_size_id = 0;
static i32 pps_next_coef;
static i32 pps_coef_num;
static i32 pps_scaling_list_delta_coef;
static i32 pps_pos;
static i32 pps_size_id_matrixCase;
static u8 Log2CtbSize;
static u8 Log2MinCbSize;
static u16 PicWidthInCtbsY;
static u16 PicHeightInCtbsY;
static u16 PicSizeInCtbsY;
static u8 slice_temporal_mvp_enable_flag;
static i32 poc;
static u8 slice_type;
static u32 slice_segment_address;
static u8 slice_sample_adaptive_offset_flag[4];
static u8 first_slice_segment_in_pic_flag = 1;
static u8 dependent_slice_segment_flag;
static u16 pictSize[2];
static u16 num_long_term_sps = 0;
static u16 num_long_term_pics = 0;
static u8 poc_lsb_lt[32];
static u8 UsedByCurrPicLt[32];
static u8 DeltaPocMsbCycleLt[32];
static u8 delta_poc_msb_present_flag[32];
static i32 pic_order_cnt_lsb;
static u16 pictOrTileSize[2] = {0, 0};
static u32 rowIndex = 0;
static u32 colIndex = 0;
static u16 prevTileCoord[2] = {0, 0};
static u32 prevRowIndex = 0;
static u32 prevColIndex = 0;
static u32 slice_addr = 0;
static i32 slice_idx = 0;
static i32 idx = 0;
static u32 no_output_of_prior_pics_flag;
static u32 pic_output_flag;
static u8 short_term_ref_pic_set_sps_flag;
static i32 prev;
static u8 num_ref_idx_l0_active;
static u8 num_ref_idx_l1_active;
static u8 mvd_l1_zero_flag;
static u8 ref_pic_list_modification_flag_lx[2] = {0, 0};
static u8 list_entry_lx[2][32];
static i16 pocTables[5][64];
static i32 numPic[5];
static u8 idxNumPic;
static u8 idxRefPoc;
static i8 slice_qp;
static i8 slice_cb_qp_offset;
static i8 slice_cr_qp_offset;
static u16 MaxNumMergeCand;
static u8 cabac_init_flag;
static u8 collocated_from_lX = 0;
static u8 collocated_ref_idx = 0;
static u8 luma_weight_l0_flag[16];
static u8 chroma_weight_l0_flag[16];
static i8 delta_luma_weight_l0;
static i8 luma_offset_l0;
static i8 delta_chroma_weight_l00;
static i8 delta_chroma_weight_l01;
static i16 delta_chroma_offset_l00;
static i16 delta_chroma_offset_l01;
static u8 luma_weight_l1_flag[16];
static u8 chroma_weight_l1_flag[16];
static i8 delta_luma_weight_l1;
static i8 luma_offset_l1;
static i8 delta_chroma_weight_l10;
static i8 delta_chroma_weight_l11;
static i16 delta_chroma_offset_l10;
static i16 delta_chroma_offset_l11;
static u16 qp_bd_offset_luma;
static u16 num_entry_point_offsets = 0;
static u16 offset_len;
static u16 slice_segment_header_extension_length;
static u32 num_entry_offsets = 0;
static u32 totalByPass = 0;
static i32 countAEB = 0;
static u16 codIRange[1];
static u16 codIOffset[1];
static u16 ctxTable[30][48];
static u16 ctxTableWPP[30][48];
static u8 sliceData_idx;
static u8 prev_pps_id;
static u8 Log2MinTrafoSize;
static u8 Log2MaxTrafoSize;
static u16 ctbAddrRStoTS[4096];
static u16 ctbAddrTStoRS[4096];
static u16 TileId[4096];
static u16 nbCtbTile[128] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static u16 colTileInPix[128] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static u16 rowTileInPix[128] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static u32 tile_idx = 0;
static u8 skip_flag_tab[4096][2];
static u8 intraPredMode[4096][2];
static u16 colWidth[15][512];
static u16 rowHeight[15][256];
static u32 countRow = 0;
static u32 countCol = 0;
static u32 CtbAddrRS;
static u32 CtbAddrTS;
static u32 end_of_slice_flag;
static i32 counter = 0;
static u16 xCtb;
static u16 yCtb;
static u8 codingTree_idx;
static u8 ctStack_idx;
static u16 ctStack[5][7];
static u8 first_qp_group;
static i32 ctb_left_flag;
static i32 ctb_up_flag;
static i32 ctb_addr_in_slice;
static u8 sao_cIdx;
static u16 sao_rx;
static u16 sao_ry;
static u8 sao_idx;
static i16 sao_typeIdx;
static i16 sao_eo;
static u8 IsCuQpDeltaCoded;
static i16 CuQpDelta;
static u8 ct_log2CbSize;
static u8 cu_idx;
static u16 cu_x0;
static u16 cu_y0;
static u8 cu_log2CbSize;
static u8 cu_ctDepth;
static u8 predMode;
static u8 partMode;
static u8 IntraSplitFlag;
static u8 MaxTrafoDepth;
static u8 cu_transquant_bypass_flag;
static u8 cu_top_ctDepth[4096];
static u8 cu_left_ctDepth[4096];
static u8 skip_flag;
static u8 merge_flag;
static u8 intraChrPredModIdx;
static const u8 intraPredModeC[5][5] = {{34, 0, 0, 0, 0}, {26, 34, 26, 26, 26}, {10, 10, 34, 10, 10}, {1, 1, 1, 34, 1}, {0, 26, 10, 1, 0}};
static i32 qp_block_mask = 0;
static u8 cu_nCbS;
static i32 counterfillSkip = 0;
static i32 QPCounter = 0;
static u8 intra_pred_mode[4];
static u8 intra_pred_mode_c;
static i32 qPy_pred = 0;
static u8 length;
static u8 pu_idx;
static u8 pu_PbW;
static u8 pu_PbH;
static u8 pcm_flag;
static u8 inter_pred_idc;
static i16 mergeIdx;
static i16 mvp_lx[2];
static i16 ref_idx_lx[2];
static i16 mvd[4];
static i32 mvd_x;
static i32 mvd_y;
static u8 abs_mvd_greater1_flag_1;
static u8 abs_mvd_greater0_flag_1;
static u8 pcm_sample_luma[4096];
static u8 pcm_sample_chroma[4096];
static u8 is_pcm[4096];
static i32 pcm_skip_length;
static u8 ttStack_idx;
static u16 ttStack[10][10];
static u8 cbf_cb[32][32][4];
static u8 cbf_cr[32][32][4];
static u8 cbf_luma;
static u8 cur_intra_pred_mode;
static u8 split_transform_flag;
static u16 cbf_xBase;
static u16 cbf_yBase;
static u8 tu_idx;
static u16 tu_x0;
static u16 tu_y0;
static u16 tu_xBase;
static u16 tu_yBase;
static u8 tu_trafoDepth;
static u8 tu_blkIdx;
static u8 tu_log2TrafoSize;
static i8 qp_y_tab[131072];
static u16 rc_x0;
static u16 rc_y0;
static u8 rc_log2TrafoSize;
static u8 rc_scanIdx;
static u8 rc_cIdx;
static u8 ScanOrder[4][3][256][2];
static u8 significant_coeff_flag_idx[16];
static u8 nb_significant_coeff_flag;
static u8 coded_sub_block_flag[8][8];
static u8 LastSignificantCoeffX;
static u8 LastSignificantCoeffY;
static u16 num_coeff;
static u8 rc_lastScanPos;
static i8 rc_lastSubBlock;
static i8 rc_i;
static i16 tabTransCoeffLevel[1024];
static i32 add = 0;
static i32 scale;
static i32 scale_m;
static i32 dc_scale = 0;
static u8 scale_matrix[64];
static u8 shift = 0;
static i8 qp_y = 0;
static i16 qp;
static u16 rc_xS;
static u16 rc_yS;
static i8 m_end;
static u8 rc_ctxSet[1];
static u8 rc_greater1Ctx[1];
static u8 rc_firstSigScanPos;
static i8 rc_firstGreater1ScanPos;
static i8 rc_m;
static u8 coeff_abs_level_greater1_flag[16];
static u8 coeff_abs_level_greater2_flag;
static u16 coeff_sign_flag;
static u8 rc_signHidden;
static u8 rc_numSigCoeff;
static u8 rc_sumAbsLevel;
static u8 rc_cLastRiceParam;
////////////////////////////////////////////////////////////////////////////////
// Initial FSM state of the actor
enum states {
my_state_byte_align,
my_state_find_header,
my_state_read_CodingQuadTree,
my_state_read_CodingTree,
my_state_read_CodingUnit,
my_state_read_MVDCoding,
my_state_read_MVDCoding_end,
my_state_read_Nal_unit_header,
my_state_read_PCMSample,
my_state_read_PCMSampleLoop,
my_state_read_PPS_Header,
my_state_read_PredictionUnit,
my_state_read_ResidualCoding,
my_state_read_ResidualCodingGetCoeff,
my_state_read_ResidualCodingGreater1,
my_state_read_ResidualCodingStart,
my_state_read_SEI_Header,
my_state_read_SPS_Header,
my_state_read_SaoParam,
my_state_read_SliceData,
my_state_read_SliceHeader,
my_state_read_TransformTree,
my_state_read_TransformUnit,
my_state_read_VPS_Header,
my_state_sendQp,
my_state_send_IntraPredMode,
my_state_start_code,
my_state_weightedChroma0,
my_state_weightedChroma0Offset,
my_state_weightedChroma1,
my_state_weightedChroma1Offset,
my_state_weightedDeltaChroma0,
my_state_weightedDeltaChroma1,
my_state_weightedDeltaLuma0,
my_state_weightedDeltaLuma1,
my_state_weightedLuma0,
my_state_weightedLuma1
};
static char *stateNames[] = {
"byte_align",
"find_header",
"read_CodingQuadTree",
"read_CodingTree",
"read_CodingUnit",
"read_MVDCoding",
"read_MVDCoding_end",
"read_Nal_unit_header",
"read_PCMSample",
"read_PCMSampleLoop",
"read_PPS_Header",
"read_PredictionUnit",
"read_ResidualCoding",
"read_ResidualCodingGetCoeff",
"read_ResidualCodingGreater1",
"read_ResidualCodingStart",
"read_SEI_Header",
"read_SPS_Header",
"read_SaoParam",
"read_SliceData",
"read_SliceHeader",
"read_TransformTree",
"read_TransformUnit",
"read_VPS_Header",
"sendQp",
"send_IntraPredMode",
"start_code",
"weightedChroma0",
"weightedChroma0Offset",
"weightedChroma1",
"weightedChroma1Offset",
"weightedDeltaChroma0",
"weightedDeltaChroma1",
"weightedDeltaLuma0",
"weightedDeltaLuma1",
"weightedLuma0",
"weightedLuma1"
};
static enum states _FSM_state;
////////////////////////////////////////////////////////////////////////////////
// Token functions
static void read_byte() {
index_byte = HevcDecoder_Algo_Parser_byte->read_inds[0];
numTokens_byte = index_byte + fifo_u8_get_num_tokens(HevcDecoder_Algo_Parser_byte, 0);
}
static void read_end_byte() {
HevcDecoder_Algo_Parser_byte->read_inds[0] = index_byte;
}
static void write_CUInfo() {
index_CUInfo = HevcDecoder_Algo_Parser_CUInfo->write_ind;
numFree_CUInfo = index_CUInfo + fifo_u16_get_room(HevcDecoder_Algo_Parser_CUInfo, NUM_READERS_CUInfo, SIZE_CUInfo);
}
static void write_end_CUInfo() {
HevcDecoder_Algo_Parser_CUInfo->write_ind = index_CUInfo;
}
static void write_IntraPredMode() {
index_IntraPredMode = HevcDecoder_Algo_Parser_IntraPredMode->write_ind;
numFree_IntraPredMode = index_IntraPredMode + fifo_u8_get_room(HevcDecoder_Algo_Parser_IntraPredMode, NUM_READERS_IntraPredMode, SIZE_IntraPredMode);
}
static void write_end_IntraPredMode() {
HevcDecoder_Algo_Parser_IntraPredMode->write_ind = index_IntraPredMode;
}
static void write_SliceAddr() {
index_SliceAddr = HevcDecoder_Algo_Parser_SliceAddr->write_ind;
numFree_SliceAddr = index_SliceAddr + fifo_u16_get_room(HevcDecoder_Algo_Parser_SliceAddr, NUM_READERS_SliceAddr, SIZE_SliceAddr);
}
static void write_end_SliceAddr() {
HevcDecoder_Algo_Parser_SliceAddr->write_ind = index_SliceAddr;
}
static void write_TilesCoord() {
index_TilesCoord = HevcDecoder_Algo_Parser_TilesCoord->write_ind;
numFree_TilesCoord = index_TilesCoord + fifo_u16_get_room(HevcDecoder_Algo_Parser_TilesCoord, NUM_READERS_TilesCoord, SIZE_TilesCoord);
}
static void write_end_TilesCoord() {
HevcDecoder_Algo_Parser_TilesCoord->write_ind = index_TilesCoord;
}
static void write_LcuSizeMax() {
index_LcuSizeMax = HevcDecoder_Algo_Parser_LcuSizeMax->write_ind;
numFree_LcuSizeMax = index_LcuSizeMax + fifo_u8_get_room(HevcDecoder_Algo_Parser_LcuSizeMax, NUM_READERS_LcuSizeMax, SIZE_LcuSizeMax);
}
static void write_end_LcuSizeMax() {
HevcDecoder_Algo_Parser_LcuSizeMax->write_ind = index_LcuSizeMax;
}
static void write_PartMode() {
index_PartMode = HevcDecoder_Algo_Parser_PartMode->write_ind;
numFree_PartMode = index_PartMode + fifo_u8_get_room(HevcDecoder_Algo_Parser_PartMode, NUM_READERS_PartMode, SIZE_PartMode);
}
static void write_end_PartMode() {
HevcDecoder_Algo_Parser_PartMode->write_ind = index_PartMode;
}
static void write_IsPicSlcLcu() {
index_IsPicSlcLcu = HevcDecoder_Algo_Parser_IsPicSlcLcu->write_ind;
numFree_IsPicSlcLcu = index_IsPicSlcLcu + fifo_u8_get_room(HevcDecoder_Algo_Parser_IsPicSlcLcu, NUM_READERS_IsPicSlcLcu, SIZE_IsPicSlcLcu);
}
static void write_end_IsPicSlcLcu() {
HevcDecoder_Algo_Parser_IsPicSlcLcu->write_ind = index_IsPicSlcLcu;
}
static void write_IsPicSlc() {
index_IsPicSlc = HevcDecoder_Algo_Parser_IsPicSlc->write_ind;
numFree_IsPicSlc = index_IsPicSlc + fifo_u8_get_room(HevcDecoder_Algo_Parser_IsPicSlc, NUM_READERS_IsPicSlc, SIZE_IsPicSlc);
}
static void write_end_IsPicSlc() {
HevcDecoder_Algo_Parser_IsPicSlc->write_ind = index_IsPicSlc;
}
static void write_LFAcrossSlcTile() {
index_LFAcrossSlcTile = HevcDecoder_Algo_Parser_LFAcrossSlcTile->write_ind;
numFree_LFAcrossSlcTile = index_LFAcrossSlcTile + fifo_u8_get_room(HevcDecoder_Algo_Parser_LFAcrossSlcTile, NUM_READERS_LFAcrossSlcTile, SIZE_LFAcrossSlcTile);
}
static void write_end_LFAcrossSlcTile() {
HevcDecoder_Algo_Parser_LFAcrossSlcTile->write_ind = index_LFAcrossSlcTile;
}
static void write_PictSize() {
index_PictSize = HevcDecoder_Algo_Parser_PictSize->write_ind;
numFree_PictSize = index_PictSize + fifo_u16_get_room(HevcDecoder_Algo_Parser_PictSize, NUM_READERS_PictSize, SIZE_PictSize);
}
static void write_end_PictSize() {
HevcDecoder_Algo_Parser_PictSize->write_ind = index_PictSize;
}
static void write_Poc() {
index_Poc = HevcDecoder_Algo_Parser_Poc->write_ind;
numFree_Poc = index_Poc + fifo_i16_get_room(HevcDecoder_Algo_Parser_Poc, NUM_READERS_Poc, SIZE_Poc);
}
static void write_end_Poc() {
HevcDecoder_Algo_Parser_Poc->write_ind = index_Poc;
}
static void write_SaoSe() {
index_SaoSe = HevcDecoder_Algo_Parser_SaoSe->write_ind;
numFree_SaoSe = index_SaoSe + fifo_i16_get_room(HevcDecoder_Algo_Parser_SaoSe, NUM_READERS_SaoSe, SIZE_SaoSe);
}
static void write_end_SaoSe() {
HevcDecoder_Algo_Parser_SaoSe->write_ind = index_SaoSe;
}
static void write_SEI_MD5() {
index_SEI_MD5 = HevcDecoder_Algo_Parser_SEI_MD5->write_ind;
numFree_SEI_MD5 = index_SEI_MD5 + fifo_u8_get_room(HevcDecoder_Algo_Parser_SEI_MD5, NUM_READERS_SEI_MD5, SIZE_SEI_MD5);
}
static void write_end_SEI_MD5() {
HevcDecoder_Algo_Parser_SEI_MD5->write_ind = index_SEI_MD5;
}
static void write_SliceType() {
index_SliceType = HevcDecoder_Algo_Parser_SliceType->write_ind;
numFree_SliceType = index_SliceType + fifo_u8_get_room(HevcDecoder_Algo_Parser_SliceType, NUM_READERS_SliceType, SIZE_SliceType);
}
static void write_end_SliceType() {
HevcDecoder_Algo_Parser_SliceType->write_ind = index_SliceType;
}
static void write_SplitTransform() {
index_SplitTransform = HevcDecoder_Algo_Parser_SplitTransform->write_ind;
numFree_SplitTransform = index_SplitTransform + fifo_i32_get_room(HevcDecoder_Algo_Parser_SplitTransform, NUM_READERS_SplitTransform, SIZE_SplitTransform);
}
static void write_end_SplitTransform() {
HevcDecoder_Algo_Parser_SplitTransform->write_ind = index_SplitTransform;
}
static void write_TUSize() {
index_TUSize = HevcDecoder_Algo_Parser_TUSize->write_ind;
numFree_TUSize = index_TUSize + fifo_i8_get_room(HevcDecoder_Algo_Parser_TUSize, NUM_READERS_TUSize, SIZE_TUSize);
}
static void write_end_TUSize() {
HevcDecoder_Algo_Parser_TUSize->write_ind = index_TUSize;
}
static void write_Coeff() {
index_Coeff = HevcDecoder_Algo_Parser_Coeff->write_ind;
numFree_Coeff = index_Coeff + fifo_i16_get_room(HevcDecoder_Algo_Parser_Coeff, NUM_READERS_Coeff, SIZE_Coeff);
}
static void write_end_Coeff() {
HevcDecoder_Algo_Parser_Coeff->write_ind = index_Coeff;
}
static void write_StrongIntraSmoothing() {
index_StrongIntraSmoothing = HevcDecoder_Algo_Parser_StrongIntraSmoothing->write_ind;
numFree_StrongIntraSmoothing = index_StrongIntraSmoothing + fifo_i32_get_room(HevcDecoder_Algo_Parser_StrongIntraSmoothing, NUM_READERS_StrongIntraSmoothing, SIZE_StrongIntraSmoothing);
}
static void write_end_StrongIntraSmoothing() {
HevcDecoder_Algo_Parser_StrongIntraSmoothing->write_ind = index_StrongIntraSmoothing;
}
static void write_DispCoord() {
index_DispCoord = HevcDecoder_Algo_Parser_DispCoord->write_ind;
numFree_DispCoord = index_DispCoord + fifo_u16_get_room(HevcDecoder_Algo_Parser_DispCoord, NUM_READERS_DispCoord, SIZE_DispCoord);
}
static void write_end_DispCoord() {
HevcDecoder_Algo_Parser_DispCoord->write_ind = index_DispCoord;
}
static void write_PicSizeInMb() {
index_PicSizeInMb = HevcDecoder_Algo_Parser_PicSizeInMb->write_ind;
numFree_PicSizeInMb = index_PicSizeInMb + fifo_u16_get_room(HevcDecoder_Algo_Parser_PicSizeInMb, NUM_READERS_PicSizeInMb, SIZE_PicSizeInMb);
}
static void write_end_PicSizeInMb() {
HevcDecoder_Algo_Parser_PicSizeInMb->write_ind = index_PicSizeInMb;
}
static void write_NumRefIdxLxActive() {
index_NumRefIdxLxActive = HevcDecoder_Algo_Parser_NumRefIdxLxActive->write_ind;
numFree_NumRefIdxLxActive = index_NumRefIdxLxActive + fifo_u8_get_room(HevcDecoder_Algo_Parser_NumRefIdxLxActive, NUM_READERS_NumRefIdxLxActive, SIZE_NumRefIdxLxActive);
}
static void write_end_NumRefIdxLxActive() {
HevcDecoder_Algo_Parser_NumRefIdxLxActive->write_ind = index_NumRefIdxLxActive;
}
static void write_RefPicListModif() {
index_RefPicListModif = HevcDecoder_Algo_Parser_RefPicListModif->write_ind;
numFree_RefPicListModif = index_RefPicListModif + fifo_u8_get_room(HevcDecoder_Algo_Parser_RefPicListModif, NUM_READERS_RefPicListModif, SIZE_RefPicListModif);
}
static void write_end_RefPicListModif() {
HevcDecoder_Algo_Parser_RefPicListModif->write_ind = index_RefPicListModif;
}
static void write_RefPoc() {
index_RefPoc = HevcDecoder_Algo_Parser_RefPoc->write_ind;
numFree_RefPoc = index_RefPoc + fifo_i16_get_room(HevcDecoder_Algo_Parser_RefPoc, NUM_READERS_RefPoc, SIZE_RefPoc);
}
static void write_end_RefPoc() {
HevcDecoder_Algo_Parser_RefPoc->write_ind = index_RefPoc;
}
static void write_MvPredSyntaxElem() {
index_MvPredSyntaxElem = HevcDecoder_Algo_Parser_MvPredSyntaxElem->write_ind;
numFree_MvPredSyntaxElem = index_MvPredSyntaxElem + fifo_i16_get_room(HevcDecoder_Algo_Parser_MvPredSyntaxElem, NUM_READERS_MvPredSyntaxElem, SIZE_MvPredSyntaxElem);
}
static void write_end_MvPredSyntaxElem() {
HevcDecoder_Algo_Parser_MvPredSyntaxElem->write_ind = index_MvPredSyntaxElem;
}
static void write_Cbf() {
index_Cbf = HevcDecoder_Algo_Parser_Cbf->write_ind;
numFree_Cbf = index_Cbf + fifo_i32_get_room(HevcDecoder_Algo_Parser_Cbf, NUM_READERS_Cbf, SIZE_Cbf);
}
static void write_end_Cbf() {
HevcDecoder_Algo_Parser_Cbf->write_ind = index_Cbf;
}
static void write_DBFDisable() {
index_DBFDisable = HevcDecoder_Algo_Parser_DBFDisable->write_ind;
numFree_DBFDisable = index_DBFDisable + fifo_i32_get_room(HevcDecoder_Algo_Parser_DBFDisable, NUM_READERS_DBFDisable, SIZE_DBFDisable);
}
static void write_end_DBFDisable() {
HevcDecoder_Algo_Parser_DBFDisable->write_ind = index_DBFDisable;
}
static void write_DbfSe() {
index_DbfSe = HevcDecoder_Algo_Parser_DbfSe->write_ind;
numFree_DbfSe = index_DbfSe + fifo_i8_get_room(HevcDecoder_Algo_Parser_DbfSe, NUM_READERS_DbfSe, SIZE_DbfSe);
}
static void write_end_DbfSe() {
HevcDecoder_Algo_Parser_DbfSe->write_ind = index_DbfSe;
}
static void write_ReorderPics() {
index_ReorderPics = HevcDecoder_Algo_Parser_ReorderPics->write_ind;
numFree_ReorderPics = index_ReorderPics + fifo_i8_get_room(HevcDecoder_Algo_Parser_ReorderPics, NUM_READERS_ReorderPics, SIZE_ReorderPics);
}
static void write_end_ReorderPics() {
HevcDecoder_Algo_Parser_ReorderPics->write_ind = index_ReorderPics;
}
static void write_WeightedPred() {
index_WeightedPred = HevcDecoder_Algo_Parser_WeightedPred->write_ind;
numFree_WeightedPred = index_WeightedPred + fifo_i16_get_room(HevcDecoder_Algo_Parser_WeightedPred, NUM_READERS_WeightedPred, SIZE_WeightedPred);
}
static void write_end_WeightedPred() {
HevcDecoder_Algo_Parser_WeightedPred->write_ind = index_WeightedPred;
}
static void write_Qp() {
index_Qp = HevcDecoder_Algo_Parser_Qp->write_ind;
numFree_Qp = index_Qp + fifo_i8_get_room(HevcDecoder_Algo_Parser_Qp, NUM_READERS_Qp, SIZE_Qp);
}
static void write_end_Qp() {
HevcDecoder_Algo_Parser_Qp->write_ind = index_Qp;
}
////////////////////////////////////////////////////////////////////////////////
// Functions/procedures
static i32 HevcDecoder_Algo_Parser_min(i32 a, i32 b);
static i32 HevcDecoder_Algo_Parser_isFifoFull(u16 fifo[10]);
static void HevcDecoder_Algo_Parser_byte_align(u16 fifo[10]);
static u16 HevcDecoder_Algo_Parser_getFifoIdx(u16 cptBits, u16 fifo[10]);
static i32 HevcDecoder_Algo_Parser_IsStartCode(u16 fifo[10]);
static void HevcDecoder_Algo_Parser_flushBits(u8 nb, u16 fifo[10]);
static void HevcDecoder_Algo_Parser_flushBits_name(u8 nb, u16 fifo[10], char * name);
static void HevcDecoder_Algo_Parser_showXBits(u8 nb, u16 fifo[10], u32 res[1]);
static void HevcDecoder_Algo_Parser_getBits(u8 nb, u16 fifo[10], i32 res[1]);
static void HevcDecoder_Algo_Parser_vld_u(u8 nb, u16 fifo[10], i32 res[1]);
static void HevcDecoder_Algo_Parser_vld_u_name(u8 nb, u16 fifo[10], i32 res[1], char * name);
static void HevcDecoder_Algo_Parser_vld_ue(u16 fifo[10], i32 res[1]);
static void HevcDecoder_Algo_Parser_vld_ue_name(u16 fifo[10], i32 res[1], char * name);
static i32 HevcDecoder_Algo_Parser_isByteAlign(u16 fifo[10]);
static void HevcDecoder_Algo_Parser_vld_se(u16 fifo[10], i32 res[1]);
static void HevcDecoder_Algo_Parser_vld_se_name(u16 fifo[10], i32 res[1], char * name);
static void HevcDecoder_Algo_Parser_sortDeltaPOC(u32 sps_id, u32 idx, i8 pcRPS[15][65][131]);
static void HevcDecoder_Algo_Parser_parseShortTermRefPicSet(u32 sps_id, u32 idx, u8 num_short_term_ref_pic_sets, u16 fifo[10], i8 pcRPS[15][65][131]);
static i32 HevcDecoder_Algo_Parser_log2(i32 v);
static void HevcDecoder_Algo_Parser_InitScanningArray(u8 ScanOrder[4][3][256][2]);
static u32 HevcDecoder_Algo_Parser_InverseRasterScan(u32 a, u32 b, u32 c, u32 d, u32 e);
static i32 HevcDecoder_Algo_Parser_log2_i16(i32 v);
static void HevcDecoder_Algo_Parser_renormD(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_decodeTerminate(u16 codIRange[1], u16 codIOffset[1], u32 binVal[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_decodeTerminateTop(u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_get_END_OF_SLICE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_byte_alignment(u16 fifo[10]);
static void HevcDecoder_Algo_Parser_decodeStart(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static i32 HevcDecoder_Algo_Parser_clip_i32(i32 Value, i32 minVal, i32 maxVal);
static void HevcDecoder_Algo_Parser_contextInit(u8 qp, u8 sliceType, u16 ctxTable[30][48], u8 cabac_init_flag);
static void HevcDecoder_Algo_Parser_decodeReInit(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_get_END_OF_SUB_STREAM_ONE_BIT(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_decodeDecision(u16 codIRange[1], u16 codIOffset[1], u8 state[1], u8 mps[1], u8 binVal[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_decodeDecisionTop(u16 ctxIdx, u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u8 se, u16 fifo[10]);
static void HevcDecoder_Algo_Parser_get_SAO_MERGE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_decodeBypass(u16 codIRange[1], u16 codIOffset[1], u8 binVal[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_decodeBypassTop(u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_get_SAO_TYPE_IDX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_debinTU(u32 binString, u8 binIdx, u8 binarization, u8 debinCompleted[1], u32 debinValue[1], u8 discard_suffix[1]);
static void HevcDecoder_Algo_Parser_get_SAO_OFFSET_ABS(u8 offsetTh, u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_SAO_OFFSET_SIGN(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_decodeBinsEP(u8 numBins, u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_get_SAO_BAND_POSITION(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_SAO_EO(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static u8 HevcDecoder_Algo_Parser_context_93311_SKIP_CU_FLAG(u8 depthSubPart, i32 availableA, u8 depthSubPartA, i32 availableB, u8 depthSubPartB);
static void HevcDecoder_Algo_Parser_get_SPLIT_CODING_UNIT_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 depthSubPart, i32 availableA, u8 depthSubPartA, i32 availableB, u8 depthSubPartB);
static void HevcDecoder_Algo_Parser_get_CU_TRANSQUANT_BYPASS_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_SKIP_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 skip_flag[4096][2], u16 cu_x0, u16 cu_y0, i32 leftFlag, i32 upFlag);
static void HevcDecoder_Algo_Parser_intra_prediction_unit_default_value(u16 x0, u16 y0, u8 log2_cb_size, u8 part_mode, u8 log2_min_pu_size, u8 intraPredMode[4096][2]);
static void HevcDecoder_Algo_Parser_get_PRED_MODE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_PART_SIZE(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], i32 isIntra, u8 cu_log2CbSize, u8 Log2MinCbSize, u8 amp_enabled_flag);
static void HevcDecoder_Algo_Parser_get_PCM_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_PREV_INTRA_LUMA_PRED_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_MPM_IDX(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_REM_INTRA_LUMA_PRED_MODE(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], i32 debinValue[1]);
static void HevcDecoder_Algo_Parser_luma_intra_pred_mode(u16 x0, u16 y0, u8 pu_size, u8 prev_intra_luma_pred_flag, u32 mpm_idx_or_rem_intra_luma_pred_mode, u32 ret[1], u8 log2_min_pu_size, u8 log2_ctb_size, u8 intraPredMode[4096][2], i32 upFlag, i32 leftFlag);
static void HevcDecoder_Algo_Parser_get_INTRA_CHROMA_PRED_MODE(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_NO_RESIDUAL_SYNTAX_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_MERGE_IDX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 MaxNumMergeCand);
static void HevcDecoder_Algo_Parser_get_MERGE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_INTER_PRED_IDC(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 partMode, u8 PbW, u8 PbH, u8 ctDepth);
static void HevcDecoder_Algo_Parser_get_REF_IDX_LX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 num_ref_idx_lx_active_minus1);
static void HevcDecoder_Algo_Parser_get_MVP_LX_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER0_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER1_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_xReadEpExGolomb(u32 count_int, u32 debinValue[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]);
static void HevcDecoder_Algo_Parser_get_ABS_MVD_MINUS2(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_MVD_SIGN_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_SPLIT_TRANSFORM_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 log2TransformBlockSize);
static void HevcDecoder_Algo_Parser_get_CBF_CB_CR(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 trafoDepth);
static void HevcDecoder_Algo_Parser_get_CBF_LUMA(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 trafoDepth);
static void HevcDecoder_Algo_Parser_get_CU_QP_DELTA_ABS(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]);
static void HevcDecoder_Algo_Parser_get_CU_QP_DELTA_SIGN_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]);
static u8 HevcDecoder_Algo_Parser_getScanIdx(u8 predMode, u8 log2TrafoSize, u8 intraPredMode);
static void HevcDecoder_Algo_Parser_get_TRANSFORM_SKIP_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 rc_TType);
static u8 HevcDecoder_Algo_Parser_context_93312(u8 binIdx, u8 log2TrafoSize, u8 cIdx);
static void HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_X_PREFIX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 log2TrafoWidth, u8 cIdx);
static void HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_Y_PREFIX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 log2TrafoHeight, u8 cIdx);
static void HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_XY_SUFFIX(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1], u8 prefix);
static void HevcDecoder_Algo_Parser_context_93313(u8 coded_sub_block_flag[8][8], u16 xS, u16 yS, u8 cIdx, u8 log2TrafoSize, u16 ctxIdx[1]);
static void HevcDecoder_Algo_Parser_get_CODED_SUB_BLOCK_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 coded_sub_block_flag[8][8], u16 xC, u16 yC, u8 cIdx, u8 log2TrafoSize);
static void HevcDecoder_Algo_Parser_context_93314(u8 coded_sub_block_flag[8][8], u16 xC, u16 yC, u8 cIdx, u8 log2TrafoSize, u8 scanIdx, u16 ctxIdx[1]);
static void HevcDecoder_Algo_Parser_get_SIGNIFICANT_COEFF_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 coded_sub_block_flag[8][8], u16 xC, u16 yC, u8 cIdx, u8 log2TrafoSize, u8 scanIdx);
static void HevcDecoder_Algo_Parser_context_93315(u8 cIdx, i8 i, i32 first_elem, i32 first_subset, u8 ctxSet[1], u8 greater1Ctx[1], u16 ctxIdxInc[1]);
static void HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL_GREATER1_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], i32 debinValue[1], u16 ctxIdx);
static void HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL_GREATER2_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 cIdx, u8 ctxSet);
static void HevcDecoder_Algo_Parser_get_COEFF_SIGN_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1], u8 nb);
static void HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1], u8 rParam);
static void compute_POC(i32 pic_order_cnt_lsb);
static void setRefTables(i32 sps_id, i32 idx, i8 pc_rps[15][65][131], i32 poc);
static void set_qPy();
static void set_deblocking_bypass(u16 x0, u16 y0, u8 logSize);
static i32 HevcDecoder_Algo_Parser_min(i32 a, i32 b) {
i32 tmp_if;
if (a < b) {
tmp_if = a;
} else {
tmp_if = b;
}
return tmp_if;
}
static i32 HevcDecoder_Algo_Parser_isFifoFull(u16 fifo[10]) {
u8 local_FIFO_CPT_BITS;
u16 tmp_fifo;
u8 local_FIFO_SIZE;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
tmp_fifo = fifo[local_FIFO_CPT_BITS];
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
return tmp_fifo >= (local_FIFO_SIZE - 1) << 3;
}
static void HevcDecoder_Algo_Parser_byte_align(u16 fifo[10]) {
u8 local_FIFO_CPT_BITS;
u16 cptBits;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
cptBits = fifo[local_FIFO_CPT_BITS];
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
fifo[local_FIFO_CPT_BITS] = cptBits - (cptBits & 7);
}
static u16 HevcDecoder_Algo_Parser_getFifoIdx(u16 cptBits, u16 fifo[10]) {
u8 local_FIFO_IDX;
u16 fifo_idx;
u8 local_FIFO_SIZE;
i16 tmp_if;
local_FIFO_IDX = HevcDecoder_Algo_Parser_FIFO_IDX;
fifo_idx = fifo[local_FIFO_IDX];
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
if ((cptBits & local_FIFO_SIZE - 1) != 0) {
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
tmp_if = fifo_idx - 1 - (cptBits >> 3) & local_FIFO_SIZE - 1;
} else {
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
tmp_if = fifo_idx - (cptBits >> 3) & local_FIFO_SIZE - 1;
}
return tmp_if;
}
static i32 HevcDecoder_Algo_Parser_IsStartCode(u16 fifo[10]) {
u8 local_FIFO_CPT_BITS;
u16 cptBits;
u16 idx;
u16 tmp_fifo;
u8 local_FIFO_DEPTH;
i32 tmp_if;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
cptBits = fifo[local_FIFO_CPT_BITS];
idx = HevcDecoder_Algo_Parser_getFifoIdx(cptBits, fifo);
tmp_fifo = fifo[idx];
local_FIFO_DEPTH = HevcDecoder_Algo_Parser_FIFO_DEPTH;
if ((tmp_fifo & 1 << (local_FIFO_DEPTH - 1)) != 0) {
tmp_if = 1;
} else {
tmp_if = 0;
}
return tmp_if;
}
static void HevcDecoder_Algo_Parser_flushBits(u8 nb, u16 fifo[10]) {
u8 local_FIFO_CPT_BITS;
u16 tmp_fifo;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
tmp_fifo = fifo[local_FIFO_CPT_BITS];
fifo[local_FIFO_CPT_BITS] = tmp_fifo - nb;
}
static void HevcDecoder_Algo_Parser_flushBits_name(u8 nb, u16 fifo[10], char * name) {
i32 local_DEBUG_PARSER;
HevcDecoder_Algo_Parser_flushBits(nb, fifo);
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf(" %s u(%u) : 0\n", name, nb);
}
}
static void HevcDecoder_Algo_Parser_showXBits(u8 nb, u16 fifo[10], u32 res[1]) {
u8 local_FIFO_CPT_BITS;
u16 cptBits;
u16 idx;
u8 local_FIFO_SIZE;
u8 cpt;
i32 local_DEBUG_PARSER;
u16 tmp_fifo;
u16 tmp_fifo0;
u16 tmp_fifo1;
u16 tmp_fifo2;
u32 tmp_res;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
cptBits = fifo[local_FIFO_CPT_BITS];
idx = HevcDecoder_Algo_Parser_getFifoIdx(cptBits, fifo);
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
cpt = 8 - (cptBits & local_FIFO_SIZE - 1) & local_FIFO_SIZE - 1;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
if (nb > cptBits) {
printf(" Error showBits : out of range !!! nb %u cptBits %u\n", nb, cptBits);
}
}
tmp_fifo = fifo[idx];
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
tmp_fifo0 = fifo[idx + 1 & local_FIFO_SIZE - 1];
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
tmp_fifo1 = fifo[idx + 2 & local_FIFO_SIZE - 1];
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
tmp_fifo2 = fifo[idx + 3 & local_FIFO_SIZE - 1];
res[0] = tmp_fifo << 24 | tmp_fifo0 << 16 | tmp_fifo1 << 8 | tmp_fifo2;
tmp_res = res[0];
res[0] = (tmp_res << cpt) >> (32 - nb) & (1 << nb) - 1;
}
static void HevcDecoder_Algo_Parser_getBits(u8 nb, u16 fifo[10], i32 res[1]) {
if (nb == 0) {
res[0] = 0;
} else {
HevcDecoder_Algo_Parser_showXBits(nb, fifo, res);
HevcDecoder_Algo_Parser_flushBits(nb, fifo);
}
}
static void HevcDecoder_Algo_Parser_vld_u(u8 nb, u16 fifo[10], i32 res[1]) {
HevcDecoder_Algo_Parser_getBits(nb, fifo, res);
}
static void HevcDecoder_Algo_Parser_vld_u_name(u8 nb, u16 fifo[10], i32 res[1], char * name) {
i32 local_DEBUG_PARSER;
i32 tmp_res;
HevcDecoder_Algo_Parser_vld_u(nb, fifo, res);
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
tmp_res = res[0];
printf(" %s u(%u) : %i\n", name, nb, tmp_res);
}
}
static void HevcDecoder_Algo_Parser_vld_ue(u16 fifo[10], i32 res[1]) {
u8 local_FIFO_CPT_BITS;
u16 cptBits;
u16 idx;
u8 local_FIFO_SIZE;
u8 cpt;
u16 cptSave;
u32 codeLen;
u16 tmp_fifo;
i32 local_DEBUG_PARSER;
i32 tmp_res;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
cptBits = fifo[local_FIFO_CPT_BITS];
idx = HevcDecoder_Algo_Parser_getFifoIdx(cptBits, fifo);
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
cpt = cptBits - 1 & local_FIFO_SIZE - 1;
cptSave = cptBits;
tmp_fifo = fifo[idx];
while ((tmp_fifo >> cpt & 1) == 0) {
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
if (cptBits == 0) {
printf(" Error vld_ue : out of range !!!\n");
}
}
cptBits = cptBits - 1;
idx = HevcDecoder_Algo_Parser_getFifoIdx(cptBits, fifo);
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
cpt = cpt - 1 & local_FIFO_SIZE - 1;
tmp_fifo = fifo[idx];
}
codeLen = cptSave - cptBits;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
fifo[local_FIFO_CPT_BITS] = cptBits - 1;
HevcDecoder_Algo_Parser_vld_u(codeLen, fifo, res);
tmp_res = res[0];
res[0] = (1 << codeLen) + tmp_res - 1;
}
static void HevcDecoder_Algo_Parser_vld_ue_name(u16 fifo[10], i32 res[1], char * name) {
i32 local_DEBUG_PARSER;
i32 tmp_res;
HevcDecoder_Algo_Parser_vld_ue(fifo, res);
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
tmp_res = res[0];
printf(" %s u(v) : %i\n", name, tmp_res);
}
}
static i32 HevcDecoder_Algo_Parser_isByteAlign(u16 fifo[10]) {
u8 local_FIFO_CPT_BITS;
u16 cptBits;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
cptBits = fifo[local_FIFO_CPT_BITS];
return (cptBits & 7) == 0;
}
static void HevcDecoder_Algo_Parser_vld_se(u16 fifo[10], i32 res[1]) {
i32 tmp_res;
i32 tmp_res0;
i32 tmp_res1;
HevcDecoder_Algo_Parser_vld_ue(fifo, res);
tmp_res = res[0];
if ((tmp_res & 1) == 0) {
tmp_res0 = res[0];
res[0] = -(tmp_res0 >> 1);
} else {
tmp_res1 = res[0];
res[0] = (tmp_res1 >> 1) + 1;
}
}
static void HevcDecoder_Algo_Parser_vld_se_name(u16 fifo[10], i32 res[1], char * name) {
i32 local_DEBUG_PARSER;
i32 tmp_res;
HevcDecoder_Algo_Parser_vld_se(fifo, res);
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
tmp_res = res[0];
printf(" %s s(v) : %i\n", name, tmp_res);
}
}
static void HevcDecoder_Algo_Parser_sortDeltaPOC(u32 sps_id, u32 idx, i8 pcRPS[15][65][131]) {
i32 deltaPOC_v;
i8 used_v;
u32 k;
i32 tmp;
u8 local_NUM_PICS;
i8 tmp_pcRPS;
u8 i;
i8 tmp_pcRPS0;
u8 local_DELTAPOC;
u8 local_USED;
u8 j;
i8 tmp_pcRPS1;
u8 local_NUM_NEGATIVE_PICS;
i8 tmp_pcRPS2;
i8 tmp_pcRPS3;
u8 i0;
i8 tmp_pcRPS4;
i8 tmp_pcRPS5;
i8 tmp_pcRPS6;
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS = pcRPS[sps_id][idx][local_NUM_PICS];
if (tmp_pcRPS != 0) {
i = 1;
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS0 = pcRPS[sps_id][idx][local_NUM_PICS];
while (i <= tmp_pcRPS0 - 1) {
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
deltaPOC_v = pcRPS[sps_id][idx][local_DELTAPOC + i];
local_USED = HevcDecoder_Algo_Parser_USED;
used_v = pcRPS[sps_id][idx][local_USED + i];
j = 0;
while (j <= i - 1) {
k = i - 1 - j;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp = pcRPS[sps_id][idx][local_DELTAPOC + k];
if (deltaPOC_v < tmp) {
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[sps_id][idx][local_DELTAPOC + k + 1] = tmp;
local_USED = HevcDecoder_Algo_Parser_USED;
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_pcRPS1 = pcRPS[sps_id][idx][local_USED + k];
pcRPS[sps_id][idx][local_USED + k + 1] = tmp_pcRPS1;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[sps_id][idx][local_DELTAPOC + k] = deltaPOC_v;
local_USED = HevcDecoder_Algo_Parser_USED;
pcRPS[sps_id][idx][local_USED + k] = used_v;
}
j = j + 1;
}
i = i + 1;
}
}
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS2 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
if (tmp_pcRPS2 >> 1 != 0) {
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS3 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
k = tmp_pcRPS3 - 1;
i0 = 0;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS4 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
while (i0 <= (tmp_pcRPS4 >> 1) - 1) {
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
deltaPOC_v = pcRPS[sps_id][idx][local_DELTAPOC + i0];
local_USED = HevcDecoder_Algo_Parser_USED;
used_v = pcRPS[sps_id][idx][local_USED + i0];
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pcRPS5 = pcRPS[sps_id][idx][local_DELTAPOC + k];
pcRPS[sps_id][idx][local_DELTAPOC + i0] = tmp_pcRPS5;
local_USED = HevcDecoder_Algo_Parser_USED;
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_pcRPS6 = pcRPS[sps_id][idx][local_USED + k];
pcRPS[sps_id][idx][local_USED + i0] = tmp_pcRPS6;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[sps_id][idx][local_DELTAPOC + k] = deltaPOC_v;
local_USED = HevcDecoder_Algo_Parser_USED;
pcRPS[sps_id][idx][local_USED + k] = used_v;
k = k - 1;
i0 = i0 + 1;
}
}
}
static void HevcDecoder_Algo_Parser_parseShortTermRefPicSet(u32 sps_id, u32 idx, u8 num_short_term_ref_pic_sets, u16 fifo[10], i8 pcRPS[15][65][131]) {
u32 res[1];
u8 inter_rps_flag;
u16 delta_idx;
u8 rIdx;
i32 deltaRPS;
i32 deltaPOC;
i32 k;
i32 k0;
i32 k1;
i32 prev;
i32 delta_rps_sign;
i32 abs_delta_rps;
u32 tmp_res;
u32 tmp_res0;
u8 i;
u8 local_NUM_PICS;
i8 tmp_pcRPS;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
i8 tmp_pcRPS0;
u8 local_DELTAPOC;
i8 tmp_pcRPS1;
u8 local_USED;
u32 tmp_res5;
u8 local_NUM_NEGATIVE_PICS;
u8 local_NUM_POSITIVE_PICS;
u32 tmp_res6;
u32 tmp_res7;
i8 tmp_pcRPS2;
u32 tmp_res8;
i8 tmp_pcRPS3;
u8 i0;
i8 tmp_pcRPS4;
u32 tmp_res9;
u32 tmp_res10;
i8 tmp_pcRPS5;
u8 i1;
i8 tmp_pcRPS6;
u32 tmp_res11;
u32 tmp_res12;
inter_rps_flag = 0;
delta_idx = 1;
k = 0;
k0 = 0;
k1 = 0;
prev = 0;
if (idx != 0) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "inter_ref_pic_set_prediction_flag ");
inter_rps_flag = res[0];
}
if (inter_rps_flag == 1) {
if (idx == num_short_term_ref_pic_sets) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_idx_minus1 ");
tmp_res = res[0];
delta_idx = tmp_res + 1;
}
rIdx = idx - delta_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "delta_rps_sign ");
delta_rps_sign = res[0];
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "abs_delta_rps_minus1 ");
tmp_res0 = res[0];
abs_delta_rps = tmp_res0 + 1;
deltaRPS = (1 - (delta_rps_sign << 1)) * abs_delta_rps;
i = 0;
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS = pcRPS[sps_id][rIdx][local_NUM_PICS];
while (i <= tmp_pcRPS) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_flag ");
tmp_res1 = res[0];
if (tmp_res1 == 0) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "use_delta_flag ");
tmp_res2 = res[0];
res[0] = tmp_res2 << 1;
}
tmp_res3 = res[0];
tmp_res4 = res[0];
if (tmp_res3 == 1 || tmp_res4 == 2) {
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS0 = pcRPS[sps_id][rIdx][local_NUM_PICS];
if (i < tmp_pcRPS0) {
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pcRPS1 = pcRPS[sps_id][rIdx][local_DELTAPOC + i];
deltaPOC = deltaRPS + tmp_pcRPS1;
} else {
deltaPOC = deltaRPS;
}
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[sps_id][idx][local_DELTAPOC + k] = deltaPOC;
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_res5 = res[0];
if (tmp_res5 == 1) {
pcRPS[sps_id][idx][local_USED + k] = 1;
} else {
pcRPS[sps_id][idx][local_USED + k] = 0;
}
if (deltaPOC < 0) {
k0 = k0 + 1;
} else {
k1 = k1 + 1;
}
k = k + 1;
}
i = i + 1;
}
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
pcRPS[sps_id][idx][local_NUM_PICS] = k;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS] = k0;
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
pcRPS[sps_id][idx][local_NUM_POSITIVE_PICS] = k1;
HevcDecoder_Algo_Parser_sortDeltaPOC(sps_id, idx, pcRPS);
} else {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_negative_pics ");
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_res6 = res[0];
pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS] = tmp_res6;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_positive_pics ");
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
tmp_res7 = res[0];
pcRPS[sps_id][idx][local_NUM_POSITIVE_PICS] = tmp_res7;
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS2 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
tmp_res8 = res[0];
pcRPS[sps_id][idx][local_NUM_PICS] = tmp_pcRPS2 + tmp_res8;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS3 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
if (tmp_pcRPS3 != 0) {
i0 = 0;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS4 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
while (i0 <= tmp_pcRPS4 - 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_poc_s0_minus1 ");
tmp_res9 = res[0];
prev = prev - tmp_res9 - 1;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[sps_id][idx][local_DELTAPOC + i0] = prev;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_s0_flag ");
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_res10 = res[0];
pcRPS[sps_id][idx][local_USED + i0] = tmp_res10;
i0 = i0 + 1;
}
}
prev = 0;
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
tmp_pcRPS5 = pcRPS[sps_id][idx][local_NUM_POSITIVE_PICS];
if (tmp_pcRPS5 != 0) {
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
i1 = pcRPS[sps_id][idx][local_NUM_NEGATIVE_PICS];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS6 = pcRPS[sps_id][idx][local_NUM_PICS];
while (i1 <= tmp_pcRPS6 - 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_poc_s1_minus1 ");
tmp_res11 = res[0];
prev = prev + tmp_res11 + 1;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[sps_id][idx][local_DELTAPOC + i1] = prev;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_s1_flag ");
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_res12 = res[0];
pcRPS[sps_id][idx][local_USED + i1] = tmp_res12;
i1 = i1 + 1;
}
}
}
}
static i32 HevcDecoder_Algo_Parser_log2(i32 v) {
i32 v1;
i32 n1;
i32 v2;
i32 n2;
u8 tmp_log2_tab;
if ((v & 4294901760L) != 0) {
v1 = v >> 16;
} else {
v1 = v;
}
if ((v & 4294901760L) != 0) {
n1 = 16;
} else {
n1 = 0;
}
if ((v1 & 65280) != 0) {
v2 = v1 >> 8;
} else {
v2 = v1;
}
if ((v1 & 65280) != 0) {
n2 = n1 + 8;
} else {
n2 = n1;
}
tmp_log2_tab = HevcDecoder_Algo_Parser_log2_tab[v2];
return n2 + tmp_log2_tab;
}
static void HevcDecoder_Algo_Parser_InitScanningArray(u8 ScanOrder[4][3][256][2]) {
u8 blkSize;
u8 i;
u8 x;
i8 y;
i32 stopLoop;
i32 iTrafosize;
i32 n;
iTrafosize = 0;
while (iTrafosize <= 3) {
blkSize = 1 << iTrafosize;
i = 0;
x = 0;
y = 0;
stopLoop = 0;
n = 0;
while (n <= blkSize - 1) {
ScanOrder[iTrafosize][0][n][0] = 0;
ScanOrder[iTrafosize][0][n][1] = 0;
ScanOrder[iTrafosize][1][n][0] = 0;
ScanOrder[iTrafosize][1][n][1] = 0;
ScanOrder[iTrafosize][2][n][0] = 0;
ScanOrder[iTrafosize][2][n][1] = 0;
n = n + 1;
}
while (!stopLoop) {
while (y >= 0) {
if (x < blkSize && y < blkSize) {
ScanOrder[iTrafosize][0][i][0] = x;
ScanOrder[iTrafosize][0][i][1] = y;
i = i + 1;
}
y = y - 1;
x = x + 1;
}
y = x;
x = 0;
if (i >= blkSize * blkSize) {
stopLoop = 1;
}
}
i = 0;
y = 0;
while (y < blkSize) {
x = 0;
while (x < blkSize) {
ScanOrder[iTrafosize][1][i][0] = x;
ScanOrder[iTrafosize][1][i][1] = y;
x = x + 1;
i = i + 1;
}
y = y + 1;
}
i = 0;
x = 0;
while (x < blkSize) {
y = 0;
while (y < blkSize) {
ScanOrder[iTrafosize][2][i][0] = x;
ScanOrder[iTrafosize][2][i][1] = y;
y = y + 1;
i = i + 1;
}
x = x + 1;
}
iTrafosize = iTrafosize + 1;
}
}
static u32 HevcDecoder_Algo_Parser_InverseRasterScan(u32 a, u32 b, u32 c, u32 d, u32 e) {
i64 tmp_if;
if (e == 0) {
tmp_if = a % ((d + b - 1) / b) * b;
} else {
tmp_if = a / ((d + b - 1) / b) * c;
}
return tmp_if;
}
static i32 HevcDecoder_Algo_Parser_log2_i16(i32 v) {
i32 n;
i32 v2;
i32 n2;
u8 tmp_log2_tab;
n = 0;
if ((v & 65280) != 0) {
v2 = v >> 8;
} else {
v2 = v;
}
if ((v & 65280) != 0) {
n2 = n + 8;
} else {
n2 = n;
}
tmp_log2_tab = HevcDecoder_Algo_Parser_log2_tab[v2];
return n2 + tmp_log2_tab;
}
static void HevcDecoder_Algo_Parser_renormD(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
u32 res[1];
u32 count;
u16 tmp_codIRange;
i32 tmp_log2_i16;
u16 tmp_codIRange0;
u16 tmp_codIOffset;
u32 tmp_res;
tmp_codIRange = codIRange[0];
tmp_log2_i16 = HevcDecoder_Algo_Parser_log2_i16(tmp_codIRange);
count = 8 - tmp_log2_i16;
if (count > 0) {
HevcDecoder_Algo_Parser_vld_u(count, fifo, res);
tmp_codIRange0 = codIRange[0];
codIRange[0] = tmp_codIRange0 << count;
tmp_codIOffset = codIOffset[0];
tmp_res = res[0];
codIOffset[0] = (tmp_codIOffset << count) + tmp_res;
}
}
static void HevcDecoder_Algo_Parser_decodeTerminate(u16 codIRange[1], u16 codIOffset[1], u32 binVal[1], u16 fifo[10]) {
u16 tmp_codIRange;
u16 tmp_codIOffset;
u16 tmp_codIRange0;
tmp_codIRange = codIRange[0];
codIRange[0] = tmp_codIRange - 2;
tmp_codIOffset = codIOffset[0];
tmp_codIRange0 = codIRange[0];
if (tmp_codIOffset >= tmp_codIRange0) {
binVal[0] = 1;
} else {
binVal[0] = 0;
HevcDecoder_Algo_Parser_renormD(codIRange, codIOffset, fifo);
}
}
static void HevcDecoder_Algo_Parser_decodeTerminateTop(u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
i32 local_DEBUG_CABAC;
HevcDecoder_Algo_Parser_decodeTerminate(codIRange, codIOffset, binString, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_END_OF_SLICE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
i32 local_CHECK_CABAC;
u32 tmp_debinValue;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" END_OF_SLICE_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeTerminateTop(debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
local_CHECK_CABAC = HevcDecoder_Algo_Parser_CHECK_CABAC;
tmp_debinValue = debinValue[0];
if (local_CHECK_CABAC && tmp_debinValue == 1) {
}
}
static void HevcDecoder_Algo_Parser_byte_alignment(u16 fifo[10]) {
HevcDecoder_Algo_Parser_flushBits(1, fifo);
HevcDecoder_Algo_Parser_byte_align(fifo);
}
static void HevcDecoder_Algo_Parser_decodeStart(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
u32 res[1];
u32 tmp_res;
codIRange[0] = 510;
HevcDecoder_Algo_Parser_byte_alignment(fifo);
HevcDecoder_Algo_Parser_getBits(9, fifo, res);
tmp_res = res[0];
codIOffset[0] = tmp_res;
}
static i32 HevcDecoder_Algo_Parser_clip_i32(i32 Value, i32 minVal, i32 maxVal) {
i32 tmp_if;
if (Value > maxVal) {
tmp_if = maxVal;
} else {
if (Value < minVal) {
tmp_if = minVal;
} else {
tmp_if = Value;
}
}
return tmp_if;
}
static void HevcDecoder_Algo_Parser_contextInit(u8 qp, u8 sliceType, u16 ctxTable[30][48], u8 cabac_init_flag) {
u8 qp_clip3;
u8 initValue;
i8 slope;
i8 offset;
u8 initState;
u8 mpState;
u8 pStateIdx;
u8 sliceType_i;
u8 local_P_SLICE;
u8 local_B_SLICE;
u8 i;
u8 local_NB_MAX_SE;
u8 j;
u8 tmp_NUM_SE_CONTEXT_INDEX;
u16 tmp_ctxTable;
qp_clip3 = HevcDecoder_Algo_Parser_clip_i32(qp, 0, 51);
sliceType_i = sliceType;
if (cabac_init_flag == 1) {
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
if (sliceType == local_P_SLICE) {
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
sliceType_i = local_B_SLICE;
} else {
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (sliceType == local_B_SLICE) {
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
sliceType_i = local_P_SLICE;
}
}
}
i = 0;
local_NB_MAX_SE = HevcDecoder_Algo_Parser_NB_MAX_SE;
while (i <= local_NB_MAX_SE - 1) {
j = 0;
tmp_NUM_SE_CONTEXT_INDEX = HevcDecoder_Algo_Parser_NUM_SE_CONTEXT_INDEX[i];
while (j <= tmp_NUM_SE_CONTEXT_INDEX - 1) {
initValue = HevcDecoder_Algo_Parser_InitContextIndex[i][sliceType_i][j];
slope = (initValue >> 4) * 5 - 45;
offset = ((initValue & 15) << 3) - 16;
initState = HevcDecoder_Algo_Parser_clip_i32(((qp_clip3 * slope) >> 4) + offset, 1, 126);
if (initState >= 64) {
mpState = 1;
} else {
mpState = 0;
}
if (initState >= 64) {
pStateIdx = initState - 64;
} else {
pStateIdx = 63 - initState;
}
ctxTable[i][j] = (pStateIdx << 1) + mpState;
local_NB_MAX_SE = HevcDecoder_Algo_Parser_NB_MAX_SE;
if (i == local_NB_MAX_SE) {
tmp_ctxTable = ctxTable[i][j];
printf(" initValue = %u slope = %i offset = %i state = %u mps = %u ucState = %u\n", initValue, slope, offset, initState, mpState, tmp_ctxTable);
}
j = j + 1;
}
i = i + 1;
}
}
static void HevcDecoder_Algo_Parser_decodeReInit(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
u32 res[1];
u32 tmp_res;
codIRange[0] = 510;
HevcDecoder_Algo_Parser_byte_align(fifo);
HevcDecoder_Algo_Parser_getBits(9, fifo, res);
tmp_res = res[0];
codIOffset[0] = tmp_res;
}
static void HevcDecoder_Algo_Parser_get_END_OF_SUB_STREAM_ONE_BIT(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u16 tmp_codIRange0;
u16 tmp_codIOffset0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" END_OF_SUB_STREAM_ONE_BIT ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeTerminateTop(debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
tmp_codIRange0 = codIRange[0];
tmp_codIOffset0 = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange0, tmp_codIOffset0);
}
}
static void HevcDecoder_Algo_Parser_decodeDecision(u16 codIRange[1], u16 codIOffset[1], u8 state[1], u8 mps[1], u8 binVal[1], u16 fifo[10]) {
u16 tmp_codIRange;
u8 qCodIRangeIdx;
u8 tmp_state;
u16 codIRangeLPS;
u16 tmp_codIRange0;
u16 tmp_codIOffset;
u16 tmp_codIRange1;
u8 tmp_mps;
u16 tmp_codIOffset0;
u16 tmp_codIRange2;
u8 tmp_state0;
u8 tmp_mps0;
u8 tmp_state1;
u8 tmp_transIdxLPS;
u8 tmp_mps1;
u8 tmp_state2;
u8 tmp_transIdxMPS;
tmp_codIRange = codIRange[0];
qCodIRangeIdx = tmp_codIRange >> 6 & 3;
tmp_state = state[0];
codIRangeLPS = HevcDecoder_Algo_Parser_rangeTabLPS[tmp_state][qCodIRangeIdx];
tmp_codIRange0 = codIRange[0];
codIRange[0] = tmp_codIRange0 - codIRangeLPS;
tmp_codIOffset = codIOffset[0];
tmp_codIRange1 = codIRange[0];
if (tmp_codIOffset >= tmp_codIRange1) {
tmp_mps = mps[0];
binVal[0] = 1 - tmp_mps;
tmp_codIOffset0 = codIOffset[0];
tmp_codIRange2 = codIRange[0];
codIOffset[0] = tmp_codIOffset0 - tmp_codIRange2;
codIRange[0] = codIRangeLPS;
tmp_state0 = state[0];
if (tmp_state0 == 0) {
tmp_mps0 = mps[0];
mps[0] = 1 - tmp_mps0;
}
tmp_state1 = state[0];
tmp_transIdxLPS = HevcDecoder_Algo_Parser_transIdxLPS[tmp_state1];
state[0] = tmp_transIdxLPS;
} else {
tmp_mps1 = mps[0];
binVal[0] = tmp_mps1;
tmp_state2 = state[0];
tmp_transIdxMPS = HevcDecoder_Algo_Parser_transIdxMPS[tmp_state2];
state[0] = tmp_transIdxMPS;
}
HevcDecoder_Algo_Parser_renormD(codIRange, codIOffset, fifo);
}
static void HevcDecoder_Algo_Parser_decodeDecisionTop(u16 ctxIdx, u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u8 se, u16 fifo[10]) {
u8 state[1];
u8 mps[1];
u8 binVal[1];
u16 tmp_ctxTable;
u16 tmp_ctxTable0;
i32 local_DEBUG_CABAC;
u8 tmp_state;
u8 tmp_mps;
u32 tmp_binString;
u8 tmp_binVal;
state[0] = 0;
mps[0] = 0;
binVal[0] = 0;
tmp_ctxTable = ctxTable[se][ctxIdx];
state[0] = tmp_ctxTable >> 1;
tmp_ctxTable0 = ctxTable[se][ctxIdx];
mps[0] = tmp_ctxTable0 & 1;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
HevcDecoder_Algo_Parser_decodeDecision(codIRange, codIOffset, state, mps, binVal, fifo);
tmp_state = state[0];
tmp_mps = mps[0];
ctxTable[se][ctxIdx] = (tmp_state << 1) + tmp_mps;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
tmp_binString = binString[0];
tmp_binVal = binVal[0];
binString[0] = (tmp_binString << 1) + tmp_binVal;
}
static void HevcDecoder_Algo_Parser_get_SAO_MERGE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_SAO_MERGE_FLAG;
u16 tmp_codIRange0;
u16 tmp_codIOffset0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SAO_MERGE_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_SAO_MERGE_FLAG = HevcDecoder_Algo_Parser_SE_SAO_MERGE_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_SAO_MERGE_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
tmp_codIRange0 = codIRange[0];
tmp_codIOffset0 = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange0, tmp_codIOffset0);
}
}
static void HevcDecoder_Algo_Parser_decodeBypass(u16 codIRange[1], u16 codIOffset[1], u8 binVal[1], u16 fifo[10]) {
u32 res[1];
u16 tmp_codIOffset;
u32 tmp_res;
u16 tmp_codIOffset0;
u16 tmp_codIRange;
u16 tmp_codIOffset1;
u16 tmp_codIRange0;
HevcDecoder_Algo_Parser_vld_u(1, fifo, res);
tmp_codIOffset = codIOffset[0];
tmp_res = res[0];
codIOffset[0] = (tmp_codIOffset << 1) + tmp_res;
tmp_codIOffset0 = codIOffset[0];
tmp_codIRange = codIRange[0];
if (tmp_codIOffset0 >= tmp_codIRange) {
binVal[0] = 1;
tmp_codIOffset1 = codIOffset[0];
tmp_codIRange0 = codIRange[0];
codIOffset[0] = tmp_codIOffset1 - tmp_codIRange0;
} else {
binVal[0] = 0;
}
}
static void HevcDecoder_Algo_Parser_decodeBypassTop(u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
u8 binVal[1];
u8 tmp_binVal;
i32 local_DEBUG_CABAC;
HevcDecoder_Algo_Parser_decodeBypass(codIRange, codIOffset, binVal, fifo);
tmp_binVal = binVal[0];
binString[0] = tmp_binVal;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_SAO_TYPE_IDX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_SAO_TYPE_IDX;
u32 tmp_binString;
u8 local_SAO_NOT_APPLIED;
u32 tmp_binString0;
u8 local_SAO_BAND;
u8 local_SAO_EDGE;
u16 tmp_codIRange0;
u16 tmp_codIOffset0;
binString[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SAO_TYPE_IDX ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
local_SE_SAO_TYPE_IDX = HevcDecoder_Algo_Parser_SE_SAO_TYPE_IDX;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, binString, codIRange, codIOffset, ctxTable, local_SE_SAO_TYPE_IDX, fifo);
tmp_binString = binString[0];
if (tmp_binString == 0) {
local_SAO_NOT_APPLIED = HevcDecoder_Algo_Parser_SAO_NOT_APPLIED;
debinValue[0] = local_SAO_NOT_APPLIED;
} else {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
tmp_binString0 = binString[0];
if (tmp_binString0 == 0) {
local_SAO_BAND = HevcDecoder_Algo_Parser_SAO_BAND;
debinValue[0] = local_SAO_BAND;
} else {
local_SAO_EDGE = HevcDecoder_Algo_Parser_SAO_EDGE;
debinValue[0] = local_SAO_EDGE;
}
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
tmp_codIRange0 = codIRange[0];
tmp_codIOffset0 = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange0, tmp_codIOffset0);
}
}
static void HevcDecoder_Algo_Parser_debinTU(u32 binString, u8 binIdx, u8 binarization, u8 debinCompleted[1], u32 debinValue[1], u8 discard_suffix[1]) {
u8 local_DEBIN_TU9;
if (binIdx == binarization) {
debinCompleted[0] = 1;
} else {
debinCompleted[0] = 1 - (binString & 1);
}
local_DEBIN_TU9 = HevcDecoder_Algo_Parser_DEBIN_TU9;
if (binarization != local_DEBIN_TU9) {
discard_suffix[0] = binString & 1;
} else {
discard_suffix[0] = 0;
}
debinValue[0] = binIdx + (binString & 1);
}
static void HevcDecoder_Algo_Parser_get_SAO_OFFSET_ABS(u8 offsetTh, u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
u8 binIdx;
u8 debinCompleted[1];
u8 discard_suffix[1];
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 tmp_debinCompleted;
u32 tmp_binString;
binIdx = 0;
debinCompleted[0] = 0;
discard_suffix[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SAO_OFFSET_ABS ==> %u\n", offsetTh);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
tmp_debinCompleted = debinCompleted[0];
while (tmp_debinCompleted == 0) {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
tmp_binString = binString[0];
HevcDecoder_Algo_Parser_debinTU(tmp_binString, binIdx, offsetTh - 1, debinCompleted, debinValue, discard_suffix);
binIdx = binIdx + 1;
tmp_debinCompleted = debinCompleted[0];
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_SAO_OFFSET_SIGN(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SAO_OFFSET_SIGN ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBypassTop(debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_decodeBinsEP(u8 numBins, u32 binString[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
u32 binVal[1];
i32 i;
u32 tmp_binString;
u32 tmp_binVal;
if (numBins != 1) {
binString[0] = 0;
i = 0;
while (i <= numBins - 1) {
HevcDecoder_Algo_Parser_decodeBypassTop(binVal, codIRange, codIOffset, fifo);
tmp_binString = binString[0];
tmp_binVal = binVal[0];
binString[0] = (tmp_binString << 1) + tmp_binVal;
i = i + 1;
}
} else {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
}
}
static void HevcDecoder_Algo_Parser_get_SAO_BAND_POSITION(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SAO_BAND_POSITION ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBinsEP(5, debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_SAO_EO(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SAO_EO ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBinsEP(2, debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static u8 HevcDecoder_Algo_Parser_context_93311_SKIP_CU_FLAG(u8 depthSubPart, i32 availableA, u8 depthSubPartA, i32 availableB, u8 depthSubPartB) {
u8 condTermA;
u8 condTermB;
if (depthSubPartA > depthSubPart && availableA == 1) {
condTermA = 1;
} else {
condTermA = 0;
}
if (depthSubPartB > depthSubPart && availableB == 1) {
condTermB = 1;
} else {
condTermB = 0;
}
return condTermA + condTermB;
}
static void HevcDecoder_Algo_Parser_get_SPLIT_CODING_UNIT_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 depthSubPart, i32 availableA, u8 depthSubPartA, i32 availableB, u8 depthSubPartB) {
u16 ctxIdx;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_SPLIT_CODING_UNIT_FLAG;
ctxIdx = HevcDecoder_Algo_Parser_context_93311_SKIP_CU_FLAG(depthSubPart, availableA, depthSubPartA, availableB, depthSubPartB);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SPLIT_CODING_UNIT_FLAG ==> ctxIdx := %u\n", ctxIdx);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_SPLIT_CODING_UNIT_FLAG = HevcDecoder_Algo_Parser_SE_SPLIT_CODING_UNIT_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, debinValue, codIRange, codIOffset, ctxTable, local_SE_SPLIT_CODING_UNIT_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_CU_TRANSQUANT_BYPASS_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_CU_TRANSQUANT_BYPASS_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" CU_TRANSQUANT_BYPASS_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_CU_TRANSQUANT_BYPASS_FLAG = HevcDecoder_Algo_Parser_SE_CU_TRANSQUANT_BYPASS_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_CU_TRANSQUANT_BYPASS_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_SKIP_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 skip_flag[4096][2], u16 cu_x0, u16 cu_y0, i32 leftFlag, i32 upFlag) {
u16 ctxIdx;
u8 availableA;
u8 availableB;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_SKIP_FLAG;
if (leftFlag) {
availableA = skip_flag[cu_y0][1];
} else {
availableA = 0;
}
if (upFlag) {
availableB = skip_flag[cu_x0][0];
} else {
availableB = 0;
}
ctxIdx = availableA + availableB;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SKIP_FLAG ==> %u\n", ctxIdx);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_SKIP_FLAG = HevcDecoder_Algo_Parser_SE_SKIP_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, debinValue, codIRange, codIOffset, ctxTable, local_SE_SKIP_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_intra_prediction_unit_default_value(u16 x0, u16 y0, u8 log2_cb_size, u8 part_mode, u8 log2_min_pu_size, u8 intraPredMode[4096][2]) {
u8 local_PART_NxN;
u16 split;
u16 pb_size;
u16 side;
u8 size_in_pus;
u16 x_pu;
u16 y_pu;
i32 i;
i32 j;
u8 local_INTRA_DC;
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
if (part_mode == local_PART_NxN) {
split = 1;
} else {
split = 0;
}
pb_size = (1 << log2_cb_size) >> split;
side = split + 1;
size_in_pus = pb_size >> log2_min_pu_size;
i = 0;
while (i <= side - 1) {
x_pu = (x0 + pb_size * i) >> log2_min_pu_size;
y_pu = (y0 + pb_size * i) >> log2_min_pu_size;
j = 0;
while (j <= size_in_pus - 1) {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
intraPredMode[x_pu + j][0] = local_INTRA_DC;
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
intraPredMode[y_pu + j][1] = local_INTRA_DC;
j = j + 1;
}
i = i + 1;
}
}
static void HevcDecoder_Algo_Parser_get_PRED_MODE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_PRED_MODE_FLAG;
u8 local_INTER;
u32 tmp_binString;
binString[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" PRED_MODE_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
local_SE_PRED_MODE_FLAG = HevcDecoder_Algo_Parser_SE_PRED_MODE_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, binString, codIRange, codIOffset, ctxTable, local_SE_PRED_MODE_FLAG, fifo);
local_INTER = HevcDecoder_Algo_Parser_INTER;
tmp_binString = binString[0];
debinValue[0] = local_INTER + tmp_binString;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_PART_SIZE(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], i32 isIntra, u8 cu_log2CbSize, u8 Log2MinCbSize, u8 amp_enabled_flag) {
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_PART_MODE;
u32 tmp_binString;
u8 local_PART_2Nx2N;
u8 local_PART_NxN;
u32 tmp_binString0;
u8 local_PART_2NxN;
u8 local_PART_Nx2N;
u32 tmp_binString1;
u32 tmp_binString2;
u32 tmp_binString3;
u32 tmp_binString4;
u32 tmp_binString5;
u8 local_PART_2NxnD;
u8 local_PART_2NxnU;
u32 tmp_binString6;
u32 tmp_binString7;
u8 local_PART_nRx2N;
u8 local_PART_nLx2N;
binString[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" PART_MODE ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString = binString[0];
if (tmp_binString != 0) {
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
debinValue[0] = local_PART_2Nx2N;
} else {
if (cu_log2CbSize == Log2MinCbSize) {
if (isIntra) {
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
debinValue[0] = local_PART_NxN;
} else {
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(1, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString0 = binString[0];
if (tmp_binString0 != 0) {
local_PART_2NxN = HevcDecoder_Algo_Parser_PART_2NxN;
debinValue[0] = local_PART_2NxN;
} else {
if (cu_log2CbSize == 3) {
local_PART_Nx2N = HevcDecoder_Algo_Parser_PART_Nx2N;
debinValue[0] = local_PART_Nx2N;
} else {
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(2, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString1 = binString[0];
if (tmp_binString1 != 0) {
local_PART_Nx2N = HevcDecoder_Algo_Parser_PART_Nx2N;
debinValue[0] = local_PART_Nx2N;
} else {
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
debinValue[0] = local_PART_NxN;
}
}
}
}
} else {
if (amp_enabled_flag == 0) {
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(1, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString2 = binString[0];
if (tmp_binString2 != 0) {
local_PART_2NxN = HevcDecoder_Algo_Parser_PART_2NxN;
debinValue[0] = local_PART_2NxN;
} else {
local_PART_Nx2N = HevcDecoder_Algo_Parser_PART_Nx2N;
debinValue[0] = local_PART_Nx2N;
}
} else {
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(1, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString3 = binString[0];
if (tmp_binString3 != 0) {
binString[0] = 0;
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(3, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString4 = binString[0];
if (tmp_binString4 == 1) {
local_PART_2NxN = HevcDecoder_Algo_Parser_PART_2NxN;
debinValue[0] = local_PART_2NxN;
} else {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
tmp_binString5 = binString[0];
if (tmp_binString5 != 0) {
local_PART_2NxnD = HevcDecoder_Algo_Parser_PART_2NxnD;
debinValue[0] = local_PART_2NxnD;
} else {
local_PART_2NxnU = HevcDecoder_Algo_Parser_PART_2NxnU;
debinValue[0] = local_PART_2NxnU;
}
}
} else {
local_SE_PART_MODE = HevcDecoder_Algo_Parser_SE_PART_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(3, binString, codIRange, codIOffset, ctxTable, local_SE_PART_MODE, fifo);
tmp_binString6 = binString[0];
if (tmp_binString6 != 0) {
local_PART_Nx2N = HevcDecoder_Algo_Parser_PART_Nx2N;
debinValue[0] = local_PART_Nx2N;
} else {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
tmp_binString7 = binString[0];
if (tmp_binString7 != 0) {
local_PART_nRx2N = HevcDecoder_Algo_Parser_PART_nRx2N;
debinValue[0] = local_PART_nRx2N;
} else {
local_PART_nLx2N = HevcDecoder_Algo_Parser_PART_nLx2N;
debinValue[0] = local_PART_nLx2N;
}
}
}
}
}
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_PCM_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" PCM_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeTerminateTop(debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_PREV_INTRA_LUMA_PRED_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_PREV_INTRA_LUMA_PRED_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" PREV_INTRA_LUMA_PRED_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_PREV_INTRA_LUMA_PRED_FLAG = HevcDecoder_Algo_Parser_SE_PREV_INTRA_LUMA_PRED_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_PREV_INTRA_LUMA_PRED_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_MPM_IDX(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
u8 binIdx;
u8 debinCompleted[1];
u8 discard_suffix[1];
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 tmp_debinCompleted;
u32 tmp_binString;
u8 local_DEBIN_TU2;
binIdx = 0;
debinCompleted[0] = 0;
discard_suffix[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" MPM_IDX ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
tmp_debinCompleted = debinCompleted[0];
while (tmp_debinCompleted == 0) {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
tmp_binString = binString[0];
local_DEBIN_TU2 = HevcDecoder_Algo_Parser_DEBIN_TU2;
HevcDecoder_Algo_Parser_debinTU(tmp_binString, binIdx, local_DEBIN_TU2, debinCompleted, debinValue, discard_suffix);
binIdx = binIdx + 1;
tmp_debinCompleted = debinCompleted[0];
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_REM_INTRA_LUMA_PRED_MODE(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], i32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" REM_INTRA_LUMA_PRED_MODE ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBinsEP(5, debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_luma_intra_pred_mode(u16 x0, u16 y0, u8 pu_size, u8 prev_intra_luma_pred_flag, u32 mpm_idx_or_rem_intra_luma_pred_mode, u32 ret[1], u8 log2_min_pu_size, u8 log2_ctb_size, u8 intraPredMode[4096][2], i32 upFlag, i32 leftFlag) {
i16 x0b;
i16 y0b;
u8 candidate[4];
u16 x_pu;
u16 y_pu;
u8 size_in_pus;
u8 local_INTRA_DC;
u8 cand_up;
u8 cand_left;
u16 y_ctb;
u8 local_INTRA_PLANAR;
u8 local_INTRA_ANGULAR_26;
u8 tmp_candidate;
u8 tmp_candidate0;
u8 tmp_candidate1;
u8 tmp_candidate2;
u8 tmp_candidate3;
u8 tmp_candidate4;
u8 tmp_candidate5;
u8 tmp_candidate6;
u8 tmp_candidate7;
u8 tmp_candidate8;
u8 tmp_candidate9;
u8 tmp_candidate10;
u8 tmp_candidate11;
u8 tmp_candidate12;
u8 tmp_candidate13;
u8 tmp_candidate14;
u8 tmp_candidate15;
u8 tmp_candidate16;
u8 tmp_candidate17;
u8 tmp_candidate18;
i32 i;
u32 tmp_ret;
u8 tmp_candidate19;
u32 tmp_ret0;
i32 i0;
u32 tmp_ret1;
u32 tmp_ret2;
x0b = x0 & (1 << log2_ctb_size) - 1;
y0b = y0 & (1 << log2_ctb_size) - 1;
candidate[0] = 0;
candidate[1] = 0;
candidate[2] = 0;
candidate[3] = 0;
x_pu = x0 >> log2_min_pu_size;
y_pu = y0 >> log2_min_pu_size;
size_in_pus = pu_size >> log2_min_pu_size;
if (upFlag || y0b > 0) {
cand_up = intraPredMode[x_pu][0];
} else {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
cand_up = local_INTRA_DC;
}
if (leftFlag || x0b > 0) {
cand_left = intraPredMode[y_pu][1];
} else {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
cand_left = local_INTRA_DC;
}
y_ctb = (y0 >> log2_ctb_size) << log2_ctb_size;
if (y0 - 1 < y_ctb) {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
cand_up = local_INTRA_DC;
}
if (cand_left == cand_up) {
if (cand_left < 2) {
local_INTRA_PLANAR = HevcDecoder_Algo_Parser_INTRA_PLANAR;
candidate[0] = local_INTRA_PLANAR;
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
candidate[1] = local_INTRA_DC;
local_INTRA_ANGULAR_26 = HevcDecoder_Algo_Parser_INTRA_ANGULAR_26;
candidate[2] = local_INTRA_ANGULAR_26;
} else {
candidate[0] = cand_left;
candidate[1] = 2 + (cand_left - 2 - 1 + 32 & 31);
candidate[2] = 2 + (cand_left - 2 + 1 & 31);
}
} else {
candidate[0] = cand_left;
candidate[1] = cand_up;
tmp_candidate = candidate[0];
local_INTRA_PLANAR = HevcDecoder_Algo_Parser_INTRA_PLANAR;
tmp_candidate0 = candidate[1];
local_INTRA_PLANAR = HevcDecoder_Algo_Parser_INTRA_PLANAR;
if (tmp_candidate != local_INTRA_PLANAR && tmp_candidate0 != local_INTRA_PLANAR) {
local_INTRA_PLANAR = HevcDecoder_Algo_Parser_INTRA_PLANAR;
candidate[2] = local_INTRA_PLANAR;
} else {
tmp_candidate1 = candidate[0];
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
tmp_candidate2 = candidate[1];
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
if (tmp_candidate1 != local_INTRA_DC && tmp_candidate2 != local_INTRA_DC) {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
candidate[2] = local_INTRA_DC;
} else {
local_INTRA_ANGULAR_26 = HevcDecoder_Algo_Parser_INTRA_ANGULAR_26;
candidate[2] = local_INTRA_ANGULAR_26;
}
}
}
if (prev_intra_luma_pred_flag == 1) {
tmp_candidate3 = candidate[mpm_idx_or_rem_intra_luma_pred_mode];
ret[0] = tmp_candidate3;
} else {
tmp_candidate4 = candidate[0];
tmp_candidate5 = candidate[1];
if (tmp_candidate4 > tmp_candidate5) {
tmp_candidate6 = candidate[0];
candidate[3] = tmp_candidate6;
tmp_candidate7 = candidate[1];
candidate[0] = tmp_candidate7;
tmp_candidate8 = candidate[3];
candidate[1] = tmp_candidate8;
}
tmp_candidate9 = candidate[0];
tmp_candidate10 = candidate[2];
if (tmp_candidate9 > tmp_candidate10) {
tmp_candidate11 = candidate[0];
candidate[3] = tmp_candidate11;
tmp_candidate12 = candidate[2];
candidate[0] = tmp_candidate12;
tmp_candidate13 = candidate[3];
candidate[2] = tmp_candidate13;
}
tmp_candidate14 = candidate[1];
tmp_candidate15 = candidate[2];
if (tmp_candidate14 > tmp_candidate15) {
tmp_candidate16 = candidate[1];
candidate[3] = tmp_candidate16;
tmp_candidate17 = candidate[2];
candidate[1] = tmp_candidate17;
tmp_candidate18 = candidate[3];
candidate[2] = tmp_candidate18;
}
ret[0] = mpm_idx_or_rem_intra_luma_pred_mode;
i = 0;
while (i <= 2) {
tmp_ret = ret[0];
tmp_candidate19 = candidate[i];
if (tmp_ret >= tmp_candidate19) {
tmp_ret0 = ret[0];
ret[0] = tmp_ret0 + 1;
}
i = i + 1;
}
}
i0 = 0;
while (i0 <= size_in_pus - 1) {
tmp_ret1 = ret[0];
intraPredMode[x_pu + i0][0] = tmp_ret1;
tmp_ret2 = ret[0];
intraPredMode[y_pu + i0][1] = tmp_ret2;
i0 = i0 + 1;
}
}
static void HevcDecoder_Algo_Parser_get_INTRA_CHROMA_PRED_MODE(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_INTRA_CHROMA_PRED_MODE;
u32 tmp_binString;
binString[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" INTRA_CHROMA_PRED_MODE ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
local_SE_INTRA_CHROMA_PRED_MODE = HevcDecoder_Algo_Parser_SE_INTRA_CHROMA_PRED_MODE;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, binString, codIRange, codIOffset, ctxTable, local_SE_INTRA_CHROMA_PRED_MODE, fifo);
tmp_binString = binString[0];
if (tmp_binString == 0) {
debinValue[0] = 4;
} else {
HevcDecoder_Algo_Parser_decodeBinsEP(2, debinValue, codIRange, codIOffset, fifo);
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_NO_RESIDUAL_SYNTAX_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_NO_RESIDUAL_SYNTAX_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" NO_RESIDUAL_SYNTAX_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_NO_RESIDUAL_SYNTAX_FLAG = HevcDecoder_Algo_Parser_SE_NO_RESIDUAL_SYNTAX_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_NO_RESIDUAL_SYNTAX_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_MERGE_IDX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 MaxNumMergeCand) {
u32 binString[1];
u8 binIdx;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_MERGE_IDX;
u32 tmp_binString;
u32 tmp_binString0;
binString[0] = 0;
binIdx = 1;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" MERGE_IDX ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
if (MaxNumMergeCand > 1) {
local_SE_MERGE_IDX = HevcDecoder_Algo_Parser_SE_MERGE_IDX;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, binString, codIRange, codIOffset, ctxTable, local_SE_MERGE_IDX, fifo);
tmp_binString = binString[0];
while (tmp_binString != 0 && binIdx < MaxNumMergeCand - 1) {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
binIdx = binIdx + 1;
tmp_binString = binString[0];
}
}
tmp_binString0 = binString[0];
if (tmp_binString0 == 0) {
debinValue[0] = binIdx - 1;
} else {
debinValue[0] = binIdx;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_MERGE_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_MERGE_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" MERGE_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_MERGE_FLAG = HevcDecoder_Algo_Parser_SE_MERGE_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_MERGE_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_INTER_PRED_IDC(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 partMode, u8 PbW, u8 PbH, u8 ctDepth) {
u32 binString[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_INTER_PRED_IDC;
u32 tmp_binString;
u32 tmp_binString0;
u32 tmp_debinValue;
u8 local_BI_PRED;
u32 tmp_binString1;
binString[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" INTER_PRED_IDC ==> %u\n", ctDepth);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
if (PbW + PbH == 12) {
local_SE_INTER_PRED_IDC = HevcDecoder_Algo_Parser_SE_INTER_PRED_IDC;
HevcDecoder_Algo_Parser_decodeDecisionTop(4, binString, codIRange, codIOffset, ctxTable, local_SE_INTER_PRED_IDC, fifo);
tmp_binString = binString[0];
debinValue[0] = tmp_binString;
} else {
local_SE_INTER_PRED_IDC = HevcDecoder_Algo_Parser_SE_INTER_PRED_IDC;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctDepth, binString, codIRange, codIOffset, ctxTable, local_SE_INTER_PRED_IDC, fifo);
tmp_binString0 = binString[0];
debinValue[0] = tmp_binString0;
tmp_debinValue = debinValue[0];
if (tmp_debinValue != 0) {
local_BI_PRED = HevcDecoder_Algo_Parser_BI_PRED;
debinValue[0] = local_BI_PRED;
} else {
local_SE_INTER_PRED_IDC = HevcDecoder_Algo_Parser_SE_INTER_PRED_IDC;
HevcDecoder_Algo_Parser_decodeDecisionTop(4, binString, codIRange, codIOffset, ctxTable, local_SE_INTER_PRED_IDC, fifo);
tmp_binString1 = binString[0];
debinValue[0] = tmp_binString1;
}
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_REF_IDX_LX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 num_ref_idx_lx_active_minus1) {
u32 binString[1];
u8 binIdx;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_REF_IDX_L0;
u32 tmp_binString;
u32 tmp_binString0;
u32 tmp_binString1;
u32 tmp_binString2;
binString[0] = 0;
binIdx = 1;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" REF_IDX_L0 ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
local_SE_REF_IDX_L0 = HevcDecoder_Algo_Parser_SE_REF_IDX_L0;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, binString, codIRange, codIOffset, ctxTable, local_SE_REF_IDX_L0, fifo);
tmp_binString = binString[0];
debinValue[0] = tmp_binString;
tmp_binString0 = binString[0];
if (tmp_binString0 == 1 && num_ref_idx_lx_active_minus1 > 1) {
binString[0] = 0;
local_SE_REF_IDX_L0 = HevcDecoder_Algo_Parser_SE_REF_IDX_L0;
HevcDecoder_Algo_Parser_decodeDecisionTop(1, binString, codIRange, codIOffset, ctxTable, local_SE_REF_IDX_L0, fifo);
binIdx = binIdx + 1;
tmp_binString1 = binString[0];
while (tmp_binString1 != 0 && binIdx < num_ref_idx_lx_active_minus1) {
HevcDecoder_Algo_Parser_decodeBypassTop(binString, codIRange, codIOffset, fifo);
binIdx = binIdx + 1;
tmp_binString1 = binString[0];
}
tmp_binString2 = binString[0];
if (tmp_binString2 == 0) {
debinValue[0] = binIdx - 1;
} else {
debinValue[0] = binIdx;
}
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_MVP_LX_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_MVP_LX_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" MVP_LX_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_MVP_LX_FLAG = HevcDecoder_Algo_Parser_SE_MVP_LX_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_MVP_LX_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER0_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_ABS_MVD_GREATER0_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" ABS_MVD_GREATER0_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_ABS_MVD_GREATER0_FLAG = HevcDecoder_Algo_Parser_SE_ABS_MVD_GREATER0_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(0, debinValue, codIRange, codIOffset, ctxTable, local_SE_ABS_MVD_GREATER0_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER1_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_ABS_MVD_GREATER0_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" ABS_MVD_GREATER1_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_ABS_MVD_GREATER0_FLAG = HevcDecoder_Algo_Parser_SE_ABS_MVD_GREATER0_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(1, debinValue, codIRange, codIOffset, ctxTable, local_SE_ABS_MVD_GREATER0_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_xReadEpExGolomb(u32 count_int, u32 debinValue[1], u16 codIRange[1], u16 codIOffset[1], u16 fifo[10]) {
u32 count;
u32 bit[1];
u32 binString[1];
u32 tmp_bit;
u32 tmp_debinValue;
u32 tmp_bit0;
u32 tmp_debinValue0;
u32 tmp_binString;
count = count_int;
bit[0] = 1;
binString[0] = 0;
debinValue[0] = 0;
tmp_bit = bit[0];
while (tmp_bit == 1) {
HevcDecoder_Algo_Parser_decodeBypassTop(bit, codIRange, codIOffset, fifo);
tmp_debinValue = debinValue[0];
tmp_bit0 = bit[0];
debinValue[0] = tmp_debinValue + (tmp_bit0 << count);
count = count + 1;
tmp_bit = bit[0];
}
count = count - 1;
if (count != 0) {
HevcDecoder_Algo_Parser_decodeBinsEP(count, binString, codIRange, codIOffset, fifo);
tmp_debinValue0 = debinValue[0];
tmp_binString = binString[0];
debinValue[0] = tmp_debinValue0 + tmp_binString;
}
}
static void HevcDecoder_Algo_Parser_get_ABS_MVD_MINUS2(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" ABS_MVD_MINUS2 ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
HevcDecoder_Algo_Parser_xReadEpExGolomb(1, debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_MVD_SIGN_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" MVD_SIGN_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBypassTop(debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_SPLIT_TRANSFORM_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 log2TransformBlockSize) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_SPLIT_TRANSFORM_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" SPLIT_TRANSFORM_FLAG ==> %i\n", 5 - log2TransformBlockSize);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_SPLIT_TRANSFORM_FLAG = HevcDecoder_Algo_Parser_SE_SPLIT_TRANSFORM_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(5 - log2TransformBlockSize, debinValue, codIRange, codIOffset, ctxTable, local_SE_SPLIT_TRANSFORM_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_CBF_CB_CR(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 trafoDepth) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_CBF_CB_CR;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" CBF_CB_CR ==> %u\n", trafoDepth);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_CBF_CB_CR = HevcDecoder_Algo_Parser_SE_CBF_CB_CR;
HevcDecoder_Algo_Parser_decodeDecisionTop(trafoDepth, debinValue, codIRange, codIOffset, ctxTable, local_SE_CBF_CB_CR, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_CBF_LUMA(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 trafoDepth) {
u16 ctxIdx;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_CBF_LUMA;
if (trafoDepth == 0) {
ctxIdx = 1;
} else {
ctxIdx = 0;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" CBF_LUMA ==> %u\n", ctxIdx);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_CBF_LUMA = HevcDecoder_Algo_Parser_SE_CBF_LUMA;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, debinValue, codIRange, codIOffset, ctxTable, local_SE_CBF_LUMA, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_CU_QP_DELTA_ABS(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1]) {
u8 prefixVal;
u16 ctxIdx;
u8 binIdx;
u32 binString[1];
u8 discard_suffix[1];
u8 debinCompleted[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 tmp_debinCompleted;
u8 local_SE_CU_QP_DELTA;
u32 tmp_binString;
u8 local_DEBIN_TU5;
u32 tmp_debinValue;
prefixVal = 0;
ctxIdx = 0;
binIdx = 0;
binString[0] = 0;
discard_suffix[0] = 0;
debinCompleted[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" CU_QP_DELTA_ABS ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
tmp_debinCompleted = debinCompleted[0];
while (tmp_debinCompleted == 0) {
local_SE_CU_QP_DELTA = HevcDecoder_Algo_Parser_SE_CU_QP_DELTA;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, binString, codIRange, codIOffset, ctxTable, local_SE_CU_QP_DELTA, fifo);
tmp_binString = binString[0];
local_DEBIN_TU5 = HevcDecoder_Algo_Parser_DEBIN_TU5;
HevcDecoder_Algo_Parser_debinTU(tmp_binString, binIdx, local_DEBIN_TU5, debinCompleted, debinValue, discard_suffix);
ctxIdx = 1;
binIdx = binIdx + 1;
tmp_debinCompleted = debinCompleted[0];
}
prefixVal = debinValue[0];
if (prefixVal >= 5) {
HevcDecoder_Algo_Parser_xReadEpExGolomb(0, debinValue, codIRange, codIOffset, fifo);
tmp_debinValue = debinValue[0];
debinValue[0] = tmp_debinValue + prefixVal;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_CU_QP_DELTA_SIGN_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1]) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" CU_QP_DELTA_SIGN_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBypassTop(debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static u8 HevcDecoder_Algo_Parser_getScanIdx(u8 predMode, u8 log2TrafoSize, u8 intraPredMode) {
u8 local_INTRA;
u8 tmp_if;
u8 local_SCAN_VER;
u8 local_SCAN_HOR;
u8 local_SCAN_ZIGZAG;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (predMode == local_INTRA && log2TrafoSize < 4) {
if (intraPredMode >= 6 && intraPredMode <= 14) {
local_SCAN_VER = HevcDecoder_Algo_Parser_SCAN_VER;
tmp_if = local_SCAN_VER;
} else {
if (intraPredMode >= 22 && intraPredMode <= 30) {
local_SCAN_HOR = HevcDecoder_Algo_Parser_SCAN_HOR;
tmp_if = local_SCAN_HOR;
} else {
local_SCAN_ZIGZAG = HevcDecoder_Algo_Parser_SCAN_ZIGZAG;
tmp_if = local_SCAN_ZIGZAG;
}
}
} else {
local_SCAN_ZIGZAG = HevcDecoder_Algo_Parser_SCAN_ZIGZAG;
tmp_if = local_SCAN_ZIGZAG;
}
return tmp_if;
}
static void HevcDecoder_Algo_Parser_get_TRANSFORM_SKIP_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 rc_TType) {
u8 local_TEXT_LUMA;
u16 ctxIdx;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_TRANSFORM_SKIP_FLAG;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (rc_TType == local_TEXT_LUMA) {
ctxIdx = 0;
} else {
ctxIdx = 1;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" TRANSFORM_SKIP_FLAG ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_TRANSFORM_SKIP_FLAG = HevcDecoder_Algo_Parser_SE_TRANSFORM_SKIP_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, debinValue, codIRange, codIOffset, ctxTable, local_SE_TRANSFORM_SKIP_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static u8 HevcDecoder_Algo_Parser_context_93312(u8 binIdx, u8 log2TrafoSize, u8 cIdx) {
u8 ctx_offset;
u8 ctx_shift;
if (cIdx == 0) {
ctx_offset = 3 * (log2TrafoSize - 2) + ((log2TrafoSize - 1) >> 2);
} else {
ctx_offset = 15;
}
if (cIdx == 0) {
ctx_shift = (log2TrafoSize + 1) >> 2;
} else {
ctx_shift = log2TrafoSize - 2;
}
return (binIdx >> ctx_shift) + ctx_offset;
}
static void HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_X_PREFIX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 log2TrafoWidth, u8 cIdx) {
u16 ctxIdx;
u8 binIdx;
u32 binString[1];
u8 discard_suffix[1];
u8 debinCompleted[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 tmp_debinCompleted;
u8 local_SE_LAST_SIGNIFICANT_COEFF_X_PREFIX;
u32 tmp_binString;
binIdx = 0;
binString[0] = 0;
discard_suffix[0] = 0;
debinCompleted[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" LAST_SIGNIFICANT_COEFF_X_PREFIX ==> %llu\n", 1 << log2TrafoWidth);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
tmp_debinCompleted = debinCompleted[0];
while (tmp_debinCompleted == 0) {
ctxIdx = HevcDecoder_Algo_Parser_context_93312(binIdx, log2TrafoWidth, cIdx);
local_SE_LAST_SIGNIFICANT_COEFF_X_PREFIX = HevcDecoder_Algo_Parser_SE_LAST_SIGNIFICANT_COEFF_X_PREFIX;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, binString, codIRange, codIOffset, ctxTable, local_SE_LAST_SIGNIFICANT_COEFF_X_PREFIX, fifo);
tmp_binString = binString[0];
HevcDecoder_Algo_Parser_debinTU(tmp_binString, binIdx, (log2TrafoWidth << 1) - 2, debinCompleted, debinValue, discard_suffix);
binIdx = binIdx + 1;
tmp_debinCompleted = debinCompleted[0];
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_Y_PREFIX(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 log2TrafoHeight, u8 cIdx) {
u16 ctxIdx;
u8 binIdx;
u32 binString[1];
u8 discard_suffix[1];
u8 debinCompleted[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 tmp_debinCompleted;
u8 local_SE_LAST_SIGNIFICANT_COEFF_Y_PREFIX;
u32 tmp_binString;
binIdx = 0;
binString[0] = 0;
discard_suffix[0] = 0;
debinCompleted[0] = 0;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" LAST_SIGNIFICANT_COEFF_Y_PREFIX ==> %llu\n", 1 << log2TrafoHeight);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
tmp_debinCompleted = debinCompleted[0];
while (tmp_debinCompleted == 0) {
ctxIdx = HevcDecoder_Algo_Parser_context_93312(binIdx, log2TrafoHeight, cIdx);
local_SE_LAST_SIGNIFICANT_COEFF_Y_PREFIX = HevcDecoder_Algo_Parser_SE_LAST_SIGNIFICANT_COEFF_Y_PREFIX;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, binString, codIRange, codIOffset, ctxTable, local_SE_LAST_SIGNIFICANT_COEFF_Y_PREFIX, fifo);
tmp_binString = binString[0];
HevcDecoder_Algo_Parser_debinTU(tmp_binString, binIdx, (log2TrafoHeight << 1) - 2, debinCompleted, debinValue, discard_suffix);
binIdx = binIdx + 1;
tmp_debinCompleted = debinCompleted[0];
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_XY_SUFFIX(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1], u8 prefix) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" LAST_SIGNIFICANT_COEFF_XY_SUFFIX ==>\n");
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBinsEP((prefix >> 1) - 1, debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_context_93313(u8 coded_sub_block_flag[8][8], u16 xS, u16 yS, u8 cIdx, u8 log2TrafoSize, u16 ctxIdx[1]) {
u8 csbfCtx;
u8 trafoSize;
u8 tmp_coded_sub_block_flag;
i32 tmp_min;
u8 tmp_if;
csbfCtx = 0;
trafoSize = (1 << (log2TrafoSize - 2)) - 1;
if (xS < trafoSize) {
csbfCtx = coded_sub_block_flag[xS + 1][yS];
}
if (yS < trafoSize) {
tmp_coded_sub_block_flag = coded_sub_block_flag[xS][yS + 1];
csbfCtx = csbfCtx + tmp_coded_sub_block_flag;
}
tmp_min = HevcDecoder_Algo_Parser_min(csbfCtx, 1);
if (cIdx == 0) {
tmp_if = 0;
} else {
tmp_if = 2;
}
ctxIdx[0] = tmp_min + tmp_if;
}
static void HevcDecoder_Algo_Parser_get_CODED_SUB_BLOCK_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 coded_sub_block_flag[8][8], u16 xC, u16 yC, u8 cIdx, u8 log2TrafoSize) {
u16 ctxIdx[1];
i32 local_DEBUG_CABAC;
u16 tmp_ctxIdx;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u16 tmp_ctxIdx0;
u8 local_SE_CODED_SUB_BLOCK_FLAG;
HevcDecoder_Algo_Parser_context_93313(coded_sub_block_flag, xC, yC, cIdx, log2TrafoSize, ctxIdx);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
tmp_ctxIdx = ctxIdx[0];
printf(" CODED_SUB_BLOCK_FLAG ==> %u\n", tmp_ctxIdx & 1);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
tmp_ctxIdx0 = ctxIdx[0];
local_SE_CODED_SUB_BLOCK_FLAG = HevcDecoder_Algo_Parser_SE_CODED_SUB_BLOCK_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(tmp_ctxIdx0, debinValue, codIRange, codIOffset, ctxTable, local_SE_CODED_SUB_BLOCK_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_context_93314(u8 coded_sub_block_flag[8][8], u16 xC, u16 yC, u8 cIdx, u8 log2TrafoSize, u8 scanIdx, u16 ctxIdx[1]) {
u16 xS;
u16 yS;
u8 xP;
u8 yP;
u8 sigCtx;
u8 prevCsbf;
u8 trafoSize;
u8 tmp_coded_sub_block_flag;
u8 tmp_coded_sub_block_flag0;
u8 tmp_if;
xS = xC >> 2;
yS = yC >> 2;
xP = xC & 3;
yP = yC & 3;
prevCsbf = 0;
trafoSize = ((1 << log2TrafoSize) - 1) >> 2;
if (xC + yC == 0) {
sigCtx = 0;
} else {
if (log2TrafoSize == 2) {
sigCtx = HevcDecoder_Algo_Parser_ctxInMap[(yC << 2) + xC];
} else {
if (xS < trafoSize) {
tmp_coded_sub_block_flag = coded_sub_block_flag[xS + 1][yS];
prevCsbf = prevCsbf + tmp_coded_sub_block_flag;
}
if (yS < trafoSize) {
tmp_coded_sub_block_flag0 = coded_sub_block_flag[xS][yS + 1];
prevCsbf = prevCsbf + (tmp_coded_sub_block_flag0 << 1);
}
if (prevCsbf == 0) {
if (xP + yP == 0) {
sigCtx = 2;
} else {
if (xP + yP < 3) {
sigCtx = 1;
} else {
sigCtx = 0;
}
}
} else {
if (prevCsbf == 1) {
if (yP == 0) {
sigCtx = 2;
} else {
if (yP == 1) {
sigCtx = 1;
} else {
sigCtx = 0;
}
}
} else {
if (prevCsbf == 2) {
if (xP == 0) {
sigCtx = 2;
} else {
if (xP == 1) {
sigCtx = 1;
} else {
sigCtx = 0;
}
}
} else {
sigCtx = 2;
}
}
}
if (cIdx == 0) {
if (xS + yS > 0) {
sigCtx = sigCtx + 3;
}
if (log2TrafoSize == 3) {
if (scanIdx == 0) {
tmp_if = 9;
} else {
tmp_if = 15;
}
sigCtx = sigCtx + tmp_if;
} else {
sigCtx = sigCtx + 21;
}
} else {
if (log2TrafoSize == 3) {
sigCtx = sigCtx + 9;
} else {
sigCtx = sigCtx + 12;
}
}
}
}
if (cIdx == 0) {
ctxIdx[0] = sigCtx;
} else {
ctxIdx[0] = 27 + sigCtx;
}
}
static void HevcDecoder_Algo_Parser_get_SIGNIFICANT_COEFF_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 coded_sub_block_flag[8][8], u16 xC, u16 yC, u8 cIdx, u8 log2TrafoSize, u8 scanIdx) {
u16 ctxIdx[1];
i32 local_DEBUG_CABAC;
u16 tmp_ctxIdx;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u16 tmp_ctxIdx0;
u8 local_SE_SIGNIFICANT_COEFF_FLAG;
HevcDecoder_Algo_Parser_context_93314(coded_sub_block_flag, xC, yC, cIdx, log2TrafoSize, scanIdx, ctxIdx);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
tmp_ctxIdx = ctxIdx[0];
printf(" SIGNIFICANT_COEFF_FLAG ==> %u\n", tmp_ctxIdx);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
tmp_ctxIdx0 = ctxIdx[0];
local_SE_SIGNIFICANT_COEFF_FLAG = HevcDecoder_Algo_Parser_SE_SIGNIFICANT_COEFF_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(tmp_ctxIdx0, debinValue, codIRange, codIOffset, ctxTable, local_SE_SIGNIFICANT_COEFF_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_context_93315(u8 cIdx, i8 i, i32 first_elem, i32 first_subset, u8 ctxSet[1], u8 greater1Ctx[1], u16 ctxIdxInc[1]) {
u8 tmp_greater1Ctx;
u8 tmp_ctxSet;
u8 tmp_ctxSet0;
u8 tmp_greater1Ctx0;
u16 tmp_ctxIdxInc;
if (first_elem == 1) {
if (i > 0 && cIdx == 0) {
ctxSet[0] = 2;
} else {
ctxSet[0] = 0;
}
tmp_greater1Ctx = greater1Ctx[0];
if (first_subset == 0 && tmp_greater1Ctx == 0) {
tmp_ctxSet = ctxSet[0];
ctxSet[0] = tmp_ctxSet + 1;
}
greater1Ctx[0] = 1;
}
tmp_ctxSet0 = ctxSet[0];
tmp_greater1Ctx0 = greater1Ctx[0];
ctxIdxInc[0] = (tmp_ctxSet0 << 2) + tmp_greater1Ctx0;
if (cIdx > 0) {
tmp_ctxIdxInc = ctxIdxInc[0];
ctxIdxInc[0] = tmp_ctxIdxInc + 16;
}
}
static void HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL_GREATER1_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], i32 debinValue[1], u16 ctxIdx) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_COEFF_ABS_LEVEL_GREATER1_FLAG;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" COEFF_ABS_LEVEL_GREATER1_FLAG ==> %u\n", ctxIdx);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_COEFF_ABS_LEVEL_GREATER1_FLAG = HevcDecoder_Algo_Parser_SE_COEFF_ABS_LEVEL_GREATER1_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, debinValue, codIRange, codIOffset, ctxTable, local_SE_COEFF_ABS_LEVEL_GREATER1_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL_GREATER2_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 ctxTable[30][48], u16 fifo[10], u32 debinValue[1], u8 cIdx, u8 ctxSet) {
u8 tmp_if;
u16 ctxIdx;
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u8 local_SE_COEFF_ABS_LEVEL_GREATER2_FLAG;
if (cIdx != 0) {
tmp_if = 4;
} else {
tmp_if = 0;
}
ctxIdx = ctxSet + tmp_if;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" COEFF_ABS_LEVEL_GREATER2_FLAG ==> %u\n", ctxIdx);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
debinValue[0] = 0;
local_SE_COEFF_ABS_LEVEL_GREATER2_FLAG = HevcDecoder_Algo_Parser_SE_COEFF_ABS_LEVEL_GREATER2_FLAG;
HevcDecoder_Algo_Parser_decodeDecisionTop(ctxIdx, debinValue, codIRange, codIOffset, ctxTable, local_SE_COEFF_ABS_LEVEL_GREATER2_FLAG, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void HevcDecoder_Algo_Parser_get_COEFF_SIGN_FLAG(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1], u8 nb) {
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC && nb != 0) {
printf(" COEFF_SIGN_FLAG ==> %u\n", nb);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
HevcDecoder_Algo_Parser_decodeBinsEP(nb, debinValue, codIRange, codIOffset, fifo);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC && nb != 0) {
}
}
static void HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL(u16 codIRange[1], u16 codIOffset[1], u16 fifo[10], u32 debinValue[1], u8 rParam) {
u16 prefix;
u32 codeWord[1];
i32 local_DEBUG_CABAC;
u16 tmp_codIRange;
u16 tmp_codIOffset;
u32 tmp_codeWord;
u32 tmp_codeWord0;
u32 tmp_codeWord1;
u32 tmp_codeWord2;
u32 tmp_codeWord3;
prefix = 0;
codeWord[0] = 1;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf(" COEFF_ABS_LEVEL ==> %u\n", rParam);
tmp_codIRange = codIRange[0];
tmp_codIOffset = codIOffset[0];
printf("codIRange := %u codIOffset := %u\n", tmp_codIRange, tmp_codIOffset);
}
tmp_codeWord = codeWord[0];
while (tmp_codeWord == 1) {
prefix = prefix + 1;
HevcDecoder_Algo_Parser_decodeBypassTop(codeWord, codIRange, codIOffset, fifo);
tmp_codeWord = codeWord[0];
}
tmp_codeWord0 = codeWord[0];
codeWord[0] = 1 - tmp_codeWord0;
tmp_codeWord1 = codeWord[0];
prefix = prefix - tmp_codeWord1;
if (prefix < 3) {
HevcDecoder_Algo_Parser_decodeBinsEP(rParam, codeWord, codIRange, codIOffset, fifo);
tmp_codeWord2 = codeWord[0];
debinValue[0] = (prefix << rParam) + tmp_codeWord2;
} else {
HevcDecoder_Algo_Parser_decodeBinsEP(prefix - 3 + rParam, codeWord, codIRange, codIOffset, fifo);
tmp_codeWord3 = codeWord[0];
debinValue[0] = (((1 << (prefix - 3)) + 3 - 1) << rParam) + tmp_codeWord3;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
}
}
static void compute_POC(i32 pic_order_cnt_lsb) {
i32 iPOClsb;
i32 local_poc;
i32 iPrevPOC;
u16 local_sps_id;
i32 iMaxPOClsb;
i32 iPrevPOClsb;
i32 iPrevPOCmsb;
i32 iPOCmsb;
u8 local_nal_unit_type;
u8 local_NAL_BLA_W_LP;
u8 local_NAL_BLA_W_RADL;
u8 local_NAL_BLA_N_LP;
iPOClsb = pic_order_cnt_lsb;
local_poc = poc;
iPrevPOC = local_poc;
local_sps_id = sps_id;
iMaxPOClsb = max_poc_lsb[local_sps_id];
iPrevPOClsb = iPrevPOC % iMaxPOClsb;
iPrevPOCmsb = iPrevPOC - iPrevPOClsb;
if (iPOClsb < iPrevPOClsb && iPrevPOClsb - iPOClsb >= iMaxPOClsb / 2) {
iPOCmsb = iPrevPOCmsb + iMaxPOClsb;
} else {
if (iPOClsb > iPrevPOClsb && iPOClsb - iPrevPOClsb > iMaxPOClsb / 2) {
iPOCmsb = iPrevPOCmsb - iMaxPOClsb;
} else {
iPOCmsb = iPrevPOCmsb;
}
}
local_nal_unit_type = nal_unit_type;
local_NAL_BLA_W_LP = HevcDecoder_Algo_Parser_NAL_BLA_W_LP;
local_nal_unit_type = nal_unit_type;
local_NAL_BLA_W_RADL = HevcDecoder_Algo_Parser_NAL_BLA_W_RADL;
local_nal_unit_type = nal_unit_type;
local_NAL_BLA_N_LP = HevcDecoder_Algo_Parser_NAL_BLA_N_LP;
if (local_nal_unit_type == local_NAL_BLA_W_LP || local_nal_unit_type == local_NAL_BLA_W_RADL || local_nal_unit_type == local_NAL_BLA_N_LP) {
iPOCmsb = 0;
}
poc = iPOCmsb + iPOClsb;
}
static void setRefTables(i32 sps_id, i32 idx, i8 pc_rps[15][65][131], i32 poc) {
u32 j;
u32 k;
i32 pocLt;
i32 i;
u8 local_NUM_NEGATIVE_PICS;
i8 tmp_pc_rps;
u8 local_USED;
i8 tmp_pc_rps0;
u8 local_ST_CURR_BEF;
u8 local_DELTAPOC;
i8 tmp_pc_rps1;
u8 local_ST_FOLL;
i8 tmp_pc_rps2;
i32 i0;
u8 local_NUM_PICS;
i8 tmp_pc_rps3;
i8 tmp_pc_rps4;
u8 local_ST_CURR_AFT;
i8 tmp_pc_rps5;
i8 tmp_pc_rps6;
i32 i1;
u16 local_num_long_term_sps;
u16 local_num_long_term_pics;
u8 tmp_delta_poc_msb_present_flag;
u8 tmp_DeltaPocMsbCycleLt;
u32 tmp_max_poc_lsb;
i32 local_pic_order_cnt_lsb;
u8 tmp_UsedByCurrPicLt;
u8 local_LT_CURR;
u8 local_LT_FOLL;
j = 0;
k = 0;
pocLt = poc_lsb_lt[0];
i = 0;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pc_rps = pc_rps[sps_id][idx][local_NUM_NEGATIVE_PICS];
while (i <= tmp_pc_rps - 1) {
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_pc_rps0 = pc_rps[sps_id][idx][local_USED + i];
if (tmp_pc_rps0 == 1) {
local_ST_CURR_BEF = HevcDecoder_Algo_Parser_ST_CURR_BEF;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pc_rps1 = pc_rps[sps_id][idx][local_DELTAPOC + i];
pocTables[local_ST_CURR_BEF][j] = poc + tmp_pc_rps1;
j = j + 1;
} else {
local_ST_FOLL = HevcDecoder_Algo_Parser_ST_FOLL;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pc_rps2 = pc_rps[sps_id][idx][local_DELTAPOC + i];
pocTables[local_ST_FOLL][k] = poc + tmp_pc_rps2;
k = k + 1;
}
i = i + 1;
}
local_ST_CURR_BEF = HevcDecoder_Algo_Parser_ST_CURR_BEF;
numPic[local_ST_CURR_BEF] = j;
j = 0;
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
i0 = pc_rps[sps_id][idx][local_NUM_NEGATIVE_PICS];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pc_rps3 = pc_rps[sps_id][idx][local_NUM_PICS];
while (i0 <= tmp_pc_rps3 - 1) {
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_pc_rps4 = pc_rps[sps_id][idx][local_USED + i0];
if (tmp_pc_rps4 == 1) {
local_ST_CURR_AFT = HevcDecoder_Algo_Parser_ST_CURR_AFT;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pc_rps5 = pc_rps[sps_id][idx][local_DELTAPOC + i0];
pocTables[local_ST_CURR_AFT][j] = poc + tmp_pc_rps5;
j = j + 1;
} else {
local_ST_FOLL = HevcDecoder_Algo_Parser_ST_FOLL;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pc_rps6 = pc_rps[sps_id][idx][local_DELTAPOC + i0];
pocTables[local_ST_FOLL][k] = poc + tmp_pc_rps6;
k = k + 1;
}
i0 = i0 + 1;
}
local_ST_CURR_AFT = HevcDecoder_Algo_Parser_ST_CURR_AFT;
numPic[local_ST_CURR_AFT] = j;
local_ST_FOLL = HevcDecoder_Algo_Parser_ST_FOLL;
numPic[local_ST_FOLL] = k;
j = 0;
k = 0;
i1 = 0;
local_num_long_term_sps = num_long_term_sps;
local_num_long_term_pics = num_long_term_pics;
while (i1 <= local_num_long_term_sps + local_num_long_term_pics - 1) {
pocLt = poc_lsb_lt[i1];
tmp_delta_poc_msb_present_flag = delta_poc_msb_present_flag[i1];
if (tmp_delta_poc_msb_present_flag == 1) {
tmp_DeltaPocMsbCycleLt = DeltaPocMsbCycleLt[i1];
tmp_max_poc_lsb = max_poc_lsb[sps_id];
local_pic_order_cnt_lsb = pic_order_cnt_lsb;
pocLt = pocLt + poc - tmp_DeltaPocMsbCycleLt * tmp_max_poc_lsb - local_pic_order_cnt_lsb;
}
tmp_UsedByCurrPicLt = UsedByCurrPicLt[i1];
if (tmp_UsedByCurrPicLt == 1) {
local_LT_CURR = HevcDecoder_Algo_Parser_LT_CURR;
pocTables[local_LT_CURR][j] = pocLt;
j = j + 1;
} else {
local_LT_FOLL = HevcDecoder_Algo_Parser_LT_FOLL;
pocTables[local_LT_FOLL][k] = pocLt;
k = k + 1;
}
i1 = i1 + 1;
}
local_LT_CURR = HevcDecoder_Algo_Parser_LT_CURR;
numPic[local_LT_CURR] = j;
local_LT_FOLL = HevcDecoder_Algo_Parser_LT_FOLL;
numPic[local_LT_FOLL] = k;
}
static void set_qPy() {
u8 local_Log2CtbSize;
i32 ctb_size_mask;
u16 local_pps_id;
u16 tmp_pps_diff_cu_qp_delta_depth;
i32 MinCuQpDeltaSizeMask;
u16 local_cu_x0;
i32 xQgBase;
u16 local_cu_y0;
i32 yQgBase;
u8 local_Log2MinCbSize;
i32 x_cb;
i32 y_cb;
i32 availableA;
i32 availableB;
i32 qPy_local;
i32 qPy_a;
i32 qPy_b;
i32 local_qPy_pred;
u8 local_first_qp_group;
u8 local_IsCuQpDeltaCoded;
i8 local_slice_qp;
i32 local_min_cb_width;
i16 local_CuQpDelta;
u16 local_qp_bd_offset_luma;
local_Log2CtbSize = Log2CtbSize;
ctb_size_mask = (1 << local_Log2CtbSize) - 1;
local_Log2CtbSize = Log2CtbSize;
local_pps_id = pps_id;
tmp_pps_diff_cu_qp_delta_depth = pps_diff_cu_qp_delta_depth[local_pps_id];
MinCuQpDeltaSizeMask = (1 << (local_Log2CtbSize - tmp_pps_diff_cu_qp_delta_depth)) - 1;
local_cu_x0 = cu_x0;
local_cu_x0 = cu_x0;
xQgBase = local_cu_x0 - (local_cu_x0 & MinCuQpDeltaSizeMask);
local_cu_y0 = cu_y0;
local_cu_y0 = cu_y0;
yQgBase = local_cu_y0 - (local_cu_y0 & MinCuQpDeltaSizeMask);
local_Log2MinCbSize = Log2MinCbSize;
x_cb = xQgBase >> local_Log2MinCbSize;
local_Log2MinCbSize = Log2MinCbSize;
y_cb = yQgBase >> local_Log2MinCbSize;
local_cu_x0 = cu_x0;
if ((local_cu_x0 & ctb_size_mask) != 0 && (xQgBase & ctb_size_mask) != 0) {
availableA = 1;
} else {
availableA = 0;
}
local_cu_y0 = cu_y0;
if ((local_cu_y0 & ctb_size_mask) != 0 && (yQgBase & ctb_size_mask) != 0) {
availableB = 1;
} else {
availableB = 0;
}
qPy_local = 0;
qPy_a = 0;
qPy_b = 0;
local_qPy_pred = 0;
local_first_qp_group = first_qp_group;
if (local_first_qp_group != 0 || xQgBase == 0 && yQgBase == 0) {
local_IsCuQpDeltaCoded = IsCuQpDeltaCoded;
if (local_IsCuQpDeltaCoded != 0) {
first_qp_group = 0;
} else {
first_qp_group = 1;
}
local_slice_qp = slice_qp;
local_qPy_pred = local_slice_qp;
} else {
local_qPy_pred = qPy_pred;
local_qPy_pred = local_qPy_pred;
}
if (availableA == 0) {
qPy_a = local_qPy_pred;
} else {
local_min_cb_width = min_cb_width;
qPy_a = qp_y_tab[x_cb - 1 + y_cb * local_min_cb_width];
}
if (availableB == 0) {
qPy_b = local_qPy_pred;
} else {
local_min_cb_width = min_cb_width;
qPy_b = qp_y_tab[x_cb + (y_cb - 1) * local_min_cb_width];
}
qPy_local = (qPy_a + qPy_b + 1) >> 1;
local_CuQpDelta = CuQpDelta;
if (local_CuQpDelta != 0) {
local_CuQpDelta = CuQpDelta;
local_qp_bd_offset_luma = qp_bd_offset_luma;
local_qp_bd_offset_luma = qp_bd_offset_luma;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp_y = (qPy_local + local_CuQpDelta + 52 + 2 * local_qp_bd_offset_luma) % (52 + local_qp_bd_offset_luma) - local_qp_bd_offset_luma;
} else {
qp_y = qPy_local;
}
}
static void set_deblocking_bypass(u16 x0, u16 y0, u8 logSize) {
u16 local_sps_id;
i32 min_pu_width;
u16 tmp_sps_pic_width_in_luma_samples;
i32 x_end;
u16 tmp_sps_pic_height_in_luma_samples;
i32 y_end;
i32 j;
u8 tmp_sps_log2_min_pu_size;
u8 tmp_sps_log2_min_pu_size0;
i32 i;
u8 tmp_sps_log2_min_pu_size1;
u8 tmp_sps_log2_min_pu_size2;
local_sps_id = sps_id;
min_pu_width = sps_min_pu_width[local_sps_id];
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
x_end = HevcDecoder_Algo_Parser_min(x0 + logSize, tmp_sps_pic_width_in_luma_samples);
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
y_end = HevcDecoder_Algo_Parser_min(y0 + logSize, tmp_sps_pic_height_in_luma_samples);
local_sps_id = sps_id;
tmp_sps_log2_min_pu_size = sps_log2_min_pu_size[local_sps_id];
j = y0 >> tmp_sps_log2_min_pu_size;
local_sps_id = sps_id;
tmp_sps_log2_min_pu_size0 = sps_log2_min_pu_size[local_sps_id];
while (j <= (y_end >> tmp_sps_log2_min_pu_size0) - 1) {
local_sps_id = sps_id;
tmp_sps_log2_min_pu_size1 = sps_log2_min_pu_size[local_sps_id];
i = x0 >> tmp_sps_log2_min_pu_size1;
local_sps_id = sps_id;
tmp_sps_log2_min_pu_size2 = sps_log2_min_pu_size[local_sps_id];
while (i <= (x_end >> tmp_sps_log2_min_pu_size2) - 1) {
is_pcm[i + j * min_pu_width] = 2;
i = i + 1;
}
j = j + 1;
}
}
////////////////////////////////////////////////////////////////////////////////
// Actions
static i32 isSchedulable_untagged_0() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = !tmp_isFifoFull;
return result;
}
static void untagged_0() {
u8 b;
u8 local_FIFO_IDX;
u8 fifo_idx;
u32 local_counterByte;
u8 local_EPR_VALUE;
u8 local_zeroByte;
u8 local_START_CODE_VALUE;
u16 local_START_CODE_FLAG;
u8 local_FIFO_CPT_BITS;
u16 tmp_fifo;
i32 local_DEBUG_BITSTREAM;
u8 local_FIFO_SIZE;
b = tokens_byte[(index_byte + (0)) % SIZE_byte];
local_FIFO_IDX = HevcDecoder_Algo_Parser_FIFO_IDX;
fifo_idx = fifo[local_FIFO_IDX];
local_counterByte = counterByte;
counterByte = local_counterByte + 1;
local_EPR_VALUE = HevcDecoder_Algo_Parser_EPR_VALUE;
local_zeroByte = zeroByte;
if (b != local_EPR_VALUE || local_zeroByte != 3) {
local_START_CODE_VALUE = HevcDecoder_Algo_Parser_START_CODE_VALUE;
local_zeroByte = zeroByte;
if (b == local_START_CODE_VALUE && local_zeroByte == 3) {
local_START_CODE_FLAG = HevcDecoder_Algo_Parser_START_CODE_FLAG;
fifo[fifo_idx] = b + local_START_CODE_FLAG;
} else {
fifo[fifo_idx] = b;
}
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
local_FIFO_CPT_BITS = HevcDecoder_Algo_Parser_FIFO_CPT_BITS;
tmp_fifo = fifo[local_FIFO_CPT_BITS];
fifo[local_FIFO_CPT_BITS] = tmp_fifo + 8;
local_DEBUG_BITSTREAM = HevcDecoder_Algo_Parser_DEBUG_BITSTREAM;
if (local_DEBUG_BITSTREAM) {
printf("fifo[%u] := %u\n", fifo_idx, b);
}
local_FIFO_IDX = HevcDecoder_Algo_Parser_FIFO_IDX;
local_FIFO_SIZE = HevcDecoder_Algo_Parser_FIFO_SIZE;
fifo[local_FIFO_IDX] = fifo_idx + 1 & local_FIFO_SIZE - 1;
} else {
local_EPR_VALUE = HevcDecoder_Algo_Parser_EPR_VALUE;
if (b == local_EPR_VALUE) {
}
}
if (b == 0) {
local_zeroByte = zeroByte;
zeroByte = (local_zeroByte << 1) + 1 & 3;
} else {
zeroByte = 0;
}
// Update ports indexes
index_byte += 1;
rate_byte += 1;
}
static i32 isSchedulable_byte_align_a() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void byte_align_a() {
HevcDecoder_Algo_Parser_byte_align(fifo);
// Update ports indexes
}
static i32 isSchedulable_start_code_search() {
i32 result;
i32 tmp_IsStartCode;
i32 tmp_isFifoFull;
tmp_IsStartCode = HevcDecoder_Algo_Parser_IsStartCode(fifo);
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = !tmp_IsStartCode && tmp_isFifoFull;
return result;
}
static void start_code_search() {
i32 local_DEBUG_BITSTREAM;
HevcDecoder_Algo_Parser_flushBits(8, fifo);
local_DEBUG_BITSTREAM = HevcDecoder_Algo_Parser_DEBUG_BITSTREAM;
if (local_DEBUG_BITSTREAM) {
printf("start_code.search\n");
}
// Update ports indexes
}
static i32 isSchedulable_start_code_done() {
i32 result;
i32 tmp_IsStartCode;
i32 tmp_isFifoFull;
tmp_IsStartCode = HevcDecoder_Algo_Parser_IsStartCode(fifo);
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_IsStartCode && tmp_isFifoFull;
return result;
}
static void start_code_done() {
i32 local_DEBUG_BITSTREAM;
HevcDecoder_Algo_Parser_flushBits(8, fifo);
local_DEBUG_BITSTREAM = HevcDecoder_Algo_Parser_DEBUG_BITSTREAM;
if (local_DEBUG_BITSTREAM) {
printf("start_code.done\n");
}
// Update ports indexes
}
static i32 isSchedulable_read_nal_unit_header() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_nal_unit_header() {
u32 res[1];
i32 local_DEBUG_BITSTREAM;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
local_DEBUG_BITSTREAM = HevcDecoder_Algo_Parser_DEBUG_BITSTREAM;
if (local_DEBUG_BITSTREAM) {
printf("=========== NAL_UNIT ===========\n");
HevcDecoder_Algo_Parser_flushBits_name(1, fifo, "forbidden_zero_bit ");
HevcDecoder_Algo_Parser_vld_u_name(6, fifo, res, "nal_unit_type ");
tmp_res = res[0];
nal_unit_type = tmp_res;
HevcDecoder_Algo_Parser_flushBits_name(6, fifo, "nuh_reserved_zero_6bits ");
HevcDecoder_Algo_Parser_vld_u_name(3, fifo, res, "nuh_temporal_id_plus1 ");
} else {
HevcDecoder_Algo_Parser_flushBits(1, fifo);
HevcDecoder_Algo_Parser_vld_u(6, fifo, res);
tmp_res0 = res[0];
nal_unit_type = tmp_res0;
HevcDecoder_Algo_Parser_flushBits(6, fifo);
HevcDecoder_Algo_Parser_vld_u(3, fifo, res);
tmp_res1 = res[0];
temporal_id = tmp_res1 - 1;
}
se_idx = 1;
// Update ports indexes
}
static i32 isSchedulable_look_for_VPS_header() {
i32 result;
u8 local_nal_unit_type;
u8 local_NAL_VPS;
local_nal_unit_type = nal_unit_type;
local_NAL_VPS = HevcDecoder_Algo_Parser_NAL_VPS;
result = local_nal_unit_type == local_NAL_VPS;
return result;
}
static void look_for_VPS_header() {
i32 local_DEBUG_PARSER;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf("=========== Video Parameter Set ID: ===========\n");
}
// Update ports indexes
}
static i32 isSchedulable_look_for_SEI_header() {
i32 result;
u8 local_nal_unit_type;
u8 local_NAL_SEI_PREFIX;
u8 local_NAL_SEI_SUFFIX;
local_nal_unit_type = nal_unit_type;
local_NAL_SEI_PREFIX = HevcDecoder_Algo_Parser_NAL_SEI_PREFIX;
local_nal_unit_type = nal_unit_type;
local_NAL_SEI_SUFFIX = HevcDecoder_Algo_Parser_NAL_SEI_SUFFIX;
result = local_nal_unit_type == local_NAL_SEI_PREFIX || local_nal_unit_type == local_NAL_SEI_SUFFIX;
return result;
}
static void look_for_SEI_header() {
i32 local_DEBUG_PARSER;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf("=========== SEI message ===========\n");
}
// Update ports indexes
}
static i32 isSchedulable_look_for_SPS_header() {
i32 result;
u8 local_nal_unit_type;
u8 local_NAL_SPS;
local_nal_unit_type = nal_unit_type;
local_NAL_SPS = HevcDecoder_Algo_Parser_NAL_SPS;
result = local_nal_unit_type == local_NAL_SPS;
return result;
}
static void look_for_SPS_header() {
i32 local_DEBUG_PARSER;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf("=========== Sequence Parameter Set ID: ===========\n");
}
// Update ports indexes
}
static i32 isSchedulable_look_for_PPS_header() {
i32 result;
u8 local_nal_unit_type;
u8 local_NAL_PPS;
local_nal_unit_type = nal_unit_type;
local_NAL_PPS = HevcDecoder_Algo_Parser_NAL_PPS;
result = local_nal_unit_type == local_NAL_PPS;
return result;
}
static void look_for_PPS_header() {
i32 local_DEBUG_PARSER;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf("=========== Picture Parameter Set ID: ===========\n");
}
// Update ports indexes
}
static i32 isSchedulable_look_for_Slice_header() {
i32 result;
u8 local_nal_unit_type;
u8 local_NAL_TRAIL_R;
u8 local_NAL_TSA_N;
u8 local_NAL_TSA_R;
u8 local_NAL_TRAIL_N;
u8 local_NAL_STSA_N;
u8 local_NAL_STSA_R;
u8 local_NAL_RADL_N;
u8 local_NAL_RADL_R;
u8 local_NAL_RASL_N;
u8 local_NAL_RASL_R;
u8 local_NAL_IDR_N_LP;
u8 local_NAL_BLA_W_LP;
u8 local_NAL_BLA_W_RADL;
u8 local_NAL_BLA_N_LP;
u8 local_NAL_IDR_W_DLP;
u8 local_NAL_CRA_NUT;
local_nal_unit_type = nal_unit_type;
local_NAL_TRAIL_R = HevcDecoder_Algo_Parser_NAL_TRAIL_R;
local_nal_unit_type = nal_unit_type;
local_NAL_TSA_N = HevcDecoder_Algo_Parser_NAL_TSA_N;
local_nal_unit_type = nal_unit_type;
local_NAL_TSA_R = HevcDecoder_Algo_Parser_NAL_TSA_R;
local_nal_unit_type = nal_unit_type;
local_NAL_TRAIL_N = HevcDecoder_Algo_Parser_NAL_TRAIL_N;
local_nal_unit_type = nal_unit_type;
local_NAL_STSA_N = HevcDecoder_Algo_Parser_NAL_STSA_N;
local_nal_unit_type = nal_unit_type;
local_NAL_STSA_R = HevcDecoder_Algo_Parser_NAL_STSA_R;
local_nal_unit_type = nal_unit_type;
local_NAL_RADL_N = HevcDecoder_Algo_Parser_NAL_RADL_N;
local_nal_unit_type = nal_unit_type;
local_NAL_RADL_R = HevcDecoder_Algo_Parser_NAL_RADL_R;
local_nal_unit_type = nal_unit_type;
local_NAL_RASL_N = HevcDecoder_Algo_Parser_NAL_RASL_N;
local_nal_unit_type = nal_unit_type;
local_NAL_RASL_R = HevcDecoder_Algo_Parser_NAL_RASL_R;
local_nal_unit_type = nal_unit_type;
local_NAL_IDR_N_LP = HevcDecoder_Algo_Parser_NAL_IDR_N_LP;
local_nal_unit_type = nal_unit_type;
local_NAL_BLA_W_LP = HevcDecoder_Algo_Parser_NAL_BLA_W_LP;
local_nal_unit_type = nal_unit_type;
local_NAL_BLA_W_RADL = HevcDecoder_Algo_Parser_NAL_BLA_W_RADL;
local_nal_unit_type = nal_unit_type;
local_NAL_BLA_N_LP = HevcDecoder_Algo_Parser_NAL_BLA_N_LP;
local_nal_unit_type = nal_unit_type;
local_NAL_IDR_W_DLP = HevcDecoder_Algo_Parser_NAL_IDR_W_DLP;
local_nal_unit_type = nal_unit_type;
local_NAL_CRA_NUT = HevcDecoder_Algo_Parser_NAL_CRA_NUT;
local_nal_unit_type = nal_unit_type;
local_NAL_RASL_R = HevcDecoder_Algo_Parser_NAL_RASL_R;
result = local_nal_unit_type == local_NAL_TRAIL_R || local_nal_unit_type == local_NAL_TSA_N || local_nal_unit_type == local_NAL_TSA_R || local_nal_unit_type == local_NAL_TRAIL_N || local_nal_unit_type == local_NAL_STSA_N || local_nal_unit_type == local_NAL_STSA_R || local_nal_unit_type == local_NAL_RADL_N || local_nal_unit_type == local_NAL_RADL_R || local_nal_unit_type == local_NAL_RASL_N || local_nal_unit_type == local_NAL_RASL_R || local_nal_unit_type == local_NAL_IDR_N_LP || local_nal_unit_type == local_NAL_BLA_W_LP || local_nal_unit_type == local_NAL_BLA_W_RADL || local_nal_unit_type == local_NAL_BLA_N_LP || local_nal_unit_type == local_NAL_IDR_W_DLP || local_nal_unit_type == local_NAL_CRA_NUT || local_nal_unit_type == local_NAL_RASL_R;
return result;
}
static void look_for_Slice_header() {
i32 local_DEBUG_PARSER;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf("=========== Slice ===========\n");
}
// Update ports indexes
}
static i32 isSchedulable_look_for_other_header() {
i32 result;
result = 1;
return result;
}
static void look_for_other_header() {
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_1() {
u32 res[1];
u8 local_video_sequence_id;
u32 tmp_res;
u16 local_se_idx;
local_video_sequence_id = video_sequence_id;
video_sequence_id = local_video_sequence_id + 1;
HevcDecoder_Algo_Parser_vld_u_name(4, fifo, res, "vps_video_parameter_set_id ");
HevcDecoder_Algo_Parser_vld_u_name(2, fifo, res, "vps_reserved_three_2bits ");
HevcDecoder_Algo_Parser_vld_u_name(6, fifo, res, "vps_reserved_zero_6bits ");
HevcDecoder_Algo_Parser_vld_u_name(3, fifo, res, "vps_max_sub_layers_minus1 ");
tmp_res = res[0];
vps_max_sub_layers_minus1 = tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "vps_temporal_id_nesting_flag ");
HevcDecoder_Algo_Parser_vld_u_name(16, fifo, res, "vps_reserved_ffff_16bits ");
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 2 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_2() {
i32 profile_present_flag;
u32 res[1];
i32 i;
u16 local_se_idx;
profile_present_flag = 1;
if (profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(2, fifo, res, "XXX_profile_space[] ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "XXX_tier_flag[] ");
HevcDecoder_Algo_Parser_vld_u_name(5, fifo, res, "XXX_profile_idc[] ");
i = 0;
while (i <= 31) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "XXX_profile_compatibility_flag[][j] ");
i = i + 1;
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_progressive_source_flag ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_interlaced_source_flag ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_non_packed_constraint_flag ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_frame_only_constraint_flag ");
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_3() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 3 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_3() {
i32 profile_present_flag;
u32 res[1];
u16 local_se_idx;
profile_present_flag = 1;
if (profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(16, fifo, res, "XXX_reserved_zero_44bits[0..15] ");
HevcDecoder_Algo_Parser_vld_u_name(16, fifo, res, "XXX_reserved_zero_44bits[16..31] ");
HevcDecoder_Algo_Parser_vld_u_name(12, fifo, res, "XXX_reserved_zero_44bits[32..43] ");
}
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "general_level_idc ");
cnt_i = 0;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_4_loop1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_vps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
result = local_se_idx == 4 && tmp_isFifoFull && local_cnt_i < local_vps_max_sub_layers_minus1;
return result;
}
static void read_VPS_Header_se_idx_4_loop1() {
u32 res[1];
i32 local_profile_present_flag;
u32 tmp_res;
u32 tmp_res0;
u32 local_cnt_i;
res[0] = 0;
local_profile_present_flag = profile_present_flag;
if (local_profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_profile_present_flag[i] ");
}
tmp_res = res[0];
sub_layer_profile_present_flag = tmp_res == 1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_level_present_flag[i] ");
tmp_res0 = res[0];
sub_layer_level_present_flag = tmp_res0 == 1;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_4_insertedCond() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 40 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_4_insertedCond() {
u8 local_vps_max_sub_layers_minus1;
i32 k;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
if (local_vps_max_sub_layers_minus1 > 0) {
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
k = local_vps_max_sub_layers_minus1;
while (k <= 7) {
HevcDecoder_Algo_Parser_flushBits_name(2, fifo, "reserved_zero_2bits[ i ] ");
k = k + 1;
}
}
se_idx = 41;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_4_loop2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_vps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
result = local_se_idx == 41 && tmp_isFifoFull && local_cnt_i < local_vps_max_sub_layers_minus1;
return result;
}
static void read_VPS_Header_se_idx_4_loop2() {
u32 res[1];
i32 local_profile_present_flag;
i32 local_sub_layer_profile_present_flag;
i32 j;
i32 local_sub_layer_level_present_flag;
u32 local_cnt_i;
local_profile_present_flag = profile_present_flag;
local_sub_layer_profile_present_flag = sub_layer_profile_present_flag;
if (local_profile_present_flag && local_sub_layer_profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(2, fifo, res, "sub_layer_profile_space[i] ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_tier_flag[i] ");
HevcDecoder_Algo_Parser_vld_u_name(5, fifo, res, "sub_layer_profile_idc[i] ");
j = 0;
while (j <= 31) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_profile_compatibility_flags[i][j]");
j = j + 1;
}
HevcDecoder_Algo_Parser_flushBits_name(16, fifo, "sub_layer_reserved_zero_16bits[i] ");
}
local_sub_layer_level_present_flag = sub_layer_level_present_flag;
if (local_sub_layer_level_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_level_idc[i] ");
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_4_loop1End() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u8 local_vps_max_sub_layers_minus1;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
result = local_se_idx == 4 && local_cnt_i == local_vps_max_sub_layers_minus1;
return result;
}
static void read_VPS_Header_se_idx_4_loop1End() {
cnt_i = 0;
se_idx = 40;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_4_loop2End() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u8 local_vps_max_sub_layers_minus1;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
result = local_se_idx == 41 && local_cnt_i == local_vps_max_sub_layers_minus1;
return result;
}
static void read_VPS_Header_se_idx_4_loop2End() {
se_idx = 42;
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_4_decodeInfoPresentFlag() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 42 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_4_decodeInfoPresentFlag() {
u32 res[1];
u32 tmp_res;
u8 local_vps_max_sub_layers_minus1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "vps_sub_layer_ordering_info_present_flag");
tmp_res = res[0];
if (tmp_res == 1) {
cnt_i = 0;
} else {
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
cnt_i = local_vps_max_sub_layers_minus1;
}
se_idx = 5;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_5_loop11() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_vps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
result = local_se_idx == 5 && tmp_isFifoFull && local_cnt_i < local_vps_max_sub_layers_minus1 + 1;
return result;
}
static void read_VPS_Header_se_idx_5_loop11() {
i32 res[1];
u32 local_cnt_i;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "vps_max_dec_pic_buffering[i] ");
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "vps_num_reorder_pics[i] ");
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "vps_max_latency_increase[i] ");
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_5_loopEnd() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_vps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_max_sub_layers_minus1 = vps_max_sub_layers_minus1;
result = local_se_idx == 5 && tmp_isFifoFull && local_cnt_i == local_vps_max_sub_layers_minus1 + 1;
return result;
}
static void read_VPS_Header_se_idx_5_loopEnd() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u16 local_vps_num_op_sets_minus1;
HevcDecoder_Algo_Parser_vld_u_name(6, fifo, res, "vps_max_nuh_reserved_zero_layer_id ");
tmp_res = res[0];
vps_max_nuh_reserved_zero_layer_id = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "vps_max_op_sets_minus1 ");
tmp_res0 = res[0];
vps_num_op_sets_minus1 = tmp_res0;
cnt_i = 1;
local_vps_num_op_sets_minus1 = vps_num_op_sets_minus1;
cnt_i = local_vps_num_op_sets_minus1 + 1;
se_idx = 6;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_6_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_vps_num_op_sets_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_num_op_sets_minus1 = vps_num_op_sets_minus1;
result = local_se_idx == 6 && tmp_isFifoFull && local_cnt_i <= local_vps_num_op_sets_minus1;
return result;
}
static void read_VPS_Header_se_idx_6_loop() {
u32 res[1];
i8 i;
u8 local_vps_max_nuh_reserved_zero_layer_id;
u32 local_cnt_i;
i = 0;
local_vps_max_nuh_reserved_zero_layer_id = vps_max_nuh_reserved_zero_layer_id;
while (i <= local_vps_max_nuh_reserved_zero_layer_id - 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "layer_id_included_flag[][i] ");
i = i + 1;
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_6_loopEnd() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_vps_num_op_sets_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_num_op_sets_minus1 = vps_num_op_sets_minus1;
result = local_se_idx == 6 && tmp_isFifoFull && local_cnt_i == local_vps_num_op_sets_minus1 + 1;
return result;
}
static void read_VPS_Header_se_idx_6_loopEnd() {
u32 res[1];
u32 tmp_res;
u8 local_vps_timing_info_present_flag;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "vps_timing_info_present_flag ");
tmp_res = res[0];
vps_timing_info_present_flag = tmp_res;
local_vps_timing_info_present_flag = vps_timing_info_present_flag;
if (local_vps_timing_info_present_flag == 1) {
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
} else {
se_idx = 10;
}
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_7() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 7 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_7() {
u32 res[1];
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(32, fifo, res, "vps_num_units_in_tick ");
HevcDecoder_Algo_Parser_vld_u_name(32, fifo, res, "vps_time_scale ");
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_8() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 8 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_se_idx_8() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "vps_poc_proportional_to_timing_flag ");
tmp_res = res[0];
if (tmp_res == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "vps_num_ticks_poc_diff_one_minus1 ");
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "vps_num_hrd_parameters ");
tmp_res0 = res[0];
vps_num_hrd_parameters = tmp_res0;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_9_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_vps_num_hrd_parameters;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_vps_num_hrd_parameters = vps_num_hrd_parameters;
result = local_se_idx == 9 && tmp_isFifoFull && local_cnt_i < local_vps_num_hrd_parameters;
return result;
}
static void read_VPS_Header_se_idx_9_loop() {
u32 res[1];
u8 cprms_present_flag;
u32 local_cnt_i;
cprms_present_flag = 0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "hrd_op_set_idx[i] ");
local_cnt_i = cnt_i;
if (local_cnt_i > 0) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "cprms_present_flag[i] ");
cprms_present_flag = res[0];
}
if (cprms_present_flag == 1) {
printf("not support for vps_num_hrd_parameters != 0\n");
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_se_idx_9_loopEnd() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u16 local_vps_num_hrd_parameters;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_vps_num_hrd_parameters = vps_num_hrd_parameters;
result = local_se_idx == 9 && local_cnt_i == local_vps_num_hrd_parameters;
return result;
}
static void read_VPS_Header_se_idx_9_loopEnd() {
u16 local_se_idx;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_VPS_Header_done() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 10 && tmp_isFifoFull;
return result;
}
static void read_VPS_Header_done() {
u32 res[1];
u32 tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "vps_extension_flag ");
tmp_res = res[0];
if (tmp_res == 1) {
printf("not support for vps_extension_flag != 0\n");
}
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_init() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_SEI_Header_init() {
u16 local_se_idx;
sei_payloadType = 0;
sei_payloadSize = 0;
sei_payloadPosition = 0;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
sei_idx = 1;
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_payload_type() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 2 && tmp_isFifoFull;
return result;
}
static void read_SEI_Header_payload_type() {
u32 res[1];
u16 local_sei_payloadType;
u32 tmp_res;
u32 tmp_res0;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "payload_type ");
local_sei_payloadType = sei_payloadType;
tmp_res = res[0];
sei_payloadType = local_sei_payloadType + tmp_res;
tmp_res0 = res[0];
if (tmp_res0 != 255) {
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
} else {
se_idx = 6;
}
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_payload_size() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 3 && tmp_isFifoFull;
return result;
}
static void read_SEI_Header_payload_size() {
u32 res[1];
u16 local_sei_payloadSize;
u32 tmp_res;
u32 tmp_res0;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "payload_size ");
local_sei_payloadSize = sei_payloadSize;
tmp_res = res[0];
sei_payloadSize = local_sei_payloadSize + tmp_res;
tmp_res0 = res[0];
if (tmp_res0 != 255) {
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
} else {
se_idx = 6;
}
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_skipSEI() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u8 local_sei_idx;
u16 local_sei_payloadType;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sei_idx = sei_idx;
local_sei_payloadType = sei_payloadType;
result = local_se_idx == 4 && tmp_isFifoFull && (local_sei_idx == 1 && local_sei_payloadType != 132);
return result;
}
static void read_SEI_Header_skipSEI() {
se_idx = 6;
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_decoded_picture_hash_init() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u8 local_sei_idx;
u16 local_sei_payloadType;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sei_idx = sei_idx;
local_sei_payloadType = sei_payloadType;
result = local_se_idx == 4 && tmp_isFifoFull && (local_sei_idx == 1 && local_sei_payloadType == 132);
return result;
}
static void read_SEI_Header_decoded_picture_hash_init() {
u32 res[1];
i32 local_DEBUG_PARSER;
u16 local_sei_payloadPosition;
u32 tmp_res;
u8 local_sei_idx;
local_DEBUG_PARSER = HevcDecoder_Algo_Parser_DEBUG_PARSER;
if (local_DEBUG_PARSER) {
printf("=========== Decoded picture hash SEI message ===========\n");
}
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "hash_type ");
local_sei_payloadPosition = sei_payloadPosition;
sei_payloadPosition = local_sei_payloadPosition + 8;
tmp_res = res[0];
sei_hash_type = tmp_res;
sei_cIdx = 0;
sei_i = 0;
local_sei_idx = sei_idx;
sei_idx = local_sei_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_decoded_picture_hash_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u8 local_sei_idx;
u16 local_sei_payloadType;
u8 local_sei_cIdx;
u8 local_sei_i;
u8 local_sei_hash_type;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sei_idx = sei_idx;
local_sei_payloadType = sei_payloadType;
local_sei_cIdx = sei_cIdx;
local_sei_i = sei_i;
local_sei_hash_type = sei_hash_type;
result = local_se_idx == 4 && tmp_isFifoFull && (local_sei_idx == 2 && local_sei_payloadType == 132) && local_sei_cIdx < 3 && local_sei_i < 16 && local_sei_hash_type == 0;
return result;
}
static void read_SEI_Header_decoded_picture_hash_loop() {
u32 res[1];
u16 local_sei_payloadPosition;
u8 local_sei_i;
u8 local_sei_cIdx;
u16 local_se_idx;
u32 tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "picture_md5 ");
local_sei_payloadPosition = sei_payloadPosition;
sei_payloadPosition = local_sei_payloadPosition + 8;
local_sei_i = sei_i;
sei_i = local_sei_i + 1;
local_sei_i = sei_i;
if (local_sei_i == 16) {
sei_i = 0;
local_sei_cIdx = sei_cIdx;
sei_cIdx = local_sei_cIdx + 1;
local_sei_cIdx = sei_cIdx;
if (local_sei_cIdx == 3) {
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
}
}
tmp_res = res[0];
tokens_SEI_MD5[(index_SEI_MD5 + (0)) % SIZE_SEI_MD5] = tmp_res;
// Update ports indexes
index_SEI_MD5 += 1;
}
static i32 isSchedulable_read_SEI_Header_decoded_picture_hash_skip() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u8 local_sei_idx;
u16 local_sei_payloadType;
u8 local_sei_cIdx;
u8 local_sei_i;
u8 local_sei_hash_type;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sei_idx = sei_idx;
local_sei_payloadType = sei_payloadType;
local_sei_cIdx = sei_cIdx;
local_sei_i = sei_i;
local_sei_hash_type = sei_hash_type;
result = local_se_idx == 4 && tmp_isFifoFull && (local_sei_idx == 2 && local_sei_payloadType == 132) && local_sei_cIdx < 3 && local_sei_i < 16 && local_sei_hash_type != 0;
return result;
}
static void read_SEI_Header_decoded_picture_hash_skip() {
u32 res[1];
u8 local_sei_hash_type;
u16 local_sei_payloadPosition;
u8 local_sei_i;
u8 local_sei_cIdx;
u16 local_se_idx;
printf("no support for crc or checksum ! (support only md5)\n");
local_sei_hash_type = sei_hash_type;
if (local_sei_hash_type == 1) {
HevcDecoder_Algo_Parser_vld_u_name(16, fifo, res, "picture_crc ");
local_sei_payloadPosition = sei_payloadPosition;
sei_payloadPosition = local_sei_payloadPosition + 16;
sei_i = 16;
} else {
local_sei_hash_type = sei_hash_type;
if (local_sei_hash_type == 2) {
HevcDecoder_Algo_Parser_vld_u_name(32, fifo, res, "picture_checksum ");
local_sei_payloadPosition = sei_payloadPosition;
sei_payloadPosition = local_sei_payloadPosition + 32;
sei_i = 16;
}
}
local_sei_i = sei_i;
if (local_sei_i == 16) {
sei_i = 0;
local_sei_cIdx = sei_cIdx;
sei_cIdx = local_sei_cIdx + 1;
local_sei_cIdx = sei_cIdx;
if (local_sei_cIdx == 3) {
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
}
}
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_sei_payload_end() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 5 && tmp_isFifoFull;
return result;
}
static void read_SEI_Header_sei_payload_end() {
u32 res[1];
i32 tmp_isByteAlign;
u16 local_sei_payloadPosition;
u16 local_sei_payloadSize;
i32 tmp_isByteAlign0;
u16 local_se_idx;
tmp_isByteAlign = HevcDecoder_Algo_Parser_isByteAlign(fifo);
local_sei_payloadPosition = sei_payloadPosition;
local_sei_payloadSize = sei_payloadSize;
if (!(tmp_isByteAlign && local_sei_payloadPosition == local_sei_payloadSize << 3)) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "bit_equal_to_one ");
tmp_isByteAlign0 = HevcDecoder_Algo_Parser_isByteAlign(fifo);
while (!tmp_isByteAlign0) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "bit_equal_to_zero ");
tmp_isByteAlign0 = HevcDecoder_Algo_Parser_isByteAlign(fifo);
}
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SEI_Header_done() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 6 && tmp_isFifoFull;
return result;
}
static void read_SEI_Header_done() {
u32 res[1];
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "rbsp_trailing_bits");
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_1() {
u32 res[1];
u16 local_sps_id;
u32 tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(4, fifo, res, "sps_video_parameter_set_id ");
HevcDecoder_Algo_Parser_vld_u_name(3, fifo, res, "sps_max_sub_layers_minus1 ");
local_sps_id = sps_id;
tmp_res = res[0];
sps_max_sub_layers_minus1[local_sps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_temporal_id_nesting_flag ");
se_idx = 20;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_20() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 20 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_20() {
i32 profile_present_flag;
u32 res[1];
i32 i;
u16 local_se_idx;
profile_present_flag = 1;
if (profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(2, fifo, res, "XXX_profile_space[] ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "XXX_tier_flag[] ");
HevcDecoder_Algo_Parser_vld_u_name(5, fifo, res, "XXX_profile_idc[] ");
i = 0;
while (i <= 31) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "XXX_profile_compatibility_flag[][j] ");
i = i + 1;
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_progressive_source_flag ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_interlaced_source_flag ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_non_packed_constraint_flag ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "general_frame_only_constraint_flag ");
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_21() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 21 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_21() {
i32 profile_present_flag;
u32 res[1];
u16 local_se_idx;
profile_present_flag = 1;
if (profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(16, fifo, res, "XXX_reserved_zero_44bits[0..15] ");
HevcDecoder_Algo_Parser_vld_u_name(16, fifo, res, "XXX_reserved_zero_44bits[16..31] ");
HevcDecoder_Algo_Parser_vld_u_name(12, fifo, res, "XXX_reserved_zero_44bits[32..43] ");
}
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "general_level_idc ");
cnt_i = 0;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_22_loop1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
result = local_se_idx == 22 && tmp_isFifoFull && local_cnt_i < tmp_sps_max_sub_layers_minus1;
return result;
}
static void read_SPS_Header_se_idx_22_loop1() {
u32 res[1];
i32 local_sps_profile_present_flag;
u32 tmp_res;
u32 tmp_res0;
u32 local_cnt_i;
res[0] = 0;
local_sps_profile_present_flag = sps_profile_present_flag;
if (local_sps_profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_profile_present_flag[i] ");
}
tmp_res = res[0];
sps_sub_layer_profile_present_flag = tmp_res == 1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_level_present_flag[i] ");
tmp_res0 = res[0];
sps_sub_layer_level_present_flag = tmp_res0 == 1;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_22_loopEnd1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
result = local_se_idx == 22 && tmp_isFifoFull && local_cnt_i == tmp_sps_max_sub_layers_minus1;
return result;
}
static void read_SPS_Header_se_idx_22_loopEnd1() {
cnt_i = 0;
se_idx = 221;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_22_indertedCond() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 221 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_22_indertedCond() {
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
i32 i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
if (tmp_sps_max_sub_layers_minus1 > 0) {
local_sps_id = sps_id;
i = sps_max_sub_layers_minus1[local_sps_id];
while (i <= 7) {
HevcDecoder_Algo_Parser_flushBits_name(2, fifo, "reserved_zero_2bits[i] ");
i = i + 1;
}
}
se_idx = 222;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_22_loop2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
result = local_se_idx == 222 && tmp_isFifoFull && local_cnt_i < tmp_sps_max_sub_layers_minus1;
return result;
}
static void read_SPS_Header_se_idx_22_loop2() {
u32 res[1];
i32 local_sps_profile_present_flag;
i32 local_sps_sub_layer_profile_present_flag;
i32 j;
i32 local_sps_sub_layer_level_present_flag;
u32 local_cnt_i;
local_sps_profile_present_flag = sps_profile_present_flag;
local_sps_sub_layer_profile_present_flag = sps_sub_layer_profile_present_flag;
if (local_sps_profile_present_flag && local_sps_sub_layer_profile_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(2, fifo, res, "sub_layer_profile_space[i] ");
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_tier_flag[i] ");
HevcDecoder_Algo_Parser_vld_u_name(5, fifo, res, "sub_layer_profile_idc[i] ");
j = 0;
while (j <= 31) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_profile_compatibility_flags[i][j]");
j = j + 1;
}
HevcDecoder_Algo_Parser_flushBits_name(16, fifo, "sub_layer_reserved_zero_16bits[i] ");
}
local_sps_sub_layer_level_present_flag = sps_sub_layer_level_present_flag;
if (local_sps_sub_layer_level_present_flag) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sub_layer_level_idc[i] ");
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_22_loopEnd() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
result = local_se_idx == 222 && tmp_isFifoFull && local_cnt_i == tmp_sps_max_sub_layers_minus1;
return result;
}
static void read_SPS_Header_se_idx_22_loopEnd() {
se_idx = 11;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_1_1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 11 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_1_1() {
u32 res[1];
u32 tmp_res;
u16 local_sps_id;
u32 tmp_res0;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "sps_seq_parameter_set_id ");
tmp_res = res[0];
sps_id = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "chroma_format_idc ");
local_sps_id = sps_id;
tmp_res0 = res[0];
sps_chroma_format_idc[local_sps_id] = tmp_res0;
tmp_res1 = res[0];
if (tmp_res1 == 3) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "separate_colour_plane_flag ");
local_sps_id = sps_id;
tmp_res2 = res[0];
sps_separate_colour_plane_flag[local_sps_id] = tmp_res2;
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "pic_width_in_luma_samples ");
local_sps_id = sps_id;
tmp_res3 = res[0];
sps_pic_width_in_luma_samples[local_sps_id] = tmp_res3;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "pic_height_in_luma_samples ");
local_sps_id = sps_id;
tmp_res4 = res[0];
sps_pic_height_in_luma_samples[local_sps_id] = tmp_res4;
se_idx = 2;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 2 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_2() {
u32 res[1];
u8 conformance_window_flag;
u16 local_sps_id;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u8 tmp_sps_log2_max_pic_order_cnt_lsb_minus4;
u32 tmp_res2;
u8 tmp_sps_max_sub_layers_minus1;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "conformance_window_flag ");
conformance_window_flag = res[0];
if (conformance_window_flag == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "conf_win_left_offset ");
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "conf_win_right_offset ");
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "conf_win_top_offset ");
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "conf_win_bottom_offset ");
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "sps_bit_depth_luma_minus8 ");
local_sps_id = sps_id;
tmp_res = res[0];
sps_bit_depth_luma_minus8[local_sps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "sps_bit_depth_chroma_minus8 ");
local_sps_id = sps_id;
tmp_res0 = res[0];
sps_bit_depth_chroma_minus8[local_sps_id] = tmp_res0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_max_pic_order_cnt_lsb_minus4 ");
local_sps_id = sps_id;
tmp_res1 = res[0];
sps_log2_max_pic_order_cnt_lsb_minus4[local_sps_id] = tmp_res1;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_log2_max_pic_order_cnt_lsb_minus4 = sps_log2_max_pic_order_cnt_lsb_minus4[local_sps_id];
max_poc_lsb[local_sps_id] = 1 << (tmp_sps_log2_max_pic_order_cnt_lsb_minus4 + 4);
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_sub_layer_ordering_info_present_flag");
tmp_res2 = res[0];
if (tmp_res2 == 1) {
cnt_i = 0;
} else {
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
cnt_i = tmp_sps_max_sub_layers_minus1;
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_3_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
result = local_se_idx == 3 && tmp_isFifoFull && local_cnt_i <= tmp_sps_max_sub_layers_minus1;
return result;
}
static void read_SPS_Header_se_idx_3_loop() {
u32 res[1];
u16 local_sps_id;
u32 tmp_res;
u32 local_cnt_i;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "sps_max_dec_pic_buffering ");
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "sps_num_reorder_pics ");
local_sps_id = sps_id;
tmp_res = res[0];
sps_num_reorder_pics[local_sps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "sps_max_latency_increase ");
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_3_loopEnd() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_max_sub_layers_minus1;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_max_sub_layers_minus1 = sps_max_sub_layers_minus1[local_sps_id];
result = local_se_idx == 3 && local_cnt_i == tmp_sps_max_sub_layers_minus1 + 1;
return result;
}
static void read_SPS_Header_se_idx_3_loopEnd() {
u16 local_se_idx;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_4() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 4 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_4() {
u32 res[1];
u16 local_sps_id;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 tmp_res2;
u8 local_Log2MinCbSize;
u8 tmp_sps_log2_diff_max_min_coding_block_size;
u16 tmp_sps_maxCUWidth;
u8 tmp_sps_log2_diff_max_min_coding_block_size0;
u8 tmp_sps_log2_min_transform_block_size;
u8 tmp_sps_log2_diff_max_min_coding_block_size1;
u16 tmp_sps_addCUDepth;
u8 tmp_sps_log2_min_coding_block_size;
u16 tmp_sps_pic_width_in_luma_samples;
u8 tmp_sps_log2_min_pu_size;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_min_coding_block_size_minus3 ");
local_sps_id = sps_id;
tmp_res = res[0];
sps_log2_min_coding_block_size[local_sps_id] = tmp_res + 3;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_diff_max_min_coding_block_size ");
local_sps_id = sps_id;
tmp_res0 = res[0];
sps_log2_diff_max_min_coding_block_size[local_sps_id] = tmp_res0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_min_transform_block_size_minus2 ");
local_sps_id = sps_id;
tmp_res1 = res[0];
sps_log2_min_transform_block_size[local_sps_id] = tmp_res1 + 2;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_diff_max_min_transform_block_size ");
local_sps_id = sps_id;
tmp_res2 = res[0];
sps_log2_diff_max_min_transform_block_size[local_sps_id] = tmp_res2;
local_sps_id = sps_id;
local_Log2MinCbSize = Log2MinCbSize;
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size = sps_log2_diff_max_min_coding_block_size[local_sps_id];
sps_maxCUWidth[local_sps_id] = 1 << (local_Log2MinCbSize + tmp_sps_log2_diff_max_min_coding_block_size);
local_sps_id = sps_id;
sps_addCUDepth[local_sps_id] = 0;
local_sps_id = sps_id;
tmp_sps_maxCUWidth = sps_maxCUWidth[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size0 = sps_log2_diff_max_min_coding_block_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_min_transform_block_size = sps_log2_min_transform_block_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size1 = sps_log2_diff_max_min_coding_block_size[local_sps_id];
while (tmp_sps_maxCUWidth >> tmp_sps_log2_diff_max_min_coding_block_size0 > 1 << (tmp_sps_log2_min_transform_block_size + tmp_sps_log2_diff_max_min_coding_block_size1)) {
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_addCUDepth = sps_addCUDepth[local_sps_id];
sps_addCUDepth[local_sps_id] = tmp_sps_addCUDepth + 1;
local_sps_id = sps_id;
tmp_sps_maxCUWidth = sps_maxCUWidth[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size0 = sps_log2_diff_max_min_coding_block_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_min_transform_block_size = sps_log2_min_transform_block_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size1 = sps_log2_diff_max_min_coding_block_size[local_sps_id];
}
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_log2_min_coding_block_size = sps_log2_min_coding_block_size[local_sps_id];
sps_log2_min_pu_size[local_sps_id] = tmp_sps_log2_min_coding_block_size - 1;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_min_pu_size = sps_log2_min_pu_size[local_sps_id];
sps_min_pu_width[local_sps_id] = tmp_sps_pic_width_in_luma_samples >> tmp_sps_log2_min_pu_size;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_5() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 5 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_5() {
u32 res[1];
u16 local_sps_id;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u16 tmp_sps_pic_width_in_luma_samples;
u8 tmp_sps_log2_min_coding_block_size;
u8 tmp_sps_log2_min_coding_block_size0;
u8 tmp_sps_log2_diff_max_min_coding_block_size;
u16 tmp_sps_pic_width_in_luma_samples0;
u16 tmp_sps_log2_ctb_size;
u16 tmp_sps_log2_ctb_size0;
u16 tmp_sps_pic_height_in_luma_samples;
u16 tmp_sps_log2_ctb_size1;
u16 tmp_sps_log2_ctb_size2;
u8 tmp_sps_scaling_list_enabled_flag;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "max_transform_hierarchy_depth_inter ");
local_sps_id = sps_id;
tmp_res = res[0];
sps_max_transform_hierarchy_depth_inter[local_sps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "max_transform_hierarchy_depth_intra ");
local_sps_id = sps_id;
tmp_res0 = res[0];
sps_max_transform_hierarchy_depth_intra[local_sps_id] = tmp_res0;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_scaling_list_enabled_flag ");
local_sps_id = sps_id;
tmp_res1 = res[0];
sps_scaling_list_enabled_flag[local_sps_id] = tmp_res1;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_min_coding_block_size = sps_log2_min_coding_block_size[local_sps_id];
min_cb_width = tmp_sps_pic_width_in_luma_samples >> tmp_sps_log2_min_coding_block_size;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_log2_min_coding_block_size0 = sps_log2_min_coding_block_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size = sps_log2_diff_max_min_coding_block_size[local_sps_id];
sps_log2_ctb_size[local_sps_id] = tmp_sps_log2_min_coding_block_size0 + tmp_sps_log2_diff_max_min_coding_block_size;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples0 = sps_pic_width_in_luma_samples[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_ctb_size = sps_log2_ctb_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_ctb_size0 = sps_log2_ctb_size[local_sps_id];
sps_ctb_width[local_sps_id] = (tmp_sps_pic_width_in_luma_samples0 + (1 << tmp_sps_log2_ctb_size) - 1) >> tmp_sps_log2_ctb_size0;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_ctb_size1 = sps_log2_ctb_size[local_sps_id];
local_sps_id = sps_id;
tmp_sps_log2_ctb_size2 = sps_log2_ctb_size[local_sps_id];
sps_ctb_height[local_sps_id] = (tmp_sps_pic_height_in_luma_samples + (1 << tmp_sps_log2_ctb_size1) - 1) >> tmp_sps_log2_ctb_size2;
local_sps_id = sps_id;
tmp_sps_scaling_list_enabled_flag = sps_scaling_list_enabled_flag[local_sps_id];
if (tmp_sps_scaling_list_enabled_flag == 1) {
se_idx = 60;
} else {
se_idx = 6;
}
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_60() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 60 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_60() {
u32 res[1];
u8 sps_scaling_list_data_present_flag;
i32 matrixId;
i32 i;
u16 local_sps_id;
i32 i0;
u8 tmp_default_scaling_list_intra;
u8 tmp_default_scaling_list_intra0;
u8 tmp_default_scaling_list_intra1;
u8 tmp_default_scaling_list_inter;
u8 tmp_default_scaling_list_inter0;
u8 tmp_default_scaling_list_inter1;
u8 tmp_default_scaling_list_intra2;
u8 tmp_default_scaling_list_intra3;
u8 tmp_default_scaling_list_intra4;
u8 tmp_default_scaling_list_inter2;
u8 tmp_default_scaling_list_inter3;
u8 tmp_default_scaling_list_inter4;
u8 tmp_default_scaling_list_intra5;
u8 tmp_default_scaling_list_inter5;
matrixId = 0;
while (matrixId <= 5) {
i = 0;
while (i <= 15) {
local_sps_id = sps_id;
sps_sl[local_sps_id][0][matrixId][i] = 16;
i = i + 1;
}
local_sps_id = sps_id;
sps_sl_dc[local_sps_id][0][matrixId] = 16;
local_sps_id = sps_id;
sps_sl_dc[local_sps_id][1][matrixId] = 16;
matrixId = matrixId + 1;
}
i0 = 0;
while (i0 <= 63) {
local_sps_id = sps_id;
tmp_default_scaling_list_intra = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][1][0][i0] = tmp_default_scaling_list_intra;
local_sps_id = sps_id;
tmp_default_scaling_list_intra0 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][1][1][i0] = tmp_default_scaling_list_intra0;
local_sps_id = sps_id;
tmp_default_scaling_list_intra1 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][1][2][i0] = tmp_default_scaling_list_intra1;
local_sps_id = sps_id;
tmp_default_scaling_list_inter = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][1][3][i0] = tmp_default_scaling_list_inter;
local_sps_id = sps_id;
tmp_default_scaling_list_inter0 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][1][4][i0] = tmp_default_scaling_list_inter0;
local_sps_id = sps_id;
tmp_default_scaling_list_inter1 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][1][5][i0] = tmp_default_scaling_list_inter1;
local_sps_id = sps_id;
tmp_default_scaling_list_intra2 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][2][0][i0] = tmp_default_scaling_list_intra2;
local_sps_id = sps_id;
tmp_default_scaling_list_intra3 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][2][1][i0] = tmp_default_scaling_list_intra3;
local_sps_id = sps_id;
tmp_default_scaling_list_intra4 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][2][2][i0] = tmp_default_scaling_list_intra4;
local_sps_id = sps_id;
tmp_default_scaling_list_inter2 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][2][3][i0] = tmp_default_scaling_list_inter2;
local_sps_id = sps_id;
tmp_default_scaling_list_inter3 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][2][4][i0] = tmp_default_scaling_list_inter3;
local_sps_id = sps_id;
tmp_default_scaling_list_inter4 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][2][5][i0] = tmp_default_scaling_list_inter4;
local_sps_id = sps_id;
tmp_default_scaling_list_intra5 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
sps_sl[local_sps_id][3][0][i0] = tmp_default_scaling_list_intra5;
local_sps_id = sps_id;
tmp_default_scaling_list_inter5 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
sps_sl[local_sps_id][3][1][i0] = tmp_default_scaling_list_inter5;
i0 = i0 + 1;
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_scaling_list_data_present_flag ");
sps_scaling_list_data_present_flag = res[0];
if (sps_scaling_list_data_present_flag == 1) {
se_idx = 61;
} else {
se_idx = 6;
}
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_61_loopSize_id() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_sps_size_id;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_size_id = sps_size_id;
result = local_se_idx == 61 && tmp_isFifoFull && local_sps_size_id < 4;
return result;
}
static void read_SPS_Header_se_idx_61_loopSize_id() {
i32 local_sps_size_id;
local_sps_size_id = sps_size_id;
if (local_sps_size_id == 3) {
sps_size_id_matrixCase = 2;
} else {
sps_size_id_matrixCase = 6;
}
se_idx = 62;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_61_loopMatrix_id() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_sps_matrix_id;
i32 local_sps_size_id_matrixCase;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_matrix_id = sps_matrix_id;
local_sps_size_id_matrixCase = sps_size_id_matrixCase;
result = local_se_idx == 62 && tmp_isFifoFull && local_sps_matrix_id < local_sps_size_id_matrixCase;
return result;
}
static void read_SPS_Header_se_idx_61_loopMatrix_id() {
u32 res[1];
i32 delta;
i32 size_id_memcpyCase;
u8 sps_scaling_list_pred_mode_flag[4][6];
u32 sps_scaling_list_dc_coef[2][6];
i32 local_sps_size_id;
i32 local_sps_matrix_id;
u32 tmp_res;
u8 tmp_sps_scaling_list_pred_mode_flag;
i32 k;
u16 local_sps_id;
u8 tmp_sps_sl;
u8 tmp_sps_sl_dc;
i32 tmp_min;
u32 tmp_res0;
u32 tmp_sps_scaling_list_dc_coef;
i32 local_sps_next_coef;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "scaling_list_pred_mode_flag ");
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
tmp_res = res[0];
sps_scaling_list_pred_mode_flag[local_sps_size_id][local_sps_matrix_id] = tmp_res;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
tmp_sps_scaling_list_pred_mode_flag = sps_scaling_list_pred_mode_flag[local_sps_size_id][local_sps_matrix_id];
if (tmp_sps_scaling_list_pred_mode_flag == 0) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta ");
delta = res[0];
if (delta != 0) {
local_sps_matrix_id = sps_matrix_id;
if (local_sps_matrix_id - delta < 0) {
printf("Invalid delta in scaling list data\n");
}
local_sps_size_id = sps_size_id;
if (local_sps_size_id > 0) {
size_id_memcpyCase = 64;
} else {
size_id_memcpyCase = 16;
}
k = 0;
while (k <= size_id_memcpyCase - 1) {
local_sps_id = sps_id;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
local_sps_id = sps_id;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
tmp_sps_sl = sps_sl[local_sps_id][local_sps_size_id][local_sps_matrix_id - delta][k];
sps_sl[local_sps_id][local_sps_size_id][local_sps_matrix_id][k] = tmp_sps_sl;
k = k + 1;
}
local_sps_size_id = sps_size_id;
if (local_sps_size_id > 1) {
local_sps_id = sps_id;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
local_sps_id = sps_id;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
tmp_sps_sl_dc = sps_sl_dc[local_sps_id][local_sps_size_id - 2][local_sps_matrix_id - delta];
sps_sl_dc[local_sps_id][local_sps_size_id - 2][local_sps_matrix_id] = tmp_sps_sl_dc;
}
}
local_sps_matrix_id = sps_matrix_id;
sps_matrix_id = local_sps_matrix_id + 1;
} else {
sps_next_coef = 8;
local_sps_size_id = sps_size_id;
tmp_min = HevcDecoder_Algo_Parser_min(64, 1 << (4 + (local_sps_size_id << 1)));
sps_coef_num = tmp_min;
local_sps_size_id = sps_size_id;
if (local_sps_size_id > 1) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "scaling_list_dc_coef ");
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
tmp_res0 = res[0];
sps_scaling_list_dc_coef[local_sps_size_id - 2][local_sps_matrix_id] = tmp_res0 + 8;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
tmp_sps_scaling_list_dc_coef = sps_scaling_list_dc_coef[local_sps_size_id - 2][local_sps_matrix_id];
sps_next_coef = tmp_sps_scaling_list_dc_coef;
local_sps_id = sps_id;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
local_sps_next_coef = sps_next_coef;
sps_sl_dc[local_sps_id][local_sps_size_id - 2][local_sps_matrix_id] = local_sps_next_coef;
}
se_idx = 63;
cnt_i = 0;
}
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_63_loopNumCoef() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
i32 local_sps_coef_num;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_coef_num = sps_coef_num;
result = local_se_idx == 63 && tmp_isFifoFull && local_cnt_i < local_sps_coef_num;
return result;
}
static void read_SPS_Header_se_idx_63_loopNumCoef() {
u32 res[1];
i32 local_sps_size_id;
u32 local_cnt_i;
i8 tmp_hevc_diag_scan4x4_y;
u8 tmp_hevc_diag_scan4x4_x;
i8 tmp_hevc_diag_scan8x8_y;
i8 tmp_hevc_diag_scan8x8_x;
u32 tmp_res;
i32 local_sps_next_coef;
i32 local_sps_scaling_list_delta_coef;
u16 local_sps_id;
i32 local_sps_matrix_id;
i32 local_sps_pos;
local_sps_size_id = sps_size_id;
if (local_sps_size_id == 0) {
local_cnt_i = cnt_i;
tmp_hevc_diag_scan4x4_y = HevcDecoder_Algo_Parser_hevc_diag_scan4x4_y[local_cnt_i];
local_cnt_i = cnt_i;
tmp_hevc_diag_scan4x4_x = HevcDecoder_Algo_Parser_hevc_diag_scan4x4_x[local_cnt_i];
sps_pos = 4 * tmp_hevc_diag_scan4x4_y + tmp_hevc_diag_scan4x4_x;
} else {
local_cnt_i = cnt_i;
tmp_hevc_diag_scan8x8_y = HevcDecoder_Algo_Parser_hevc_diag_scan8x8_y[local_cnt_i];
local_cnt_i = cnt_i;
tmp_hevc_diag_scan8x8_x = HevcDecoder_Algo_Parser_hevc_diag_scan8x8_x[local_cnt_i];
sps_pos = 8 * tmp_hevc_diag_scan8x8_y + tmp_hevc_diag_scan8x8_x;
}
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "scaling_list_delta_coef ");
tmp_res = res[0];
sps_scaling_list_delta_coef = tmp_res;
local_sps_next_coef = sps_next_coef;
local_sps_scaling_list_delta_coef = sps_scaling_list_delta_coef;
sps_next_coef = (local_sps_next_coef + local_sps_scaling_list_delta_coef + 256) % 256;
local_sps_id = sps_id;
local_sps_size_id = sps_size_id;
local_sps_matrix_id = sps_matrix_id;
local_sps_pos = sps_pos;
local_sps_next_coef = sps_next_coef;
sps_sl[local_sps_id][local_sps_size_id][local_sps_matrix_id][local_sps_pos] = local_sps_next_coef;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_63_loopNumCoefEnd() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
i32 local_sps_coef_num;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_coef_num = sps_coef_num;
result = local_se_idx == 63 && tmp_isFifoFull && local_cnt_i == local_sps_coef_num;
return result;
}
static void read_SPS_Header_se_idx_63_loopNumCoefEnd() {
i32 local_sps_matrix_id;
cnt_i = 0;
local_sps_matrix_id = sps_matrix_id;
sps_matrix_id = local_sps_matrix_id + 1;
se_idx = 62;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_62_loopMatrix_id_End() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_sps_matrix_id;
i32 local_sps_size_id_matrixCase;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_matrix_id = sps_matrix_id;
local_sps_size_id_matrixCase = sps_size_id_matrixCase;
result = local_se_idx == 62 && tmp_isFifoFull && local_sps_matrix_id == local_sps_size_id_matrixCase;
return result;
}
static void read_SPS_Header_se_idx_62_loopMatrix_id_End() {
i32 local_sps_size_id;
local_sps_size_id = sps_size_id;
sps_size_id = local_sps_size_id + 1;
sps_matrix_id = 0;
se_idx = 61;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_61_size_id_loopEnd() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_sps_size_id;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_size_id = sps_size_id;
result = local_se_idx == 61 && tmp_isFifoFull && local_sps_size_id == 4;
return result;
}
static void read_SPS_Header_se_idx_61_size_id_loopEnd() {
sps_size_id = 0;
se_idx = 6;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_6() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 6 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_6() {
u32 res[1];
u32 tmp_res;
u16 local_sps_id;
u32 tmp_res0;
u32 tmp_res1;
u8 tmp_sps_pcm_enabled_flag;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_log2_min_pcm_cb_size;
u32 tmp_res5;
u32 tmp_res6;
u32 tmp_res7;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "amp_enabled_flag ");
tmp_res = res[0];
amp_enabled_flag = tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sample_adaptive_offset_enabled_flag ");
local_sps_id = sps_id;
tmp_res0 = res[0];
sps_sample_adaptive_offset_enabled_flag[local_sps_id] = tmp_res0;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pcm_enabled_flag ");
local_sps_id = sps_id;
tmp_res1 = res[0];
sps_pcm_enabled_flag[local_sps_id] = tmp_res1;
local_sps_id = sps_id;
tmp_sps_pcm_enabled_flag = sps_pcm_enabled_flag[local_sps_id];
if (tmp_sps_pcm_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(4, fifo, res, "pcm_sample_bit_depth_luma_minus1 ");
local_sps_id = sps_id;
tmp_res2 = res[0];
pcm_bit_depth[local_sps_id] = tmp_res2 + 1;
HevcDecoder_Algo_Parser_vld_u_name(4, fifo, res, "pcm_sample_bit_depth_chroma_minus1 ");
local_sps_id = sps_id;
tmp_res3 = res[0];
pcm_bit_depth_chroma[local_sps_id] = tmp_res3 + 1;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_min_pcm_luma_coding_block_size_minus3");
local_sps_id = sps_id;
tmp_res4 = res[0];
log2_min_pcm_cb_size[local_sps_id] = tmp_res4 + 3;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_diff_max_min_pcm_luma_coding_block_size");
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_log2_min_pcm_cb_size = log2_min_pcm_cb_size[local_sps_id];
tmp_res5 = res[0];
log2_max_pcm_cb_size[local_sps_id] = tmp_log2_min_pcm_cb_size + tmp_res5;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pcm_loop_filter_disable_flag ");
local_sps_id = sps_id;
tmp_res6 = res[0];
pcm_loop_filter_disable_flag[local_sps_id] = tmp_res6;
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_short_term_ref_pic_sets ");
local_sps_id = sps_id;
tmp_res7 = res[0];
sps_num_short_term_ref_pic_sets[local_sps_id] = tmp_res7;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_7_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
result = local_se_idx == 7 && tmp_isFifoFull && local_cnt_i < tmp_sps_num_short_term_ref_pic_sets;
return result;
}
static void read_SPS_Header_se_idx_7_loop() {
u16 local_sps_id;
u32 local_cnt_i;
u8 tmp_sps_num_short_term_ref_pic_sets;
local_sps_id = sps_id;
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
HevcDecoder_Algo_Parser_parseShortTermRefPicSet(local_sps_id, local_cnt_i, tmp_sps_num_short_term_ref_pic_sets, fifo, pcRPS);
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_7_loopEnd() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
result = local_se_idx == 7 && local_cnt_i == tmp_sps_num_short_term_ref_pic_sets;
return result;
}
static void read_SPS_Header_se_idx_7_loopEnd() {
u16 local_se_idx;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_se_idx_8() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 8 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_se_idx_8() {
u32 res[1];
u16 local_sps_id;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
i32 i;
u8 tmp_sps_num_long_term_ref_pics_sps;
u8 tmp_sps_log2_max_pic_order_cnt_lsb_minus4;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_res5;
u32 tmp_res6;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "long_term_ref_pics_present_flag ");
local_sps_id = sps_id;
tmp_res = res[0];
sps_long_term_ref_pics_present_flag[local_sps_id] = tmp_res;
tmp_res0 = res[0];
if (tmp_res0 == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_long_term_ref_pics_sps ");
local_sps_id = sps_id;
tmp_res1 = res[0];
sps_num_long_term_ref_pics_sps[local_sps_id] = tmp_res1;
i = 0;
local_sps_id = sps_id;
tmp_sps_num_long_term_ref_pics_sps = sps_num_long_term_ref_pics_sps[local_sps_id];
while (i <= tmp_sps_num_long_term_ref_pics_sps - 1) {
local_sps_id = sps_id;
tmp_sps_log2_max_pic_order_cnt_lsb_minus4 = sps_log2_max_pic_order_cnt_lsb_minus4[local_sps_id];
HevcDecoder_Algo_Parser_vld_u_name(tmp_sps_log2_max_pic_order_cnt_lsb_minus4 + 4, fifo, res, "lt_ref_pic_poc_lsb_sps ");
tmp_res2 = res[0];
lt_ref_pic_poc_lsb_sps[i] = tmp_res2;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_lt_sps_flag ");
tmp_res3 = res[0];
used_by_curr_pic_lt_sps_flag[i] = tmp_res3;
i = i + 1;
}
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_temporal_mvp_enable_flag ");
local_sps_id = sps_id;
tmp_res4 = res[0];
sps_temporal_mvp_enable_flag[local_sps_id] = tmp_res4;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_strong_intra_smoothing_enable_flag ");
local_sps_id = sps_id;
tmp_res5 = res[0];
sps_strong_intra_smoothing_enable_flag[local_sps_id] = tmp_res5 == 1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "vui_parameters_present_flag ");
tmp_res6 = res[0];
if (tmp_res6 == 1) {
printf("not support for vui_parameters_present_flag != 0\n");
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SPS_Header_done() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 9 && tmp_isFifoFull;
return result;
}
static void read_SPS_Header_done() {
u32 res[1];
u32 tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sps_extension_flag ");
tmp_res = res[0];
if (tmp_res == 1) {
printf("not support for sps_extension_flag != 0\n");
}
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_PPS_Header_se_idx_1() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u16 local_pps_id;
u32 tmp_res1;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "pps_pic_parameter_set_id ");
tmp_res = res[0];
pps_id = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "pps_seq_parameter_set_id ");
tmp_res0 = res[0];
sps_id = tmp_res0;
local_pps_id = pps_id;
tmp_res1 = res[0];
pps_sps_id[local_pps_id] = tmp_res1;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
cnt_i = 0;
local_pps_id = pps_id;
pps_num_tile_columns_minus1[local_pps_id] = 0;
local_pps_id = pps_id;
pps_num_tile_rows_minus1[local_pps_id] = 0;
local_pps_id = pps_id;
pps_uniform_spacing_flag[local_pps_id] = 1;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 2 && tmp_isFifoFull;
return result;
}
static void read_PPS_Header_se_idx_2() {
u32 res[1];
u16 local_pps_id;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_res5;
u32 tmp_res6;
u32 tmp_res7;
u32 tmp_res8;
u32 tmp_res9;
u32 tmp_res10;
u32 tmp_res11;
u32 tmp_res12;
u32 tmp_res13;
u32 tmp_res14;
u32 tmp_res15;
u32 tmp_res16;
u32 tmp_res17;
u32 tmp_res18;
u32 tmp_res19;
u8 tmp_pps_tiles_enabled_flag;
u32 tmp_res20;
u32 tmp_res21;
u32 tmp_res22;
u16 local_se_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "dependent_slice_segments_enabled_flag ");
local_pps_id = pps_id;
tmp_res = res[0];
pps_dependent_slice_segments_enabled_flag[local_pps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "output_flag_present_flag ");
local_pps_id = pps_id;
tmp_res0 = res[0];
pps_output_flag_present_flag[local_pps_id] = tmp_res0;
HevcDecoder_Algo_Parser_vld_u_name(3, fifo, res, "num_extra_slice_header_bits ");
local_pps_id = pps_id;
tmp_res1 = res[0];
pps_num_extra_slice_header_bits[local_pps_id] = tmp_res1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "sign_data_hiding_flag ");
local_pps_id = pps_id;
tmp_res2 = res[0];
pps_sign_data_hiding_flag[local_pps_id] = tmp_res2;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "cabac_init_present_flag ");
local_pps_id = pps_id;
tmp_res3 = res[0];
pps_cabac_init_present_flag[local_pps_id] = tmp_res3;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_ref_idx_l0_default_active_minus1 ");
local_pps_id = pps_id;
tmp_res4 = res[0];
pps_num_ref_idx_l0_default_active_minus1[local_pps_id] = tmp_res4;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_ref_idx_l1_default_active_minus1 ");
local_pps_id = pps_id;
tmp_res5 = res[0];
pps_num_ref_idx_l1_default_active_minus1[local_pps_id] = tmp_res5;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "init_qp_minus26 ");
local_pps_id = pps_id;
tmp_res6 = res[0];
pps_init_qp_minus26[local_pps_id] = tmp_res6;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "constrained_intra_pred_flag ");
local_pps_id = pps_id;
tmp_res7 = res[0];
pps_constrained_intra_pred_flag[local_pps_id] = tmp_res7 != 0;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "transform_skip_enabled_flag ");
local_pps_id = pps_id;
tmp_res8 = res[0];
pps_transform_skip_enabled_flag[local_pps_id] = tmp_res8;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "cu_qp_delta_enabled_flag ");
local_pps_id = pps_id;
tmp_res9 = res[0];
pps_cu_qp_delta_enabled_flag[local_pps_id] = tmp_res9;
tmp_res10 = res[0];
if (tmp_res10 == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "diff_cu_qp_delta_depth ");
local_pps_id = pps_id;
tmp_res11 = res[0];
pps_diff_cu_qp_delta_depth[local_pps_id] = tmp_res11;
} else {
local_pps_id = pps_id;
pps_diff_cu_qp_delta_depth[local_pps_id] = 0;
}
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "pps_cb_qp_offset ");
local_pps_id = pps_id;
tmp_res12 = res[0];
pps_cb_qp_offset[local_pps_id] = tmp_res12;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "pps_cr_qp_offset ");
local_pps_id = pps_id;
tmp_res13 = res[0];
pps_cr_qp_offset[local_pps_id] = tmp_res13;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pps_slice_chroma_qp_offsets_present_flag");
local_pps_id = pps_id;
tmp_res14 = res[0];
pps_slice_chroma_qp_offsets_present_flag[local_pps_id] = tmp_res14;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "weighted_pred_flag ");
local_pps_id = pps_id;
tmp_res15 = res[0];
pps_weighted_pred_flag[local_pps_id] = tmp_res15;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "weighted_bipred_flag ");
local_pps_id = pps_id;
tmp_res16 = res[0];
pps_weighted_bipred_flag[local_pps_id] = tmp_res16;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "transquant_bypass_enable_flag ");
local_pps_id = pps_id;
tmp_res17 = res[0];
pps_transquant_bypass_enable_flag[local_pps_id] = tmp_res17;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "tiles_enabled_flag ");
local_pps_id = pps_id;
tmp_res18 = res[0];
pps_tiles_enabled_flag[local_pps_id] = tmp_res18;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "entropy_coding_sync_enabled_flag ");
local_pps_id = pps_id;
tmp_res19 = res[0];
pps_entropy_coding_sync_enabled_flag[local_pps_id] = tmp_res19;
local_pps_id = pps_id;
pps_num_tile_columns_minus1[local_pps_id] = 0;
local_pps_id = pps_id;
pps_num_tile_rows_minus1[local_pps_id] = 0;
local_pps_id = pps_id;
pps_uniform_spacing_flag[local_pps_id] = 1;
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag = pps_tiles_enabled_flag[local_pps_id];
if (tmp_pps_tiles_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_tile_columns_minus1 ");
local_pps_id = pps_id;
tmp_res20 = res[0];
pps_num_tile_columns_minus1[local_pps_id] = tmp_res20;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_tile_rows_minus1 ");
local_pps_id = pps_id;
tmp_res21 = res[0];
pps_num_tile_rows_minus1[local_pps_id] = tmp_res21;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "uniform_spacing_flag ");
local_pps_id = pps_id;
tmp_res22 = res[0];
pps_uniform_spacing_flag[local_pps_id] = tmp_res22;
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_3_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u16 local_pps_id;
u8 tmp_pps_uniform_spacing_flag;
u32 local_cnt_i;
u8 tmp_pps_num_tile_columns_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pps_id = pps_id;
tmp_pps_uniform_spacing_flag = pps_uniform_spacing_flag[local_pps_id];
local_cnt_i = cnt_i;
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
result = local_se_idx == 3 && tmp_isFifoFull && (tmp_pps_uniform_spacing_flag == 0 && local_cnt_i < tmp_pps_num_tile_columns_minus1);
return result;
}
static void read_PPS_Header_se_idx_3_loop() {
u32 res[1];
u16 local_pps_id;
u32 local_cnt_i;
u32 tmp_res;
i32 local_sum;
u16 tmp_pps_column_width;
i32 local_PICT_WIDTH;
u8 local_MIN_CTB_SIZE_Y;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "column_width[ ] ");
local_pps_id = pps_id;
local_cnt_i = cnt_i;
tmp_res = res[0];
pps_column_width[local_pps_id][local_cnt_i] = tmp_res + 1;
local_sum = sum;
local_pps_id = pps_id;
local_cnt_i = cnt_i;
tmp_pps_column_width = pps_column_width[local_pps_id][local_cnt_i];
sum = local_sum + tmp_pps_column_width;
local_cnt_i = cnt_i;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
if (local_cnt_i >= local_PICT_WIDTH / local_MIN_CTB_SIZE_Y) {
local_cnt_i = cnt_i;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
printf("Error read_PPS_Header.se_idx_3.loop : %u >= %i\n", local_cnt_i, local_PICT_WIDTH / local_MIN_CTB_SIZE_Y);
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_3_loopEnd() {
i32 result;
u16 local_se_idx;
u16 local_pps_id;
u8 tmp_pps_uniform_spacing_flag;
u32 local_cnt_i;
u8 tmp_pps_num_tile_columns_minus1;
local_se_idx = se_idx;
local_pps_id = pps_id;
tmp_pps_uniform_spacing_flag = pps_uniform_spacing_flag[local_pps_id];
local_cnt_i = cnt_i;
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
result = local_se_idx == 3 && (tmp_pps_uniform_spacing_flag == 0 && local_cnt_i == tmp_pps_num_tile_columns_minus1);
return result;
}
static void read_PPS_Header_se_idx_3_loopEnd() {
u16 local_pps_id;
u8 tmp_pps_num_tile_columns_minus1;
u16 local_sps_id;
u16 tmp_sps_ctb_width;
i32 local_sum;
u16 local_se_idx;
local_pps_id = pps_id;
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
local_sps_id = sps_id;
tmp_sps_ctb_width = sps_ctb_width[local_sps_id];
local_sum = sum;
pps_column_width[local_pps_id][tmp_pps_num_tile_columns_minus1] = tmp_sps_ctb_width - local_sum;
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
cnt_i = 0;
sum = 0;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_3_noLoop() {
i32 result;
u16 local_se_idx;
u16 local_pps_id;
u8 tmp_pps_uniform_spacing_flag;
local_se_idx = se_idx;
local_pps_id = pps_id;
tmp_pps_uniform_spacing_flag = pps_uniform_spacing_flag[local_pps_id];
result = local_se_idx == 3 && tmp_pps_uniform_spacing_flag == 1;
return result;
}
static void read_PPS_Header_se_idx_3_noLoop() {
u16 local_se_idx;
local_se_idx = se_idx;
se_idx = local_se_idx + 2;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_4_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u16 local_pps_id;
u8 tmp_pps_uniform_spacing_flag;
u32 local_cnt_i;
u8 tmp_pps_num_tile_rows_minus1;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pps_id = pps_id;
tmp_pps_uniform_spacing_flag = pps_uniform_spacing_flag[local_pps_id];
local_cnt_i = cnt_i;
local_pps_id = pps_id;
tmp_pps_num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
result = local_se_idx == 4 && tmp_isFifoFull && (tmp_pps_uniform_spacing_flag == 0 && local_cnt_i < tmp_pps_num_tile_rows_minus1);
return result;
}
static void read_PPS_Header_se_idx_4_loop() {
u32 res[1];
u16 local_pps_id;
u32 local_cnt_i;
u32 tmp_res;
i32 local_sum;
u16 tmp_pps_row_height;
i32 local_PICT_HEIGHT;
u8 local_MIN_CTB_SIZE_Y;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "row_height[ ] ");
local_pps_id = pps_id;
local_cnt_i = cnt_i;
tmp_res = res[0];
pps_row_height[local_pps_id][local_cnt_i] = tmp_res + 1;
local_sum = sum;
local_pps_id = pps_id;
local_cnt_i = cnt_i;
tmp_pps_row_height = pps_row_height[local_pps_id][local_cnt_i];
sum = local_sum + tmp_pps_row_height;
local_cnt_i = cnt_i;
local_PICT_HEIGHT = HevcDecoder_Algo_Parser_PICT_HEIGHT;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
if (local_cnt_i >= local_PICT_HEIGHT / local_MIN_CTB_SIZE_Y) {
local_cnt_i = cnt_i;
local_PICT_HEIGHT = HevcDecoder_Algo_Parser_PICT_HEIGHT;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
printf("Error read_PPS_Header.se_idx_4.loop : %u >= %i\n", local_cnt_i, local_PICT_HEIGHT / local_MIN_CTB_SIZE_Y);
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_4_loopEnd() {
i32 result;
u16 local_se_idx;
u16 local_pps_id;
u8 tmp_pps_uniform_spacing_flag;
u32 local_cnt_i;
u8 tmp_pps_num_tile_rows_minus1;
local_se_idx = se_idx;
local_pps_id = pps_id;
tmp_pps_uniform_spacing_flag = pps_uniform_spacing_flag[local_pps_id];
local_cnt_i = cnt_i;
local_pps_id = pps_id;
tmp_pps_num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
result = local_se_idx == 4 && (tmp_pps_uniform_spacing_flag == 0 && local_cnt_i == tmp_pps_num_tile_rows_minus1);
return result;
}
static void read_PPS_Header_se_idx_4_loopEnd() {
u16 local_pps_id;
u8 tmp_pps_num_tile_rows_minus1;
u16 local_sps_id;
u16 tmp_sps_ctb_height;
i32 local_sum;
local_pps_id = pps_id;
local_pps_id = pps_id;
tmp_pps_num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
local_sps_id = sps_id;
tmp_sps_ctb_height = sps_ctb_height[local_sps_id];
local_sum = sum;
pps_row_height[local_pps_id][tmp_pps_num_tile_rows_minus1] = tmp_sps_ctb_height - local_sum;
cnt_i = 0;
se_idx = 5;
sum = 0;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_5() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 5 && tmp_isFifoFull;
return result;
}
static void read_PPS_Header_se_idx_5() {
u32 res[1];
u16 local_pps_id;
u8 tmp_pps_tiles_enabled_flag;
u32 tmp_res;
u32 tmp_res0;
u8 tmp_pps_deblocking_filter_control_present_flag;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_res5;
u32 tmp_res6;
u8 tmp_pps_scaling_list_data_present_flag;
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag = pps_tiles_enabled_flag[local_pps_id];
if (tmp_pps_tiles_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "loop_filter_across_tiles_enabled_flag ");
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "loop_filter_across_slices_enabled_flag ");
local_pps_id = pps_id;
tmp_res = res[0];
pps_loop_filter_across_slice_enabled_flag[local_pps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "deblocking_filter_control_present_flag ");
local_pps_id = pps_id;
tmp_res0 = res[0];
pps_deblocking_filter_control_present_flag[local_pps_id] = tmp_res0;
local_pps_id = pps_id;
deblocking_filter_override_enabled_flag[local_pps_id] = 0;
local_pps_id = pps_id;
tmp_pps_deblocking_filter_control_present_flag = pps_deblocking_filter_control_present_flag[local_pps_id];
if (tmp_pps_deblocking_filter_control_present_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "deblocking_filter_override_enabled_flag ");
local_pps_id = pps_id;
tmp_res1 = res[0];
deblocking_filter_override_enabled_flag[local_pps_id] = tmp_res1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pps_disable_deblocking_filter_flag ");
local_pps_id = pps_id;
tmp_res2 = res[0];
pps_disable_deblocking_filter_flag[local_pps_id] = tmp_res2;
tmp_res3 = res[0];
if (tmp_res3 == 0) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "pps_beta_offset_div2 ");
local_pps_id = pps_id;
tmp_res4 = res[0];
pps_beta_offset[local_pps_id] = tmp_res4 << 1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "pps_tc_offset_div2 ");
local_pps_id = pps_id;
tmp_res5 = res[0];
pps_tc_offset[local_pps_id] = tmp_res5 << 1;
}
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pps_scaling_list_data_present_flag ");
local_pps_id = pps_id;
tmp_res6 = res[0];
pps_scaling_list_data_present_flag[local_pps_id] = tmp_res6;
local_pps_id = pps_id;
tmp_pps_scaling_list_data_present_flag = pps_scaling_list_data_present_flag[local_pps_id];
if (tmp_pps_scaling_list_data_present_flag == 0) {
se_idx = 52;
} else {
se_idx = 50;
}
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_51() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 52 && tmp_isFifoFull;
return result;
}
static void read_PPS_Header_se_idx_51() {
u32 res[1];
u16 local_pps_id;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 tmp_res2;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "lists_modification_present_flag ");
local_pps_id = pps_id;
tmp_res = res[0];
pps_lists_modification_present_flag[local_pps_id] = tmp_res;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "log2_parallel_merge_level_minus2 ");
local_pps_id = pps_id;
tmp_res0 = res[0];
pps_log2_parallel_merge_level[local_pps_id] = tmp_res0 + 2;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_segment_header_extension_present_flag");
local_pps_id = pps_id;
tmp_res1 = res[0];
pps_slice_segment_header_extension_present_flag[local_pps_id] = tmp_res1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pps_extension_flag ");
tmp_res2 = res[0];
if (tmp_res2 == 1) {
printf("not support for pps_extension_flag != 0\n");
}
se_idx = 6;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_50() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 50 && tmp_isFifoFull;
return result;
}
static void read_PPS_Header_se_idx_50() {
i32 matrixId;
i32 i;
u16 local_pps_id;
i32 i0;
u8 tmp_default_scaling_list_intra;
u8 tmp_default_scaling_list_intra0;
u8 tmp_default_scaling_list_intra1;
u8 tmp_default_scaling_list_inter;
u8 tmp_default_scaling_list_inter0;
u8 tmp_default_scaling_list_inter1;
u8 tmp_default_scaling_list_intra2;
u8 tmp_default_scaling_list_intra3;
u8 tmp_default_scaling_list_intra4;
u8 tmp_default_scaling_list_inter2;
u8 tmp_default_scaling_list_inter3;
u8 tmp_default_scaling_list_inter4;
u8 tmp_default_scaling_list_intra5;
u8 tmp_default_scaling_list_inter5;
matrixId = 0;
while (matrixId <= 5) {
i = 0;
while (i <= 15) {
local_pps_id = pps_id;
pps_sl[local_pps_id][0][matrixId][i] = 16;
i = i + 1;
}
local_pps_id = pps_id;
pps_sl_dc[local_pps_id][0][matrixId] = 16;
local_pps_id = pps_id;
pps_sl_dc[local_pps_id][1][matrixId] = 16;
matrixId = matrixId + 1;
}
i0 = 0;
while (i0 <= 63) {
local_pps_id = pps_id;
tmp_default_scaling_list_intra = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][1][0][i0] = tmp_default_scaling_list_intra;
local_pps_id = pps_id;
tmp_default_scaling_list_intra0 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][1][1][i0] = tmp_default_scaling_list_intra0;
local_pps_id = pps_id;
tmp_default_scaling_list_intra1 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][1][2][i0] = tmp_default_scaling_list_intra1;
local_pps_id = pps_id;
tmp_default_scaling_list_inter = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][1][3][i0] = tmp_default_scaling_list_inter;
local_pps_id = pps_id;
tmp_default_scaling_list_inter0 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][1][4][i0] = tmp_default_scaling_list_inter0;
local_pps_id = pps_id;
tmp_default_scaling_list_inter1 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][1][5][i0] = tmp_default_scaling_list_inter1;
local_pps_id = pps_id;
tmp_default_scaling_list_intra2 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][2][0][i0] = tmp_default_scaling_list_intra2;
local_pps_id = pps_id;
tmp_default_scaling_list_intra3 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][2][1][i0] = tmp_default_scaling_list_intra3;
local_pps_id = pps_id;
tmp_default_scaling_list_intra4 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][2][2][i0] = tmp_default_scaling_list_intra4;
local_pps_id = pps_id;
tmp_default_scaling_list_inter2 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][2][3][i0] = tmp_default_scaling_list_inter2;
local_pps_id = pps_id;
tmp_default_scaling_list_inter3 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][2][4][i0] = tmp_default_scaling_list_inter3;
local_pps_id = pps_id;
tmp_default_scaling_list_inter4 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][2][5][i0] = tmp_default_scaling_list_inter4;
local_pps_id = pps_id;
tmp_default_scaling_list_intra5 = HevcDecoder_Algo_Parser_default_scaling_list_intra[i0];
pps_sl[local_pps_id][3][0][i0] = tmp_default_scaling_list_intra5;
local_pps_id = pps_id;
tmp_default_scaling_list_inter5 = HevcDecoder_Algo_Parser_default_scaling_list_inter[i0];
pps_sl[local_pps_id][3][1][i0] = tmp_default_scaling_list_inter5;
i0 = i0 + 1;
}
se_idx = 51;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_51_loopSize_id() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_pps_size_id;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pps_size_id = pps_size_id;
result = local_se_idx == 51 && tmp_isFifoFull && local_pps_size_id < 4;
return result;
}
static void read_PPS_Header_se_idx_51_loopSize_id() {
i32 local_pps_size_id;
local_pps_size_id = pps_size_id;
if (local_pps_size_id == 3) {
pps_size_id_matrixCase = 2;
} else {
pps_size_id_matrixCase = 6;
}
se_idx = 53;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_53_loopMatrix_id() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_pps_matrix_id;
i32 local_pps_size_id_matrixCase;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pps_matrix_id = pps_matrix_id;
local_pps_size_id_matrixCase = pps_size_id_matrixCase;
result = local_se_idx == 53 && tmp_isFifoFull && local_pps_matrix_id < local_pps_size_id_matrixCase;
return result;
}
static void read_PPS_Header_se_idx_53_loopMatrix_id() {
u32 res[1];
i32 delta;
i32 size_id_memcpyCase;
u8 pps_scaling_list_pred_mode_flag[4][6];
u32 pps_scaling_list_dc_coef[2][6];
i32 local_pps_size_id;
i32 local_pps_matrix_id;
u32 tmp_res;
u8 tmp_pps_scaling_list_pred_mode_flag;
i32 k;
u16 local_pps_id;
u8 tmp_pps_sl;
u8 tmp_pps_sl_dc;
i32 tmp_min;
u32 tmp_res0;
u32 tmp_pps_scaling_list_dc_coef;
i32 local_pps_next_coef;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "scaling_list_pred_mode_flag ");
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
tmp_res = res[0];
pps_scaling_list_pred_mode_flag[local_pps_size_id][local_pps_matrix_id] = tmp_res;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
tmp_pps_scaling_list_pred_mode_flag = pps_scaling_list_pred_mode_flag[local_pps_size_id][local_pps_matrix_id];
if (tmp_pps_scaling_list_pred_mode_flag == 0) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta ");
delta = res[0];
if (delta != 0) {
local_pps_matrix_id = pps_matrix_id;
if (local_pps_matrix_id - delta < 0) {
printf("Invalid delta in scaling list data\n");
}
local_pps_size_id = pps_size_id;
if (local_pps_size_id > 0) {
size_id_memcpyCase = 64;
} else {
size_id_memcpyCase = 16;
}
k = 0;
while (k <= size_id_memcpyCase) {
local_pps_id = pps_id;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
local_pps_id = pps_id;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
tmp_pps_sl = pps_sl[local_pps_id][local_pps_size_id][local_pps_matrix_id - delta][k];
pps_sl[local_pps_id][local_pps_size_id][local_pps_matrix_id][k] = tmp_pps_sl;
k = k + 1;
}
local_pps_size_id = pps_size_id;
if (local_pps_size_id > 1) {
local_pps_id = pps_id;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
local_pps_id = pps_id;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
tmp_pps_sl_dc = pps_sl_dc[local_pps_id][local_pps_size_id - 2][local_pps_matrix_id - delta];
pps_sl_dc[local_pps_id][local_pps_size_id - 2][local_pps_matrix_id] = tmp_pps_sl_dc;
}
}
local_pps_matrix_id = pps_matrix_id;
pps_matrix_id = local_pps_matrix_id + 1;
} else {
pps_next_coef = 8;
local_pps_size_id = pps_size_id;
tmp_min = HevcDecoder_Algo_Parser_min(64, 1 << (4 + (local_pps_size_id << 1)));
pps_coef_num = tmp_min;
local_pps_size_id = pps_size_id;
if (local_pps_size_id > 1) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "scaling_list_dc_coef ");
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
tmp_res0 = res[0];
pps_scaling_list_dc_coef[local_pps_size_id - 2][local_pps_matrix_id] = tmp_res0 + 8;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
tmp_pps_scaling_list_dc_coef = pps_scaling_list_dc_coef[local_pps_size_id - 2][local_pps_matrix_id];
pps_next_coef = tmp_pps_scaling_list_dc_coef;
local_pps_id = pps_id;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
local_pps_next_coef = pps_next_coef;
pps_sl_dc[local_pps_id][local_pps_size_id - 2][local_pps_matrix_id] = local_pps_next_coef;
}
se_idx = 54;
cnt_i = 0;
}
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_54_loopNumCoef() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
i32 local_pps_coef_num;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_pps_coef_num = pps_coef_num;
result = local_se_idx == 54 && tmp_isFifoFull && local_cnt_i < local_pps_coef_num;
return result;
}
static void read_PPS_Header_se_idx_54_loopNumCoef() {
u32 res[1];
i32 local_pps_size_id;
u32 local_cnt_i;
i8 tmp_hevc_diag_scan4x4_y;
u8 tmp_hevc_diag_scan4x4_x;
i8 tmp_hevc_diag_scan8x8_y;
i8 tmp_hevc_diag_scan8x8_x;
u32 tmp_res;
i32 local_pps_next_coef;
i32 local_pps_scaling_list_delta_coef;
u16 local_pps_id;
i32 local_pps_matrix_id;
i32 local_pps_pos;
local_pps_size_id = pps_size_id;
if (local_pps_size_id == 0) {
local_cnt_i = cnt_i;
tmp_hevc_diag_scan4x4_y = HevcDecoder_Algo_Parser_hevc_diag_scan4x4_y[local_cnt_i];
local_cnt_i = cnt_i;
tmp_hevc_diag_scan4x4_x = HevcDecoder_Algo_Parser_hevc_diag_scan4x4_x[local_cnt_i];
pps_pos = 4 * tmp_hevc_diag_scan4x4_y + tmp_hevc_diag_scan4x4_x;
} else {
local_cnt_i = cnt_i;
tmp_hevc_diag_scan8x8_y = HevcDecoder_Algo_Parser_hevc_diag_scan8x8_y[local_cnt_i];
local_cnt_i = cnt_i;
tmp_hevc_diag_scan8x8_x = HevcDecoder_Algo_Parser_hevc_diag_scan8x8_x[local_cnt_i];
pps_pos = 8 * tmp_hevc_diag_scan8x8_y + tmp_hevc_diag_scan8x8_x;
}
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "scaling_list_delta_coef ");
tmp_res = res[0];
pps_scaling_list_delta_coef = tmp_res;
local_pps_next_coef = pps_next_coef;
local_pps_scaling_list_delta_coef = pps_scaling_list_delta_coef;
pps_next_coef = local_pps_next_coef + local_pps_scaling_list_delta_coef + 256 & 255;
local_pps_id = pps_id;
local_pps_size_id = pps_size_id;
local_pps_matrix_id = pps_matrix_id;
local_pps_pos = pps_pos;
local_pps_next_coef = pps_next_coef;
pps_sl[local_pps_id][local_pps_size_id][local_pps_matrix_id][local_pps_pos] = local_pps_next_coef;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_54_loopNumCoefEnd() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
i32 local_pps_coef_num;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_pps_coef_num = pps_coef_num;
result = local_se_idx == 54 && tmp_isFifoFull && local_cnt_i == local_pps_coef_num;
return result;
}
static void read_PPS_Header_se_idx_54_loopNumCoefEnd() {
i32 local_pps_matrix_id;
cnt_i = 0;
local_pps_matrix_id = pps_matrix_id;
pps_matrix_id = local_pps_matrix_id + 1;
se_idx = 53;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_53_loopMatrix_id_End() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_pps_matrix_id;
i32 local_pps_size_id_matrixCase;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pps_matrix_id = pps_matrix_id;
local_pps_size_id_matrixCase = pps_size_id_matrixCase;
result = local_se_idx == 53 && tmp_isFifoFull && local_pps_matrix_id == local_pps_size_id_matrixCase;
return result;
}
static void read_PPS_Header_se_idx_53_loopMatrix_id_End() {
i32 local_pps_size_id;
local_pps_size_id = pps_size_id;
pps_size_id = local_pps_size_id + 1;
pps_matrix_id = 0;
se_idx = 51;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_se_idx_51_loopSize_id_End() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
i32 local_pps_size_id;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pps_size_id = pps_size_id;
result = local_se_idx == 51 && tmp_isFifoFull && local_pps_size_id == 4;
return result;
}
static void read_PPS_Header_se_idx_51_loopSize_id_End() {
pps_size_id = 0;
se_idx = 52;
// Update ports indexes
}
static i32 isSchedulable_read_PPS_Header_done() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 6;
return result;
}
static void read_PPS_Header_done() {
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_1() {
i32 result;
u16 local_se_idx;
i32 local_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
local_idx = idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 1 && local_idx == 0 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_1() {
u32 res[1];
u8 part_mode;
u16 local_sps_id;
u8 tmp_sps_log2_min_coding_block_size;
u8 local_Log2MinCbSize;
u8 tmp_sps_log2_diff_max_min_coding_block_size;
u16 tmp_sps_pic_width_in_luma_samples;
u8 local_Log2CtbSize;
u16 tmp_sps_pic_height_in_luma_samples;
u16 local_PicWidthInCtbsY;
u16 local_PicHeightInCtbsY;
u32 local_TILE_SPLIT_ENABLE;
u32 local_TILE_INDEX;
u32 tmp_res;
u8 local_nal_unit_type;
u32 tmp_res0;
u32 tmp_res1;
u16 local_pps_id;
u8 tmp_pps_sps_id;
u8 local_first_slice_segment_in_pic_flag;
u8 tmp_pps_dependent_slice_segments_enabled_flag;
u32 tmp_res2;
u16 local_PicSizeInCtbsY;
i32 tmp_log2;
u32 tmp_res3;
u8 local_dependent_slice_segment_flag;
u32 local_slice_segment_address;
i32 local_slice_idx;
u16 tmp_sps_pic_width_in_luma_samples0;
u16 tmp_sps_pic_height_in_luma_samples0;
u8 local_PART_MODE_PICT;
u8 local_PART_MODE_SLICE_INDEP;
u8 local_PART_MODE_SLICE_DEP;
local_sps_id = sps_id;
tmp_sps_log2_min_coding_block_size = sps_log2_min_coding_block_size[local_sps_id];
Log2MinCbSize = tmp_sps_log2_min_coding_block_size;
local_Log2MinCbSize = Log2MinCbSize;
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_coding_block_size = sps_log2_diff_max_min_coding_block_size[local_sps_id];
Log2CtbSize = local_Log2MinCbSize + tmp_sps_log2_diff_max_min_coding_block_size;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
local_Log2CtbSize = Log2CtbSize;
local_Log2CtbSize = Log2CtbSize;
PicWidthInCtbsY = (tmp_sps_pic_width_in_luma_samples + (1 << local_Log2CtbSize) - 1) >> local_Log2CtbSize;
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
local_Log2CtbSize = Log2CtbSize;
local_Log2CtbSize = Log2CtbSize;
PicHeightInCtbsY = (tmp_sps_pic_height_in_luma_samples + (1 << local_Log2CtbSize) - 1) >> local_Log2CtbSize;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_PicHeightInCtbsY = PicHeightInCtbsY;
PicSizeInCtbsY = local_PicWidthInCtbsY * local_PicHeightInCtbsY;
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
TilesInfo[0] = local_TILE_SPLIT_ENABLE;
local_TILE_INDEX = TILE_INDEX;
TilesInfo[1] = local_TILE_INDEX;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "first_slice_segment_in_pic_flag ");
tmp_res = res[0];
first_slice_segment_in_pic_flag = tmp_res;
no_output_of_prior_pics_flag = 0;
local_nal_unit_type = nal_unit_type;
local_nal_unit_type = nal_unit_type;
if (local_nal_unit_type >= 16 && local_nal_unit_type <= 23) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "no_output_of_prior_pics_flag ");
tmp_res0 = res[0];
no_output_of_prior_pics_flag = tmp_res0;
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "slice_pic_parameter_set_id ");
tmp_res1 = res[0];
pps_id = tmp_res1;
local_pps_id = pps_id;
tmp_pps_sps_id = pps_sps_id[local_pps_id];
sps_id = tmp_pps_sps_id;
dependent_slice_segment_flag = 0;
local_first_slice_segment_in_pic_flag = first_slice_segment_in_pic_flag;
if (local_first_slice_segment_in_pic_flag == 0) {
local_pps_id = pps_id;
tmp_pps_dependent_slice_segments_enabled_flag = pps_dependent_slice_segments_enabled_flag[local_pps_id];
if (tmp_pps_dependent_slice_segments_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "dependent_slice_segment_flag ");
tmp_res2 = res[0];
dependent_slice_segment_flag = tmp_res2;
}
local_PicSizeInCtbsY = PicSizeInCtbsY;
tmp_log2 = HevcDecoder_Algo_Parser_log2((local_PicSizeInCtbsY - 1) << 1);
HevcDecoder_Algo_Parser_vld_u_name(tmp_log2, fifo, res, "slice_segment_address ");
tmp_res3 = res[0];
slice_segment_address = tmp_res3;
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
if (local_dependent_slice_segment_flag == 0) {
local_slice_segment_address = slice_segment_address;
slice_addr = local_slice_segment_address;
local_slice_idx = slice_idx;
slice_idx = local_slice_idx + 1;
}
} else {
slice_segment_address = 0;
slice_addr = 0;
}
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples0 = sps_pic_width_in_luma_samples[local_sps_id];
pictSize[0] = tmp_sps_pic_width_in_luma_samples0;
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples0 = sps_pic_height_in_luma_samples[local_sps_id];
pictSize[1] = tmp_sps_pic_height_in_luma_samples0;
local_first_slice_segment_in_pic_flag = first_slice_segment_in_pic_flag;
if (local_first_slice_segment_in_pic_flag == 1) {
local_PART_MODE_PICT = HevcDecoder_Algo_Parser_PART_MODE_PICT;
part_mode = local_PART_MODE_PICT;
} else {
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
if (local_dependent_slice_segment_flag == 0) {
local_PART_MODE_SLICE_INDEP = HevcDecoder_Algo_Parser_PART_MODE_SLICE_INDEP;
part_mode = local_PART_MODE_SLICE_INDEP;
} else {
local_PART_MODE_SLICE_DEP = HevcDecoder_Algo_Parser_PART_MODE_SLICE_DEP;
part_mode = local_PART_MODE_SLICE_DEP;
}
}
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
if (local_dependent_slice_segment_flag == 0) {
se_idx = 200;
} else {
se_idx = 6;
}
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = part_mode;
// Update ports indexes
index_PartMode += 1;
}
static i32 isSchedulable_read_SliceHeader_se_idx_11() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 200 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_11() {
u32 res[1];
u8 numbits;
i32 i;
u16 local_pps_id;
u8 tmp_pps_num_extra_slice_header_bits;
u32 tmp_res;
u8 tmp_pps_output_flag_present_flag;
u32 tmp_res0;
u16 local_sps_id;
u8 tmp_sps_separate_colour_plane_flag;
u8 local_nal_unit_type;
u8 local_NAL_IDR_W_DLP;
u8 local_NAL_IDR_N_LP;
u8 tmp_sps_log2_max_pic_order_cnt_lsb_minus4;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u8 local_short_term_ref_pic_set_sps_flag;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 tmp_sps_num_short_term_ref_pic_sets0;
i32 i0;
u8 local_PC_RPS_STRUCT_SIZE;
u32 tmp_res4;
i8 tmp_pcRPS;
i32 local_poc;
u8 local_slice_type;
u8 local_Log2CtbSize;
numbits = 0;
i = 0;
local_pps_id = pps_id;
tmp_pps_num_extra_slice_header_bits = pps_num_extra_slice_header_bits[local_pps_id];
while (i <= tmp_pps_num_extra_slice_header_bits - 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_reserved_undetermined_flag[i] ");
i = i + 1;
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "slice_type ");
tmp_res = res[0];
slice_type = tmp_res;
slice_temporal_mvp_enable_flag = 0;
idx = 0;
pic_output_flag = 1;
local_pps_id = pps_id;
tmp_pps_output_flag_present_flag = pps_output_flag_present_flag[local_pps_id];
if (tmp_pps_output_flag_present_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "pic_output_flag ");
tmp_res0 = res[0];
pic_output_flag = tmp_res0;
}
local_sps_id = sps_id;
tmp_sps_separate_colour_plane_flag = sps_separate_colour_plane_flag[local_sps_id];
if (tmp_sps_separate_colour_plane_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(2, fifo, res, "colour_plane_id ");
}
local_nal_unit_type = nal_unit_type;
local_NAL_IDR_W_DLP = HevcDecoder_Algo_Parser_NAL_IDR_W_DLP;
local_nal_unit_type = nal_unit_type;
local_NAL_IDR_N_LP = HevcDecoder_Algo_Parser_NAL_IDR_N_LP;
if (local_nal_unit_type == local_NAL_IDR_W_DLP || local_nal_unit_type == local_NAL_IDR_N_LP) {
poc = 0;
se_idx = 302;
} else {
local_sps_id = sps_id;
tmp_sps_log2_max_pic_order_cnt_lsb_minus4 = sps_log2_max_pic_order_cnt_lsb_minus4[local_sps_id];
HevcDecoder_Algo_Parser_vld_u_name(tmp_sps_log2_max_pic_order_cnt_lsb_minus4 + 4, fifo, res, "pic_order_cnt_lsb ");
tmp_res1 = res[0];
pic_order_cnt_lsb = tmp_res1;
tmp_res2 = res[0];
compute_POC(tmp_res2);
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "short_term_ref_pic_set_sps_flag ");
tmp_res3 = res[0];
short_term_ref_pic_set_sps_flag = tmp_res3;
local_short_term_ref_pic_set_sps_flag = short_term_ref_pic_set_sps_flag;
if (local_short_term_ref_pic_set_sps_flag != 0) {
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
while (1 << numbits < tmp_sps_num_short_term_ref_pic_sets) {
numbits = numbits + 1;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
}
res[0] = 0;
if (numbits > 0) {
HevcDecoder_Algo_Parser_vld_u_name(numbits, fifo, res, "short_term_ref_pic_set_idx ");
}
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets0 = sps_num_short_term_ref_pic_sets[local_sps_id];
i0 = 0;
local_PC_RPS_STRUCT_SIZE = HevcDecoder_Algo_Parser_PC_RPS_STRUCT_SIZE;
while (i0 <= local_PC_RPS_STRUCT_SIZE - 1) {
local_sps_id = sps_id;
tmp_res4 = res[0];
tmp_pcRPS = pcRPS[local_sps_id][tmp_res4][i0];
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets0][i0] = tmp_pcRPS;
i0 = i0 + 1;
}
se_idx = 301;
} else {
se_idx = 300;
}
}
local_poc = poc;
tokens_Poc[(index_Poc + (0)) % SIZE_Poc] = local_poc;
local_slice_type = slice_type;
tokens_SliceType[(index_SliceType + (0)) % SIZE_SliceType] = local_slice_type;
local_Log2CtbSize = Log2CtbSize;
tokens_LcuSizeMax[(index_LcuSizeMax + (0)) % SIZE_LcuSizeMax] = local_Log2CtbSize;
// Update ports indexes
index_Poc += 1;
index_SliceType += 1;
index_LcuSizeMax += 1;
}
static i32 isSchedulable_read_SliceHeader_se_idx_12() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 300 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_12() {
u32 res[1];
u8 inter_rps_flag;
u16 delta_idx;
u8 rIdx;
i32 deltaRPS;
i32 deltaPOC;
i32 k;
i32 k0;
i32 k1;
i32 delta_rps_sign;
i32 abs_delta_rps;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u32 tmp_res;
u8 tmp_sps_num_short_term_ref_pic_sets0;
u32 tmp_res0;
u8 i;
u8 local_NUM_PICS;
i8 tmp_pcRPS;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
i8 tmp_pcRPS0;
u8 local_DELTAPOC;
i8 tmp_pcRPS1;
u8 tmp_sps_num_short_term_ref_pic_sets1;
u8 tmp_sps_num_short_term_ref_pic_sets2;
u8 local_USED;
u32 tmp_res5;
u8 tmp_sps_num_short_term_ref_pic_sets3;
u8 tmp_sps_num_short_term_ref_pic_sets4;
u8 local_NUM_NEGATIVE_PICS;
u8 tmp_sps_num_short_term_ref_pic_sets5;
u8 local_NUM_POSITIVE_PICS;
u8 tmp_sps_num_short_term_ref_pic_sets6;
u8 tmp_sps_num_short_term_ref_pic_sets7;
u32 tmp_res6;
u8 tmp_sps_num_short_term_ref_pic_sets8;
u32 tmp_res7;
u8 tmp_sps_num_short_term_ref_pic_sets9;
u8 tmp_sps_num_short_term_ref_pic_sets10;
i8 tmp_pcRPS2;
u32 tmp_res8;
u8 tmp_sps_num_short_term_ref_pic_sets11;
i8 tmp_pcRPS3;
u8 tmp_sps_num_short_term_ref_pic_sets12;
i8 tmp_pcRPS4;
u8 tmp_sps_num_short_term_ref_pic_sets13;
i8 tmp_pcRPS5;
inter_rps_flag = 0;
delta_idx = 1;
k = 0;
k0 = 0;
k1 = 0;
prev = 0;
cnt_i = 0;
se_idx = 301;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
if (tmp_sps_num_short_term_ref_pic_sets != 0) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "inter_ref_pic_set_prediction_flag ");
inter_rps_flag = res[0];
}
if (inter_rps_flag == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_idx_minus1 ");
tmp_res = res[0];
delta_idx = tmp_res + 1;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets0 = sps_num_short_term_ref_pic_sets[local_sps_id];
rIdx = tmp_sps_num_short_term_ref_pic_sets0 - delta_idx;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "delta_rps_sign ");
delta_rps_sign = res[0];
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "abs_delta_rps_minus1 ");
tmp_res0 = res[0];
abs_delta_rps = tmp_res0 + 1;
deltaRPS = (1 - (delta_rps_sign << 1)) * abs_delta_rps;
i = 0;
local_sps_id = sps_id;
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS = pcRPS[local_sps_id][rIdx][local_NUM_PICS];
while (i <= tmp_pcRPS) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_flag ");
tmp_res1 = res[0];
if (tmp_res1 == 0) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "use_delta_flag ");
tmp_res2 = res[0];
res[0] = tmp_res2 << 1;
}
tmp_res3 = res[0];
tmp_res4 = res[0];
if (tmp_res3 == 1 || tmp_res4 == 2) {
local_sps_id = sps_id;
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS0 = pcRPS[local_sps_id][rIdx][local_NUM_PICS];
if (i < tmp_pcRPS0) {
local_sps_id = sps_id;
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
tmp_pcRPS1 = pcRPS[local_sps_id][rIdx][local_DELTAPOC + i];
deltaPOC = deltaRPS + tmp_pcRPS1;
} else {
deltaPOC = deltaRPS;
}
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets1 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets1][local_DELTAPOC + k] = deltaPOC;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets2 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_res5 = res[0];
if (tmp_res5 == 1) {
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets2][local_USED + k] = 1;
} else {
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets2][local_USED + k] = 0;
}
if (deltaPOC < 0) {
k0 = k0 + 1;
} else {
k1 = k1 + 1;
}
k = k + 1;
}
i = i + 1;
}
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets3 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets3][local_NUM_PICS] = k;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets4 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets4][local_NUM_NEGATIVE_PICS] = k0;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets5 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets5][local_NUM_POSITIVE_PICS] = k1;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets6 = sps_num_short_term_ref_pic_sets[local_sps_id];
HevcDecoder_Algo_Parser_sortDeltaPOC(local_sps_id, tmp_sps_num_short_term_ref_pic_sets6, pcRPS);
} else {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_negative_pics ");
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets7 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_res6 = res[0];
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets7][local_NUM_NEGATIVE_PICS] = tmp_res6;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_positive_pics ");
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets8 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
tmp_res7 = res[0];
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets8][local_NUM_POSITIVE_PICS] = tmp_res7;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets9 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets10 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS2 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets10][local_NUM_NEGATIVE_PICS];
tmp_res8 = res[0];
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets9][local_NUM_PICS] = tmp_pcRPS2 + tmp_res8;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets11 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS3 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets11][local_NUM_NEGATIVE_PICS];
if (tmp_pcRPS3 != 0) {
se_idx = 310;
} else {
prev = 0;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets12 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
tmp_pcRPS4 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets12][local_NUM_POSITIVE_PICS];
if (tmp_pcRPS4 != 0) {
se_idx = 320;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets13 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS5 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets13][local_NUM_NEGATIVE_PICS];
cnt_i = tmp_pcRPS5;
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_12_loop1() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_NUM_NEGATIVE_PICS;
i8 tmp_pcRPS;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_NUM_NEGATIVE_PICS];
result = local_se_idx == 310 && tmp_isFifoFull && local_cnt_i < tmp_pcRPS;
return result;
}
static void read_SliceHeader_se_idx_12_loop1() {
u32 res[1];
i32 local_prev;
u32 tmp_res;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_DELTAPOC;
u32 local_cnt_i;
u8 tmp_sps_num_short_term_ref_pic_sets0;
u8 local_USED;
u32 tmp_res0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_poc_s0_minus1 ");
local_prev = prev;
tmp_res = res[0];
prev = local_prev - tmp_res - 1;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
local_cnt_i = cnt_i;
local_prev = prev;
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_DELTAPOC + local_cnt_i] = local_prev;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_s0_flag ");
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets0 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_USED = HevcDecoder_Algo_Parser_USED;
local_cnt_i = cnt_i;
tmp_res0 = res[0];
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets0][local_USED + local_cnt_i] = tmp_res0;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_12_end_loop1() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_NUM_NEGATIVE_PICS;
i8 tmp_pcRPS;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_NUM_NEGATIVE_PICS];
result = local_se_idx == 310 && local_cnt_i == tmp_pcRPS;
return result;
}
static void read_SliceHeader_se_idx_12_end_loop1() {
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_NUM_POSITIVE_PICS;
i8 tmp_pcRPS;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_POSITIVE_PICS = HevcDecoder_Algo_Parser_NUM_POSITIVE_PICS;
tmp_pcRPS = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_NUM_POSITIVE_PICS];
if (tmp_pcRPS != 0) {
se_idx = 320;
prev = 0;
} else {
se_idx = 301;
cnt_i = 0;
}
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_12_loop2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_NUM_PICS;
i8 tmp_pcRPS;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_NUM_PICS];
result = local_se_idx == 320 && tmp_isFifoFull && local_cnt_i < tmp_pcRPS;
return result;
}
static void read_SliceHeader_se_idx_12_loop2() {
u32 res[1];
i32 local_prev;
u32 tmp_res;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_DELTAPOC;
u32 local_cnt_i;
u8 tmp_sps_num_short_term_ref_pic_sets0;
u8 local_USED;
u32 tmp_res0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_poc_s1_minus1 ");
local_prev = prev;
tmp_res = res[0];
prev = local_prev + tmp_res + 1;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_DELTAPOC = HevcDecoder_Algo_Parser_DELTAPOC;
local_cnt_i = cnt_i;
local_prev = prev;
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_DELTAPOC + local_cnt_i] = local_prev;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_s1_flag ");
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets0 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_USED = HevcDecoder_Algo_Parser_USED;
local_cnt_i = cnt_i;
tmp_res0 = res[0];
pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets0][local_USED + local_cnt_i] = tmp_res0;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_12_end_loop2() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_NUM_PICS;
i8 tmp_pcRPS;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_NUM_PICS];
result = local_se_idx == 320 && local_cnt_i == tmp_pcRPS;
return result;
}
static void read_SliceHeader_se_idx_12_end_loop2() {
se_idx = 301;
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_13() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 301 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_13() {
u32 res[1];
u8 lt_idx_sps;
u8 prevDeltaMSB;
u16 local_sps_id;
u8 tmp_sps_long_term_ref_pics_present_flag;
u8 tmp_sps_num_long_term_ref_pics_sps;
u32 tmp_res;
u32 tmp_res0;
i32 i;
u16 local_num_long_term_sps;
u16 local_num_long_term_pics;
u16 local_PicSizeInCtbsY;
i32 tmp_log2;
u16 tmp_lt_ref_pic_poc_lsb_sps;
u8 tmp_used_by_curr_pic_lt_sps_flag;
u8 tmp_sps_log2_max_pic_order_cnt_lsb_minus4;
u32 tmp_res1;
u32 tmp_res2;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_res5;
u32 tmp_res6;
u8 tmp_sps_temporal_mvp_enable_flag;
u32 tmp_res7;
lt_idx_sps = 0;
prevDeltaMSB = 0;
num_long_term_sps = 0;
num_long_term_pics = 0;
local_sps_id = sps_id;
tmp_sps_long_term_ref_pics_present_flag = sps_long_term_ref_pics_present_flag[local_sps_id];
if (tmp_sps_long_term_ref_pics_present_flag == 1) {
local_sps_id = sps_id;
tmp_sps_num_long_term_ref_pics_sps = sps_num_long_term_ref_pics_sps[local_sps_id];
if (tmp_sps_num_long_term_ref_pics_sps > 0) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_long_term_sps ");
tmp_res = res[0];
num_long_term_sps = tmp_res;
}
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_long_term_pics ");
tmp_res0 = res[0];
num_long_term_pics = tmp_res0;
i = 0;
local_num_long_term_sps = num_long_term_sps;
local_num_long_term_pics = num_long_term_pics;
while (i <= local_num_long_term_sps + local_num_long_term_pics - 1) {
local_num_long_term_sps = num_long_term_sps;
if (i < local_num_long_term_sps) {
local_num_long_term_pics = num_long_term_pics;
if (local_num_long_term_pics > 1) {
local_PicSizeInCtbsY = PicSizeInCtbsY;
tmp_log2 = HevcDecoder_Algo_Parser_log2((local_PicSizeInCtbsY - 1) << 1);
HevcDecoder_Algo_Parser_vld_u_name(tmp_log2, fifo, res, "lt_idx_sps ");
lt_idx_sps = res[0];
}
tmp_lt_ref_pic_poc_lsb_sps = lt_ref_pic_poc_lsb_sps[lt_idx_sps];
poc_lsb_lt[i] = tmp_lt_ref_pic_poc_lsb_sps;
tmp_used_by_curr_pic_lt_sps_flag = used_by_curr_pic_lt_sps_flag[lt_idx_sps];
UsedByCurrPicLt[i] = tmp_used_by_curr_pic_lt_sps_flag;
} else {
local_sps_id = sps_id;
tmp_sps_log2_max_pic_order_cnt_lsb_minus4 = sps_log2_max_pic_order_cnt_lsb_minus4[local_sps_id];
HevcDecoder_Algo_Parser_vld_u_name(tmp_sps_log2_max_pic_order_cnt_lsb_minus4 + 4, fifo, res, "poc_lsb_lt ");
tmp_res1 = res[0];
poc_lsb_lt[i] = tmp_res1;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "used_by_curr_pic_lt_flag ");
tmp_res2 = res[0];
UsedByCurrPicLt[i] = tmp_res2;
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "delta_poc_msb_present_flag ");
tmp_res3 = res[0];
delta_poc_msb_present_flag[i] = tmp_res3;
tmp_res4 = res[0];
if (tmp_res4 == 1) {
local_num_long_term_sps = num_long_term_sps;
if (i == 0 || i == local_num_long_term_sps) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_poc_msb_cycle_lt_minus1 ");
tmp_res5 = res[0];
DeltaPocMsbCycleLt[i] = tmp_res5;
} else {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "delta_poc_msb_cycle_lt_minus1 ");
tmp_res6 = res[0];
DeltaPocMsbCycleLt[i] = tmp_res6 + prevDeltaMSB;
}
prevDeltaMSB = DeltaPocMsbCycleLt[i];
}
i = i + 1;
}
}
local_sps_id = sps_id;
tmp_sps_temporal_mvp_enable_flag = sps_temporal_mvp_enable_flag[local_sps_id];
if (tmp_sps_temporal_mvp_enable_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_temporal_mvp_enable_flag ");
tmp_res7 = res[0];
slice_temporal_mvp_enable_flag = tmp_res7;
} else {
slice_temporal_mvp_enable_flag = 0;
}
se_idx = 302;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_14() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 302 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_14() {
u32 res[1];
i32 i;
i32 local_PICT_WIDTH;
u8 local_MIN_CTB_SIZE_Y;
u16 local_pps_id;
u16 tmp_pps_column_width;
u16 column_width[512];
i32 i0;
i32 local_PICT_HEIGHT;
u16 tmp_pps_row_height;
u16 row_height[256];
u8 num_tile_columns_minus1;
u8 num_tile_rows_minus1;
u8 uniform_spacing_flag;
u32 local_temporal_id;
u8 local_nal_unit_type;
u8 local_NAL_TRAIL_N;
u8 local_NAL_TSA_N;
u8 local_NAL_STSA_N;
u8 local_NAL_RADL_N;
u8 local_NAL_RADL_R;
u8 local_NAL_RASL_N;
u8 local_NAL_RASL_R;
u16 local_sps_id;
u8 tmp_sps_sample_adaptive_offset_enabled_flag;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
i32 i1;
u16 local_PicWidthInCtbsY;
u16 tmp_colWidth;
u8 local_Log2CtbSize;
u16 tmp_colTileInPix;
u16 tmp_pictSize;
u16 tmp_pictSize0;
i32 i2;
u16 tmp_column_width;
u16 tmp_colWidth0;
u16 tmp_colWidth1;
u16 tmp_colWidth2;
u16 tmp_colTileInPix0;
u16 tmp_pictSize1;
i32 i3;
u16 local_PicHeightInCtbsY;
u16 tmp_rowHeight;
u16 tmp_rowTileInPix;
u16 tmp_pictSize2;
u16 tmp_pictSize3;
i32 i4;
u16 tmp_row_height;
u16 tmp_rowHeight0;
u16 tmp_rowHeight1;
u16 tmp_rowHeight2;
u16 tmp_rowTileInPix0;
u16 tmp_pictSize4;
u32 local_TILE_SPLIT_ENABLE;
u16 tmp_pictSize5;
u16 tmp_pictSize6;
u8 tmp_TilesInfo;
u8 tmp_TilesInfo0;
u32 local_colIndex;
u16 tmp_colTileInPix1;
u16 tmp_colTileInPix2;
u32 local_rowIndex;
u16 tmp_rowTileInPix1;
u16 tmp_rowTileInPix2;
u8 tmp_TilesInfo1;
u8 tmp_TilesInfo2;
u8 tmp_TilesInfo3;
u32 local_prevColIndex;
u16 tmp_colTileInPix3;
u32 local_prevRowIndex;
u16 tmp_rowTileInPix3;
i = 0;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
while (i <= local_PICT_WIDTH / local_MIN_CTB_SIZE_Y - 1) {
local_pps_id = pps_id;
tmp_pps_column_width = pps_column_width[local_pps_id][i];
column_width[i] = tmp_pps_column_width;
i = i + 1;
}
i0 = 0;
local_PICT_HEIGHT = HevcDecoder_Algo_Parser_PICT_HEIGHT;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
while (i0 <= local_PICT_HEIGHT / local_MIN_CTB_SIZE_Y - 1) {
local_pps_id = pps_id;
tmp_pps_row_height = pps_row_height[local_pps_id][i0];
row_height[i0] = tmp_pps_row_height;
i0 = i0 + 1;
}
local_pps_id = pps_id;
num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
local_pps_id = pps_id;
num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
local_pps_id = pps_id;
uniform_spacing_flag = pps_uniform_spacing_flag[local_pps_id];
local_temporal_id = temporal_id;
local_nal_unit_type = nal_unit_type;
local_NAL_TRAIL_N = HevcDecoder_Algo_Parser_NAL_TRAIL_N;
local_nal_unit_type = nal_unit_type;
local_NAL_TSA_N = HevcDecoder_Algo_Parser_NAL_TSA_N;
local_nal_unit_type = nal_unit_type;
local_NAL_STSA_N = HevcDecoder_Algo_Parser_NAL_STSA_N;
local_nal_unit_type = nal_unit_type;
local_NAL_RADL_N = HevcDecoder_Algo_Parser_NAL_RADL_N;
local_nal_unit_type = nal_unit_type;
local_NAL_RADL_R = HevcDecoder_Algo_Parser_NAL_RADL_R;
local_nal_unit_type = nal_unit_type;
local_NAL_RASL_N = HevcDecoder_Algo_Parser_NAL_RASL_N;
local_nal_unit_type = nal_unit_type;
local_NAL_RASL_R = HevcDecoder_Algo_Parser_NAL_RASL_R;
if (local_temporal_id == 0 && local_nal_unit_type != local_NAL_TRAIL_N && local_nal_unit_type != local_NAL_TSA_N && local_nal_unit_type != local_NAL_STSA_N && local_nal_unit_type != local_NAL_RADL_N && local_nal_unit_type != local_NAL_RADL_R && local_nal_unit_type != local_NAL_RASL_N && local_nal_unit_type != local_NAL_RASL_R) {
}
local_sps_id = sps_id;
tmp_sps_sample_adaptive_offset_enabled_flag = sps_sample_adaptive_offset_enabled_flag[local_sps_id];
if (tmp_sps_sample_adaptive_offset_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_sao_luma_flag ");
tmp_res = res[0];
slice_sample_adaptive_offset_flag[0] = tmp_res;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_sao_chroma_flag ");
tmp_res0 = res[0];
slice_sample_adaptive_offset_flag[1] = tmp_res0;
tmp_res1 = res[0];
slice_sample_adaptive_offset_flag[2] = tmp_res1;
} else {
slice_sample_adaptive_offset_flag[0] = 0;
slice_sample_adaptive_offset_flag[1] = 0;
slice_sample_adaptive_offset_flag[2] = 0;
}
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
if (num_tile_columns_minus1 >= local_PICT_WIDTH / local_MIN_CTB_SIZE_Y) {
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
printf("Error read_SliceData.init : ColumnWidth : %u >= %i\n", num_tile_columns_minus1, local_PICT_WIDTH / local_MIN_CTB_SIZE_Y);
}
if (uniform_spacing_flag == 1) {
i1 = 0;
while (i1 <= num_tile_columns_minus1) {
local_pps_id = pps_id;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
colWidth[local_pps_id][i1] = (i1 + 1) * local_PicWidthInCtbsY / (num_tile_columns_minus1 + 1) - i1 * local_PicWidthInCtbsY / (num_tile_columns_minus1 + 1);
local_pps_id = pps_id;
tmp_colWidth = colWidth[local_pps_id][i1];
local_Log2CtbSize = Log2CtbSize;
tmp_colTileInPix = colTileInPix[i1];
colTileInPix[i1 + 1] = (tmp_colWidth << local_Log2CtbSize) + tmp_colTileInPix;
if (i1 == num_tile_columns_minus1) {
tmp_pictSize = pictSize[0];
colTileInPix[i1 + 1] = tmp_pictSize;
}
i1 = i1 + 1;
}
} else {
local_pps_id = pps_id;
local_PicWidthInCtbsY = PicWidthInCtbsY;
colWidth[local_pps_id][num_tile_columns_minus1] = local_PicWidthInCtbsY;
if (num_tile_columns_minus1 == 0) {
tmp_pictSize0 = pictSize[0];
colTileInPix[1] = tmp_pictSize0;
} else {
i2 = 0;
while (i2 <= num_tile_columns_minus1 - 1) {
local_pps_id = pps_id;
tmp_column_width = column_width[i2];
colWidth[local_pps_id][i2] = tmp_column_width;
local_pps_id = pps_id;
local_pps_id = pps_id;
tmp_colWidth0 = colWidth[local_pps_id][num_tile_columns_minus1];
local_pps_id = pps_id;
tmp_colWidth1 = colWidth[local_pps_id][i2];
colWidth[local_pps_id][num_tile_columns_minus1] = tmp_colWidth0 - tmp_colWidth1;
local_pps_id = pps_id;
tmp_colWidth2 = colWidth[local_pps_id][i2];
local_Log2CtbSize = Log2CtbSize;
tmp_colTileInPix0 = colTileInPix[i2];
colTileInPix[i2 + 1] = (tmp_colWidth2 << local_Log2CtbSize) + tmp_colTileInPix0;
if (i2 == num_tile_columns_minus1 - 1) {
tmp_pictSize1 = pictSize[0];
colTileInPix[i2 + 2] = tmp_pictSize1;
}
i2 = i2 + 1;
}
}
}
local_PICT_HEIGHT = HevcDecoder_Algo_Parser_PICT_HEIGHT;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
if (num_tile_rows_minus1 >= local_PICT_HEIGHT / local_MIN_CTB_SIZE_Y) {
local_PICT_HEIGHT = HevcDecoder_Algo_Parser_PICT_HEIGHT;
local_MIN_CTB_SIZE_Y = HevcDecoder_Algo_Parser_MIN_CTB_SIZE_Y;
printf("Error read_SliceData.init : RowHeight : %u >= %i\n", num_tile_rows_minus1, local_PICT_HEIGHT / local_MIN_CTB_SIZE_Y);
}
if (uniform_spacing_flag == 1) {
i3 = 0;
while (i3 <= num_tile_rows_minus1) {
local_pps_id = pps_id;
local_PicHeightInCtbsY = PicHeightInCtbsY;
local_PicHeightInCtbsY = PicHeightInCtbsY;
rowHeight[local_pps_id][i3] = (i3 + 1) * local_PicHeightInCtbsY / (num_tile_rows_minus1 + 1) - i3 * local_PicHeightInCtbsY / (num_tile_rows_minus1 + 1);
local_pps_id = pps_id;
tmp_rowHeight = rowHeight[local_pps_id][i3];
local_Log2CtbSize = Log2CtbSize;
tmp_rowTileInPix = rowTileInPix[i3];
rowTileInPix[i3 + 1] = (tmp_rowHeight << local_Log2CtbSize) + tmp_rowTileInPix;
if (i3 == num_tile_rows_minus1) {
tmp_pictSize2 = pictSize[1];
rowTileInPix[i3 + 1] = tmp_pictSize2;
}
i3 = i3 + 1;
}
} else {
local_pps_id = pps_id;
local_PicHeightInCtbsY = PicHeightInCtbsY;
rowHeight[local_pps_id][num_tile_rows_minus1] = local_PicHeightInCtbsY;
if (num_tile_rows_minus1 == 0) {
tmp_pictSize3 = pictSize[1];
rowTileInPix[1] = tmp_pictSize3;
} else {
i4 = 0;
while (i4 <= num_tile_rows_minus1 - 1) {
local_pps_id = pps_id;
tmp_row_height = row_height[i4];
rowHeight[local_pps_id][i4] = tmp_row_height;
local_pps_id = pps_id;
local_pps_id = pps_id;
tmp_rowHeight0 = rowHeight[local_pps_id][num_tile_columns_minus1];
local_pps_id = pps_id;
tmp_rowHeight1 = rowHeight[local_pps_id][i4];
rowHeight[local_pps_id][num_tile_rows_minus1] = tmp_rowHeight0 - tmp_rowHeight1;
local_pps_id = pps_id;
tmp_rowHeight2 = rowHeight[local_pps_id][i4];
local_Log2CtbSize = Log2CtbSize;
tmp_rowTileInPix0 = rowTileInPix[i4];
rowTileInPix[i4 + 1] = (tmp_rowHeight2 << local_Log2CtbSize) + tmp_rowTileInPix0;
if (i4 == num_tile_rows_minus1 - 1) {
tmp_pictSize4 = pictSize[1];
rowTileInPix[i4 + 2] = tmp_pictSize4;
}
i4 = i4 + 1;
}
}
}
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
if (local_TILE_SPLIT_ENABLE == 0) {
tmp_pictSize5 = pictSize[0];
pictOrTileSize[0] = tmp_pictSize5;
tmp_pictSize6 = pictSize[1];
pictOrTileSize[1] = tmp_pictSize6;
} else {
tmp_TilesInfo = TilesInfo[1];
colIndex = tmp_TilesInfo % (num_tile_columns_minus1 + 1);
tmp_TilesInfo0 = TilesInfo[1];
rowIndex = tmp_TilesInfo0 / (num_tile_columns_minus1 + 1);
local_colIndex = colIndex;
tmp_colTileInPix1 = colTileInPix[local_colIndex + 1];
local_colIndex = colIndex;
tmp_colTileInPix2 = colTileInPix[local_colIndex];
pictOrTileSize[0] = tmp_colTileInPix1 - tmp_colTileInPix2;
local_rowIndex = rowIndex;
tmp_rowTileInPix1 = rowTileInPix[local_rowIndex + 1];
local_rowIndex = rowIndex;
tmp_rowTileInPix2 = rowTileInPix[local_rowIndex];
pictOrTileSize[1] = tmp_rowTileInPix1 - tmp_rowTileInPix2;
tmp_TilesInfo1 = TilesInfo[1];
if (tmp_TilesInfo1 != 0) {
tmp_TilesInfo2 = TilesInfo[1];
prevColIndex = (tmp_TilesInfo2 - 1) % (num_tile_rows_minus1 + 1);
tmp_TilesInfo3 = TilesInfo[1];
prevRowIndex = (tmp_TilesInfo3 - 1) / (num_tile_columns_minus1 + 1);
local_prevColIndex = prevColIndex;
tmp_colTileInPix3 = colTileInPix[local_prevColIndex + 1];
prevTileCoord[0] = tmp_colTileInPix3;
local_prevRowIndex = prevRowIndex;
tmp_rowTileInPix3 = rowTileInPix[local_prevRowIndex + 1];
prevTileCoord[1] = tmp_rowTileInPix3;
}
}
se_idx = 2;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_2() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 2 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_2() {
u32 res[1];
i32 NumPocTotalCurr;
u8 local_slice_type;
u8 local_P_SLICE;
u8 local_B_SLICE;
u16 local_pps_id;
u8 tmp_pps_num_ref_idx_l0_default_active_minus1;
u8 tmp_pps_num_ref_idx_l1_default_active_minus1;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
i32 i;
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
u8 local_NUM_NEGATIVE_PICS;
i8 tmp_pcRPS;
u8 tmp_sps_num_short_term_ref_pic_sets0;
u8 local_USED;
i8 tmp_pcRPS0;
i32 i0;
u8 tmp_sps_num_short_term_ref_pic_sets1;
u8 tmp_sps_num_short_term_ref_pic_sets2;
u8 local_NUM_PICS;
i8 tmp_pcRPS1;
u8 tmp_sps_num_short_term_ref_pic_sets3;
i8 tmp_pcRPS2;
i32 i1;
u16 local_num_long_term_sps;
u16 local_num_long_term_pics;
u8 tmp_UsedByCurrPicLt;
u8 tmp_pps_lists_modification_present_flag;
u32 tmp_res2;
u8 tmp_ref_pic_list_modification_flag_lx;
i32 i2;
u8 local_num_ref_idx_l0_active;
i32 tmp_log2;
u32 tmp_res3;
u32 tmp_res4;
u8 tmp_ref_pic_list_modification_flag_lx0;
i32 i3;
u8 local_num_ref_idx_l1_active;
i32 tmp_log20;
u32 tmp_res5;
u32 tmp_res6;
NumPocTotalCurr = 0;
num_ref_idx_l0_active = 0;
num_ref_idx_l1_active = 0;
mvd_l1_zero_flag = 0;
local_slice_type = slice_type;
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_P_SLICE || local_slice_type == local_B_SLICE) {
local_pps_id = pps_id;
tmp_pps_num_ref_idx_l0_default_active_minus1 = pps_num_ref_idx_l0_default_active_minus1[local_pps_id];
num_ref_idx_l0_active = tmp_pps_num_ref_idx_l0_default_active_minus1 + 1;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_B_SLICE) {
local_pps_id = pps_id;
tmp_pps_num_ref_idx_l1_default_active_minus1 = pps_num_ref_idx_l1_default_active_minus1[local_pps_id];
num_ref_idx_l1_active = tmp_pps_num_ref_idx_l1_default_active_minus1 + 1;
}
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "num_ref_idx_active_override_flag ");
tmp_res = res[0];
if (tmp_res == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_ref_idx_l0_active_minus1 ");
tmp_res0 = res[0];
num_ref_idx_l0_active = tmp_res0 + 1;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_B_SLICE) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_ref_idx_l1_active_minus1 ");
tmp_res1 = res[0];
num_ref_idx_l1_active = tmp_res1 + 1;
}
}
ref_pic_list_modification_flag_lx[0] = 0;
ref_pic_list_modification_flag_lx[1] = 0;
i = 0;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
tmp_pcRPS = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets][local_NUM_NEGATIVE_PICS];
while (i <= tmp_pcRPS - 1) {
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets0 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_pcRPS0 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets0][local_USED + i];
if (tmp_pcRPS0 == 1) {
NumPocTotalCurr = NumPocTotalCurr + 1;
}
i = i + 1;
}
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets1 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_NEGATIVE_PICS = HevcDecoder_Algo_Parser_NUM_NEGATIVE_PICS;
i0 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets1][local_NUM_NEGATIVE_PICS];
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets2 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_NUM_PICS = HevcDecoder_Algo_Parser_NUM_PICS;
tmp_pcRPS1 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets2][local_NUM_PICS];
while (i0 <= tmp_pcRPS1 - 1) {
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets3 = sps_num_short_term_ref_pic_sets[local_sps_id];
local_USED = HevcDecoder_Algo_Parser_USED;
tmp_pcRPS2 = pcRPS[local_sps_id][tmp_sps_num_short_term_ref_pic_sets3][local_USED + i0];
if (tmp_pcRPS2 == 1) {
NumPocTotalCurr = NumPocTotalCurr + 1;
}
i0 = i0 + 1;
}
i1 = 0;
local_num_long_term_sps = num_long_term_sps;
local_num_long_term_pics = num_long_term_pics;
while (i1 <= local_num_long_term_sps + local_num_long_term_pics - 1) {
tmp_UsedByCurrPicLt = UsedByCurrPicLt[i1];
if (tmp_UsedByCurrPicLt == 1) {
NumPocTotalCurr = NumPocTotalCurr + 1;
}
i1 = i1 + 1;
}
local_pps_id = pps_id;
tmp_pps_lists_modification_present_flag = pps_lists_modification_present_flag[local_pps_id];
if (tmp_pps_lists_modification_present_flag == 1 && NumPocTotalCurr > 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "ref_pic_list_modification_flag_l0 ");
tmp_res2 = res[0];
ref_pic_list_modification_flag_lx[0] = tmp_res2;
tmp_ref_pic_list_modification_flag_lx = ref_pic_list_modification_flag_lx[0];
if (tmp_ref_pic_list_modification_flag_lx == 1) {
i2 = 0;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
while (i2 <= local_num_ref_idx_l0_active - 1) {
tmp_log2 = HevcDecoder_Algo_Parser_log2((NumPocTotalCurr - 1) << 1);
HevcDecoder_Algo_Parser_vld_u_name(tmp_log2, fifo, res, "list_entry_lx ");
tmp_res3 = res[0];
list_entry_lx[0][i2] = tmp_res3;
i2 = i2 + 1;
}
}
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_B_SLICE) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "ref_pic_list_modification_flag_l1 ");
tmp_res4 = res[0];
ref_pic_list_modification_flag_lx[1] = tmp_res4;
tmp_ref_pic_list_modification_flag_lx0 = ref_pic_list_modification_flag_lx[1];
if (tmp_ref_pic_list_modification_flag_lx0 == 1) {
i3 = 0;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
while (i3 <= local_num_ref_idx_l1_active - 1) {
tmp_log20 = HevcDecoder_Algo_Parser_log2((NumPocTotalCurr - 1) << 1);
HevcDecoder_Algo_Parser_vld_u_name(tmp_log20, fifo, res, "list_entry_lx ");
tmp_res5 = res[0];
list_entry_lx[1][i3] = tmp_res5;
i3 = i3 + 1;
}
}
}
}
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_B_SLICE) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "mvd_l1_zero_flag ");
tmp_res6 = res[0];
mvd_l1_zero_flag = tmp_res6;
}
}
se_idx = 10;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_sendRefPOC_init() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 10;
return result;
}
static void read_SliceHeader_sendRefPOC_init_aligned() {
u16 local_sps_id;
u8 tmp_sps_num_short_term_ref_pic_sets;
i32 local_poc;
u8 local_num_ref_idx_l0_active;
u8 local_num_ref_idx_l1_active;
local_sps_id = sps_id;
local_sps_id = sps_id;
tmp_sps_num_short_term_ref_pic_sets = sps_num_short_term_ref_pic_sets[local_sps_id];
local_poc = poc;
setRefTables(local_sps_id, tmp_sps_num_short_term_ref_pic_sets, pcRPS, local_poc);
idxNumPic = 0;
se_idx = 101;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
tokens_NumRefIdxLxActive[(index_NumRefIdxLxActive % SIZE_NumRefIdxLxActive) + (0)] = local_num_ref_idx_l0_active;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
tokens_NumRefIdxLxActive[(index_NumRefIdxLxActive % SIZE_NumRefIdxLxActive) + (1)] = local_num_ref_idx_l1_active;
// Update ports indexes
index_NumRefIdxLxActive += 2;
write_end_NumRefIdxLxActive();
}
static i32 isSchedulable_read_SliceHeader_sendListEntryL0Flag() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 101;
return result;
}
static void read_SliceHeader_sendListEntryL0Flag() {
u8 tmp_ref_pic_list_modification_flag_lx;
u8 tmp_ref_pic_list_modification_flag_lx0;
tmp_ref_pic_list_modification_flag_lx = ref_pic_list_modification_flag_lx[0];
if (tmp_ref_pic_list_modification_flag_lx == 0) {
se_idx = 201;
} else {
se_idx = 102;
}
tmp_ref_pic_list_modification_flag_lx0 = ref_pic_list_modification_flag_lx[0];
tokens_RefPicListModif[(index_RefPicListModif + (0)) % SIZE_RefPicListModif] = tmp_ref_pic_list_modification_flag_lx0;
// Update ports indexes
index_RefPicListModif += 1;
}
static i32 isSchedulable_read_SliceHeader_sendListEntryL0Loop() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
result = local_se_idx == 102 && local_cnt_i < local_num_ref_idx_l0_active;
return result;
}
static void read_SliceHeader_sendListEntryL0Loop() {
u32 local_cnt_i;
u8 tmp_list_entry_lx;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_cnt_i = cnt_i;
tmp_list_entry_lx = list_entry_lx[0][local_cnt_i - 1];
tokens_RefPicListModif[(index_RefPicListModif + (0)) % SIZE_RefPicListModif] = tmp_list_entry_lx;
// Update ports indexes
index_RefPicListModif += 1;
}
static i32 isSchedulable_read_SliceHeader_sendListEntryL0End() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
result = local_se_idx == 102 && local_cnt_i == local_num_ref_idx_l0_active;
return result;
}
static void read_SliceHeader_sendListEntryL0End() {
cnt_i = 0;
se_idx = 201;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_sendListEntryL1Flag() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 201;
return result;
}
static void read_SliceHeader_sendListEntryL1Flag() {
u8 tmp_ref_pic_list_modification_flag_lx;
u8 tmp_ref_pic_list_modification_flag_lx0;
tmp_ref_pic_list_modification_flag_lx = ref_pic_list_modification_flag_lx[1];
if (tmp_ref_pic_list_modification_flag_lx == 0) {
se_idx = 11;
} else {
se_idx = 202;
}
tmp_ref_pic_list_modification_flag_lx0 = ref_pic_list_modification_flag_lx[1];
tokens_RefPicListModif[(index_RefPicListModif + (0)) % SIZE_RefPicListModif] = tmp_ref_pic_list_modification_flag_lx0;
// Update ports indexes
index_RefPicListModif += 1;
}
static i32 isSchedulable_read_SliceHeader_sendListEntryL1Loop() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
result = local_se_idx == 202 && local_cnt_i < local_num_ref_idx_l1_active;
return result;
}
static void read_SliceHeader_sendListEntryL1Loop() {
u32 local_cnt_i;
u8 tmp_list_entry_lx;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_cnt_i = cnt_i;
tmp_list_entry_lx = list_entry_lx[1][local_cnt_i - 1];
tokens_RefPicListModif[(index_RefPicListModif + (0)) % SIZE_RefPicListModif] = tmp_list_entry_lx;
// Update ports indexes
index_RefPicListModif += 1;
}
static i32 isSchedulable_read_SliceHeader_sendListEntryL1End() {
i32 result;
u16 local_se_idx;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
local_se_idx = se_idx;
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
result = local_se_idx == 202 && local_cnt_i == local_num_ref_idx_l1_active;
return result;
}
static void read_SliceHeader_sendListEntryL1End() {
cnt_i = 0;
se_idx = 11;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_sendRefPOC_sendSize() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 11;
return result;
}
static void read_SliceHeader_sendRefPOC_sendSize() {
u8 local_idxNumPic;
i16 refPocSize;
i32 tmp_numPic;
local_idxNumPic = idxNumPic;
refPocSize = numPic[local_idxNumPic];
local_idxNumPic = idxNumPic;
tmp_numPic = numPic[local_idxNumPic];
if (tmp_numPic == 0) {
local_idxNumPic = idxNumPic;
idxNumPic = local_idxNumPic + 1;
local_idxNumPic = idxNumPic;
if (local_idxNumPic == 5) {
se_idx = 3;
}
} else {
idxRefPoc = 0;
se_idx = 12;
}
tokens_RefPoc[(index_RefPoc + (0)) % SIZE_RefPoc] = refPocSize;
// Update ports indexes
index_RefPoc += 1;
}
static i32 isSchedulable_read_SliceHeader_sendRefPOC_sendRefPoc() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 12;
return result;
}
static void read_SliceHeader_sendRefPOC_sendRefPoc() {
u8 local_idxNumPic;
u8 local_idxRefPoc;
i16 refPoc;
i32 tmp_numPic;
local_idxNumPic = idxNumPic;
local_idxRefPoc = idxRefPoc;
refPoc = pocTables[local_idxNumPic][local_idxRefPoc];
local_idxRefPoc = idxRefPoc;
idxRefPoc = local_idxRefPoc + 1;
local_idxRefPoc = idxRefPoc;
local_idxNumPic = idxNumPic;
tmp_numPic = numPic[local_idxNumPic];
if (local_idxRefPoc == tmp_numPic) {
local_idxNumPic = idxNumPic;
idxNumPic = local_idxNumPic + 1;
local_idxNumPic = idxNumPic;
if (local_idxNumPic == 5) {
se_idx = 3;
} else {
se_idx = 11;
}
}
tokens_RefPoc[(index_RefPoc + (0)) % SIZE_RefPoc] = refPoc;
// Update ports indexes
index_RefPoc += 1;
}
static i32 isSchedulable_read_SliceHeader_se_idx_3() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 3 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_3() {
u32 res[1];
u8 weighted_pred_flag;
u8 collocated_from_l0_flag;
u8 local_slice_type;
u8 local_P_SLICE;
u8 local_B_SLICE;
u16 local_pps_id;
u8 tmp_pps_cabac_init_present_flag;
u32 tmp_res;
u8 local_slice_temporal_mvp_enable_flag;
u32 tmp_res0;
u8 local_num_ref_idx_l0_active;
u8 local_num_ref_idx_l1_active;
u32 tmp_res1;
u8 tmp_pps_weighted_pred_flag;
u8 tmp_pps_weighted_bipred_flag;
weighted_pred_flag = 0;
collocated_from_l0_flag = 1;
collocated_from_lX = 0;
collocated_ref_idx = 0;
cabac_init_flag = 0;
se_idx = 5;
local_slice_type = slice_type;
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_P_SLICE || local_slice_type == local_B_SLICE) {
local_pps_id = pps_id;
tmp_pps_cabac_init_present_flag = pps_cabac_init_present_flag[local_pps_id];
if (tmp_pps_cabac_init_present_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "cabac_init_flag ");
tmp_res = res[0];
cabac_init_flag = tmp_res;
}
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
if (local_slice_temporal_mvp_enable_flag == 1) {
res[0] = 1;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_B_SLICE) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "collocated_from_l0_flag ");
collocated_from_l0_flag = res[0];
tmp_res0 = res[0];
collocated_from_lX = tmp_res0;
}
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
if (collocated_from_l0_flag == 1 && local_num_ref_idx_l0_active > 1 || collocated_from_l0_flag == 0 && local_num_ref_idx_l1_active > 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "collocated_ref_idx ");
tmp_res1 = res[0];
collocated_ref_idx = tmp_res1;
}
}
local_pps_id = pps_id;
tmp_pps_weighted_pred_flag = pps_weighted_pred_flag[local_pps_id];
local_pps_id = pps_id;
tmp_pps_weighted_bipred_flag = pps_weighted_bipred_flag[local_pps_id];
if (tmp_pps_weighted_pred_flag == 1 || tmp_pps_weighted_bipred_flag == 1) {
weighted_pred_flag = 1;
}
if (weighted_pred_flag != 0) {
se_idx = 4;
}
}
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = weighted_pred_flag;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_start() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u8 local_slice_type;
u8 local_P_SLICE;
u8 local_B_SLICE;
u16 local_pps_id;
u8 tmp_pps_weighted_pred_flag;
u8 tmp_pps_weighted_bipred_flag;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_slice_type = slice_type;
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
local_pps_id = pps_id;
tmp_pps_weighted_pred_flag = pps_weighted_pred_flag[local_pps_id];
local_slice_type = slice_type;
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
local_pps_id = pps_id;
tmp_pps_weighted_bipred_flag = pps_weighted_bipred_flag[local_pps_id];
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
result = local_se_idx == 4 && tmp_isFifoFull && (local_slice_type == local_P_SLICE || local_slice_type == local_B_SLICE) && (tmp_pps_weighted_pred_flag == 1 && local_slice_type == local_P_SLICE || tmp_pps_weighted_bipred_flag == 1 && local_slice_type == local_B_SLICE);
return result;
}
static void weighted_start() {
u32 res[1];
u8 luma_log2_weight_denom;
i8 delta_chroma_log2_weight_denom;
u16 local_sps_id;
u8 tmp_sps_chroma_format_idc;
luma_log2_weight_denom = 0;
delta_chroma_log2_weight_denom = 0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "luma_log2_weight_denom ");
luma_log2_weight_denom = res[0];
local_sps_id = sps_id;
tmp_sps_chroma_format_idc = sps_chroma_format_idc[local_sps_id];
if (tmp_sps_chroma_format_idc != 0) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_log2_weight_denom ");
delta_chroma_log2_weight_denom = res[0];
}
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = luma_log2_weight_denom;
tokens_WeightedPred[(index_WeightedPred + (1)) % SIZE_WeightedPred] = delta_chroma_log2_weight_denom;
// Update ports indexes
index_WeightedPred += 2;
write_end_WeightedPred();
}
static void weighted_start_aligned() {
u32 res[1];
u8 luma_log2_weight_denom;
i8 delta_chroma_log2_weight_denom;
u16 local_sps_id;
u8 tmp_sps_chroma_format_idc;
luma_log2_weight_denom = 0;
delta_chroma_log2_weight_denom = 0;
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "luma_log2_weight_denom ");
luma_log2_weight_denom = res[0];
local_sps_id = sps_id;
tmp_sps_chroma_format_idc = sps_chroma_format_idc[local_sps_id];
if (tmp_sps_chroma_format_idc != 0) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_log2_weight_denom ");
delta_chroma_log2_weight_denom = res[0];
}
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (0)] = luma_log2_weight_denom;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (1)] = delta_chroma_log2_weight_denom;
// Update ports indexes
index_WeightedPred += 2;
write_end_WeightedPred();
}
static i32 isSchedulable_weighted_luma_l0() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void weighted_luma_l0() {
u32 res[1];
u32 local_cnt_i;
u32 tmp_res;
u8 tmp_luma_weight_l0_flag;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "luma_weight_lX_flag ");
local_cnt_i = cnt_i;
tmp_res = res[0];
luma_weight_l0_flag[local_cnt_i] = tmp_res;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_cnt_i = cnt_i;
tmp_luma_weight_l0_flag = luma_weight_l0_flag[local_cnt_i - 1];
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = tmp_luma_weight_l0_flag;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_end_luma_l0() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
result = tmp_isFifoFull && local_cnt_i == local_num_ref_idx_l0_active;
return result;
}
static void weighted_end_luma_l0() {
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_weighted_chroma_l0() {
i32 result;
i32 tmp_isFifoFull;
u16 local_sps_id;
u8 tmp_sps_chroma_format_idc;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_id = sps_id;
tmp_sps_chroma_format_idc = sps_chroma_format_idc[local_sps_id];
result = tmp_isFifoFull && tmp_sps_chroma_format_idc == 1;
return result;
}
static void weighted_chroma_l0() {
u32 res[1];
u32 local_cnt_i;
u32 tmp_res;
u8 tmp_chroma_weight_l0_flag;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "chroma_weight_lX_flag ");
local_cnt_i = cnt_i;
tmp_res = res[0];
chroma_weight_l0_flag[local_cnt_i] = tmp_res;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_cnt_i = cnt_i;
tmp_chroma_weight_l0_flag = chroma_weight_l0_flag[local_cnt_i - 1];
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = tmp_chroma_weight_l0_flag;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_end_chroma_l0() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
result = tmp_isFifoFull && local_cnt_i == local_num_ref_idx_l0_active;
return result;
}
static void weighted_end_chroma_l0() {
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l0_skip_loop() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 tmp_luma_weight_l0_flag;
u8 tmp_chroma_weight_l0_flag;
u8 local_num_ref_idx_l0_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
tmp_luma_weight_l0_flag = luma_weight_l0_flag[local_cnt_i];
local_cnt_i = cnt_i;
tmp_chroma_weight_l0_flag = chroma_weight_l0_flag[local_cnt_i];
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
result = tmp_isFifoFull && tmp_luma_weight_l0_flag == 0 && tmp_chroma_weight_l0_flag == 0 && local_cnt_i < local_num_ref_idx_l0_active;
return result;
}
static void weighted_deltaLuma_l0_skip_loop() {
u32 local_cnt_i;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l0_skip_loop_done() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
u8 local_slice_type;
u8 local_B_SLICE;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
result = tmp_isFifoFull && local_cnt_i == local_num_ref_idx_l0_active && local_slice_type == local_B_SLICE;
return result;
}
static void weighted_deltaLuma_l0_skip_loop_done() {
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l0__skip_all() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
u8 local_slice_type;
u8 local_B_SLICE;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
result = tmp_isFifoFull && local_cnt_i == local_num_ref_idx_l0_active && local_slice_type != local_B_SLICE;
return result;
}
static void weighted_deltaLuma_l0__skip_all() {
cnt_i = 0;
se_idx = 5;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l0_send() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 tmp_luma_weight_l0_flag;
u8 local_num_ref_idx_l0_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
tmp_luma_weight_l0_flag = luma_weight_l0_flag[local_cnt_i];
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
result = tmp_isFifoFull && tmp_luma_weight_l0_flag == 1 && local_cnt_i < local_num_ref_idx_l0_active;
return result;
}
static void weighted_deltaLuma_l0_send() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
i8 local_delta_luma_weight_l0;
i8 local_luma_offset_l0;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_luma_weight_lX ");
tmp_res = res[0];
delta_luma_weight_l0 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "luma_offset_lX ");
tmp_res0 = res[0];
luma_offset_l0 = tmp_res0;
local_delta_luma_weight_l0 = delta_luma_weight_l0;
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = local_delta_luma_weight_l0;
local_luma_offset_l0 = luma_offset_l0;
tokens_WeightedPred[(index_WeightedPred + (1)) % SIZE_WeightedPred] = local_luma_offset_l0;
// Update ports indexes
index_WeightedPred += 2;
write_end_WeightedPred();
}
static void weighted_deltaLuma_l0_send_aligned() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
i8 local_delta_luma_weight_l0;
i8 local_luma_offset_l0;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_luma_weight_lX ");
tmp_res = res[0];
delta_luma_weight_l0 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "luma_offset_lX ");
tmp_res0 = res[0];
luma_offset_l0 = tmp_res0;
local_delta_luma_weight_l0 = delta_luma_weight_l0;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (0)] = local_delta_luma_weight_l0;
local_luma_offset_l0 = luma_offset_l0;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (1)] = local_luma_offset_l0;
// Update ports indexes
index_WeightedPred += 2;
write_end_WeightedPred();
}
static i32 isSchedulable_weighted_deltaLuma_l0_skip() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
u8 tmp_luma_weight_l0_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_cnt_i = cnt_i;
tmp_luma_weight_l0_flag = luma_weight_l0_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l0_active && tmp_luma_weight_l0_flag == 0;
return result;
}
static void weighted_deltaLuma_l0_skip() {
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaChroma_l0_skip() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
u8 tmp_chroma_weight_l0_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_cnt_i = cnt_i;
tmp_chroma_weight_l0_flag = chroma_weight_l0_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l0_active && tmp_chroma_weight_l0_flag == 0;
return result;
}
static void weighted_deltaChroma_l0_skip() {
u32 local_cnt_i;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaChroma_l0_send() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
u8 tmp_chroma_weight_l0_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_cnt_i = cnt_i;
tmp_chroma_weight_l0_flag = chroma_weight_l0_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l0_active && tmp_chroma_weight_l0_flag == 1;
return result;
}
static void weighted_deltaChroma_l0_send() {
u32 res[1];
u32 tmp_res;
i8 local_delta_chroma_weight_l00;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_weight_lX ");
tmp_res = res[0];
delta_chroma_weight_l00 = tmp_res;
local_delta_chroma_weight_l00 = delta_chroma_weight_l00;
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = local_delta_chroma_weight_l00;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_deltaChroma_offset_l0_send() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l0_active;
u8 tmp_chroma_weight_l0_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
local_cnt_i = cnt_i;
tmp_chroma_weight_l0_flag = chroma_weight_l0_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l0_active && tmp_chroma_weight_l0_flag == 1;
return result;
}
static void weighted_deltaChroma_offset_l0_send() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 local_cnt_i;
i16 local_delta_chroma_offset_l00;
i8 local_delta_chroma_weight_l01;
i16 local_delta_chroma_offset_l01;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res = res[0];
delta_chroma_offset_l00 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_weight_lX ");
tmp_res0 = res[0];
delta_chroma_weight_l01 = tmp_res0;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res1 = res[0];
delta_chroma_offset_l01 = tmp_res1;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_delta_chroma_offset_l00 = delta_chroma_offset_l00;
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = local_delta_chroma_offset_l00;
local_delta_chroma_weight_l01 = delta_chroma_weight_l01;
tokens_WeightedPred[(index_WeightedPred + (1)) % SIZE_WeightedPred] = local_delta_chroma_weight_l01;
local_delta_chroma_offset_l01 = delta_chroma_offset_l01;
tokens_WeightedPred[(index_WeightedPred + (2)) % SIZE_WeightedPred] = local_delta_chroma_offset_l01;
// Update ports indexes
index_WeightedPred += 3;
write_end_WeightedPred();
}
static void weighted_deltaChroma_offset_l0_send_aligned() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 local_cnt_i;
i16 local_delta_chroma_offset_l00;
i8 local_delta_chroma_weight_l01;
i16 local_delta_chroma_offset_l01;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res = res[0];
delta_chroma_offset_l00 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_weight_lX ");
tmp_res0 = res[0];
delta_chroma_weight_l01 = tmp_res0;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res1 = res[0];
delta_chroma_offset_l01 = tmp_res1;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_delta_chroma_offset_l00 = delta_chroma_offset_l00;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (0)] = local_delta_chroma_offset_l00;
local_delta_chroma_weight_l01 = delta_chroma_weight_l01;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (1)] = local_delta_chroma_weight_l01;
local_delta_chroma_offset_l01 = delta_chroma_offset_l01;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (2)] = local_delta_chroma_offset_l01;
// Update ports indexes
index_WeightedPred += 3;
write_end_WeightedPred();
}
static i32 isSchedulable_weighted_luma_l1() {
i32 result;
i32 tmp_isFifoFull;
u8 local_slice_type;
u8 local_B_SLICE;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
result = tmp_isFifoFull && local_slice_type == local_B_SLICE;
return result;
}
static void weighted_luma_l1() {
u32 res[1];
u32 local_cnt_i;
u32 tmp_res;
u8 tmp_luma_weight_l1_flag;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "luma_weight_lX_flag ");
local_cnt_i = cnt_i;
tmp_res = res[0];
luma_weight_l1_flag[local_cnt_i] = tmp_res;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_cnt_i = cnt_i;
tmp_luma_weight_l1_flag = luma_weight_l1_flag[local_cnt_i - 1];
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = tmp_luma_weight_l1_flag;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_end_luma_l1() {
i32 result;
i32 tmp_isFifoFull;
u8 local_slice_type;
u8 local_B_SLICE;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
result = tmp_isFifoFull && local_slice_type == local_B_SLICE && local_cnt_i == local_num_ref_idx_l1_active;
return result;
}
static void weighted_end_luma_l1() {
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_weighted_chroma_l1_skip() {
i32 result;
i32 tmp_isFifoFull;
u16 local_sps_id;
u8 tmp_sps_chroma_format_idc;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_id = sps_id;
tmp_sps_chroma_format_idc = sps_chroma_format_idc[local_sps_id];
result = tmp_isFifoFull && tmp_sps_chroma_format_idc == 0;
return result;
}
static void weighted_chroma_l1_skip() {
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_weighted_chroma_l1() {
i32 result;
i32 tmp_isFifoFull;
u16 local_sps_id;
u8 tmp_sps_chroma_format_idc;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_id = sps_id;
tmp_sps_chroma_format_idc = sps_chroma_format_idc[local_sps_id];
result = tmp_isFifoFull && tmp_sps_chroma_format_idc != 0;
return result;
}
static void weighted_chroma_l1() {
u32 res[1];
u32 local_cnt_i;
u32 tmp_res;
u8 tmp_chroma_weight_l1_flag;
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "chroma_weight_lX_flag ");
local_cnt_i = cnt_i;
tmp_res = res[0];
chroma_weight_l1_flag[local_cnt_i] = tmp_res;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_cnt_i = cnt_i;
tmp_chroma_weight_l1_flag = chroma_weight_l1_flag[local_cnt_i - 1];
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = tmp_chroma_weight_l1_flag;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_end_chroma_l1() {
i32 result;
i32 tmp_isFifoFull;
u16 local_sps_id;
u8 tmp_sps_chroma_format_idc;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sps_id = sps_id;
tmp_sps_chroma_format_idc = sps_chroma_format_idc[local_sps_id];
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
result = tmp_isFifoFull && tmp_sps_chroma_format_idc != 0 && local_cnt_i == local_num_ref_idx_l1_active;
return result;
}
static void weighted_end_chroma_l1() {
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l1_skip_loop() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 tmp_luma_weight_l1_flag;
u8 tmp_chroma_weight_l1_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
tmp_luma_weight_l1_flag = luma_weight_l1_flag[local_cnt_i];
local_cnt_i = cnt_i;
tmp_chroma_weight_l1_flag = chroma_weight_l1_flag[local_cnt_i];
result = tmp_isFifoFull && tmp_luma_weight_l1_flag == 0 && tmp_chroma_weight_l1_flag == 0;
return result;
}
static void weighted_deltaLuma_l1_skip_loop() {
u32 local_cnt_i;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l1_skip_loop_done() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
result = tmp_isFifoFull && local_cnt_i == local_num_ref_idx_l1_active;
return result;
}
static void weighted_deltaLuma_l1_skip_loop_done() {
cnt_i = 0;
se_idx = 5;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaLuma_l1_send() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
u8 tmp_luma_weight_l1_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
local_cnt_i = cnt_i;
tmp_luma_weight_l1_flag = luma_weight_l1_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l1_active && tmp_luma_weight_l1_flag == 1;
return result;
}
static void weighted_deltaLuma_l1_send() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
i8 local_delta_luma_weight_l1;
i8 local_luma_offset_l1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_luma_weight_lX ");
tmp_res = res[0];
delta_luma_weight_l1 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "luma_offset_lX ");
tmp_res0 = res[0];
luma_offset_l1 = tmp_res0;
local_delta_luma_weight_l1 = delta_luma_weight_l1;
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = local_delta_luma_weight_l1;
local_luma_offset_l1 = luma_offset_l1;
tokens_WeightedPred[(index_WeightedPred + (1)) % SIZE_WeightedPred] = local_luma_offset_l1;
// Update ports indexes
index_WeightedPred += 2;
write_end_WeightedPred();
}
static void weighted_deltaLuma_l1_send_aligned() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
i8 local_delta_luma_weight_l1;
i8 local_luma_offset_l1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_luma_weight_lX ");
tmp_res = res[0];
delta_luma_weight_l1 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "luma_offset_lX ");
tmp_res0 = res[0];
luma_offset_l1 = tmp_res0;
local_delta_luma_weight_l1 = delta_luma_weight_l1;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (0)] = local_delta_luma_weight_l1;
local_luma_offset_l1 = luma_offset_l1;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (1)] = local_luma_offset_l1;
// Update ports indexes
index_WeightedPred += 2;
write_end_WeightedPred();
}
static i32 isSchedulable_weighted_deltaLuma_l1_skip() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
u8 tmp_luma_weight_l1_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
local_cnt_i = cnt_i;
tmp_luma_weight_l1_flag = luma_weight_l1_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l1_active && tmp_luma_weight_l1_flag == 0;
return result;
}
static void weighted_deltaLuma_l1_skip() {
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaChroma_l1_skip() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
u8 tmp_chroma_weight_l1_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
local_cnt_i = cnt_i;
tmp_chroma_weight_l1_flag = chroma_weight_l1_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l1_active && tmp_chroma_weight_l1_flag == 0;
return result;
}
static void weighted_deltaChroma_l1_skip() {
u32 local_cnt_i;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_weighted_deltaChroma_l1_send() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
u8 tmp_chroma_weight_l1_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
local_cnt_i = cnt_i;
tmp_chroma_weight_l1_flag = chroma_weight_l1_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l1_active && tmp_chroma_weight_l1_flag == 1;
return result;
}
static void weighted_deltaChroma_l1_send() {
u32 res[1];
u32 tmp_res;
i8 local_delta_chroma_weight_l10;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_weight_lX ");
tmp_res = res[0];
delta_chroma_weight_l10 = tmp_res;
local_delta_chroma_weight_l10 = delta_chroma_weight_l10;
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = local_delta_chroma_weight_l10;
// Update ports indexes
index_WeightedPred += 1;
}
static i32 isSchedulable_weighted_deltaChroma_offset_l1_send() {
i32 result;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u8 local_num_ref_idx_l1_active;
u8 tmp_chroma_weight_l1_flag;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
local_cnt_i = cnt_i;
tmp_chroma_weight_l1_flag = chroma_weight_l1_flag[local_cnt_i];
result = tmp_isFifoFull && local_cnt_i < local_num_ref_idx_l1_active && tmp_chroma_weight_l1_flag == 1;
return result;
}
static void weighted_deltaChroma_offset_l1_send() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 local_cnt_i;
i16 local_delta_chroma_offset_l10;
i8 local_delta_chroma_weight_l11;
i16 local_delta_chroma_offset_l11;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res = res[0];
delta_chroma_offset_l10 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_weight_lX ");
tmp_res0 = res[0];
delta_chroma_weight_l11 = tmp_res0;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res1 = res[0];
delta_chroma_offset_l11 = tmp_res1;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_delta_chroma_offset_l10 = delta_chroma_offset_l10;
tokens_WeightedPred[(index_WeightedPred + (0)) % SIZE_WeightedPred] = local_delta_chroma_offset_l10;
local_delta_chroma_weight_l11 = delta_chroma_weight_l11;
tokens_WeightedPred[(index_WeightedPred + (1)) % SIZE_WeightedPred] = local_delta_chroma_weight_l11;
local_delta_chroma_offset_l11 = delta_chroma_offset_l11;
tokens_WeightedPred[(index_WeightedPred + (2)) % SIZE_WeightedPred] = local_delta_chroma_offset_l11;
// Update ports indexes
index_WeightedPred += 3;
write_end_WeightedPred();
}
static void weighted_deltaChroma_offset_l1_send_aligned() {
u32 res[1];
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 local_cnt_i;
i16 local_delta_chroma_offset_l10;
i8 local_delta_chroma_weight_l11;
i16 local_delta_chroma_offset_l11;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res = res[0];
delta_chroma_offset_l10 = tmp_res;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_weight_lX ");
tmp_res0 = res[0];
delta_chroma_weight_l11 = tmp_res0;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "delta_chroma_offset_lX ");
tmp_res1 = res[0];
delta_chroma_offset_l11 = tmp_res1;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_delta_chroma_offset_l10 = delta_chroma_offset_l10;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (0)] = local_delta_chroma_offset_l10;
local_delta_chroma_weight_l11 = delta_chroma_weight_l11;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (1)] = local_delta_chroma_weight_l11;
local_delta_chroma_offset_l11 = delta_chroma_offset_l11;
tokens_WeightedPred[(index_WeightedPred % SIZE_WeightedPred) + (2)] = local_delta_chroma_offset_l11;
// Update ports indexes
index_WeightedPred += 3;
write_end_WeightedPred();
}
static i32 isSchedulable_read_SliceHeader_se_idx_5() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 5 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_5() {
u32 res[1];
u16 local_pps_id;
u8 slice_disable_deblocking_filter_flag;
i8 betaOff;
i8 tcOff;
u8 local_slice_type;
u8 local_P_SLICE;
u8 local_B_SLICE;
u32 tmp_res;
i32 tmp_pps_init_qp_minus26;
u32 tmp_res0;
u8 tmp_pps_slice_chroma_qp_offsets_present_flag;
u32 tmp_res1;
u32 tmp_res2;
u8 tmp_pps_deblocking_filter_control_present_flag;
u8 tmp_deblocking_filter_override_enabled_flag;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_res5;
u16 local_sps_id;
u8 tmp_pps_loop_filter_across_slice_enabled_flag;
u8 tmp_slice_sample_adaptive_offset_flag;
u8 tmp_slice_sample_adaptive_offset_flag0;
u16 local_se_idx;
i8 tmp_pps_cb_qp_offset;
i8 local_slice_cb_qp_offset;
i8 tmp_pps_cr_qp_offset;
i8 local_slice_cr_qp_offset;
local_pps_id = pps_id;
slice_disable_deblocking_filter_flag = pps_disable_deblocking_filter_flag[local_pps_id];
local_pps_id = pps_id;
betaOff = pps_beta_offset[local_pps_id];
local_pps_id = pps_id;
tcOff = pps_tc_offset[local_pps_id];
local_slice_type = slice_type;
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_P_SLICE || local_slice_type == local_B_SLICE) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "five_minus_max_num_merge_cand ");
tmp_res = res[0];
MaxNumMergeCand = 5 - tmp_res;
}
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "slice_qp_delta ");
local_pps_id = pps_id;
tmp_pps_init_qp_minus26 = pps_init_qp_minus26[local_pps_id];
tmp_res0 = res[0];
slice_qp = tmp_pps_init_qp_minus26 + 26 + tmp_res0;
slice_cb_qp_offset = 0;
slice_cr_qp_offset = 0;
local_pps_id = pps_id;
tmp_pps_slice_chroma_qp_offsets_present_flag = pps_slice_chroma_qp_offsets_present_flag[local_pps_id];
if (tmp_pps_slice_chroma_qp_offsets_present_flag == 1) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "slice_cb_qp_offset ");
tmp_res1 = res[0];
slice_cb_qp_offset = tmp_res1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "slice_cr_qp_offset ");
tmp_res2 = res[0];
slice_cr_qp_offset = tmp_res2;
}
local_pps_id = pps_id;
tmp_pps_deblocking_filter_control_present_flag = pps_deblocking_filter_control_present_flag[local_pps_id];
if (tmp_pps_deblocking_filter_control_present_flag == 1) {
res[0] = 0;
local_pps_id = pps_id;
tmp_deblocking_filter_override_enabled_flag = deblocking_filter_override_enabled_flag[local_pps_id];
if (tmp_deblocking_filter_override_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "deblocking_filter_override_flag ");
}
tmp_res3 = res[0];
if (tmp_res3 == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_disable_deblocking_filter_flag ");
slice_disable_deblocking_filter_flag = res[0];
if (slice_disable_deblocking_filter_flag == 0) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "beta_offset_div2 ");
tmp_res4 = res[0];
betaOff = tmp_res4 << 1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "tc_offset_div2 ");
tmp_res5 = res[0];
tcOff = tmp_res5 << 1;
}
}
}
local_sps_id = sps_id;
tmp_pps_loop_filter_across_slice_enabled_flag = pps_loop_filter_across_slice_enabled_flag[local_sps_id];
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[0];
tmp_slice_sample_adaptive_offset_flag0 = slice_sample_adaptive_offset_flag[1];
if (tmp_pps_loop_filter_across_slice_enabled_flag == 1 && (tmp_slice_sample_adaptive_offset_flag == 1 || tmp_slice_sample_adaptive_offset_flag0 == 1 || slice_disable_deblocking_filter_flag == 0)) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_loop_filter_across_slices_enabled_flag");
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
tokens_DBFDisable[(index_DBFDisable + (0)) % SIZE_DBFDisable] = slice_disable_deblocking_filter_flag != 0;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (0)] = betaOff;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (1)] = tcOff;
local_pps_id = pps_id;
tmp_pps_cb_qp_offset = pps_cb_qp_offset[local_pps_id];
local_slice_cb_qp_offset = slice_cb_qp_offset;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (2)] = tmp_pps_cb_qp_offset + local_slice_cb_qp_offset;
local_pps_id = pps_id;
tmp_pps_cr_qp_offset = pps_cr_qp_offset[local_pps_id];
local_slice_cr_qp_offset = slice_cr_qp_offset;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (3)] = tmp_pps_cr_qp_offset + local_slice_cr_qp_offset;
// Update ports indexes
index_DBFDisable += 1;
index_DbfSe += 4;
write_end_DbfSe();
}
static void read_SliceHeader_se_idx_5_aligned() {
u32 res[1];
u16 local_pps_id;
u8 slice_disable_deblocking_filter_flag;
i8 betaOff;
i8 tcOff;
u8 local_slice_type;
u8 local_P_SLICE;
u8 local_B_SLICE;
u32 tmp_res;
i32 tmp_pps_init_qp_minus26;
u32 tmp_res0;
u8 tmp_pps_slice_chroma_qp_offsets_present_flag;
u32 tmp_res1;
u32 tmp_res2;
u8 tmp_pps_deblocking_filter_control_present_flag;
u8 tmp_deblocking_filter_override_enabled_flag;
u32 tmp_res3;
u32 tmp_res4;
u32 tmp_res5;
u16 local_sps_id;
u8 tmp_pps_loop_filter_across_slice_enabled_flag;
u8 tmp_slice_sample_adaptive_offset_flag;
u8 tmp_slice_sample_adaptive_offset_flag0;
u16 local_se_idx;
i8 tmp_pps_cb_qp_offset;
i8 local_slice_cb_qp_offset;
i8 tmp_pps_cr_qp_offset;
i8 local_slice_cr_qp_offset;
local_pps_id = pps_id;
slice_disable_deblocking_filter_flag = pps_disable_deblocking_filter_flag[local_pps_id];
local_pps_id = pps_id;
betaOff = pps_beta_offset[local_pps_id];
local_pps_id = pps_id;
tcOff = pps_tc_offset[local_pps_id];
local_slice_type = slice_type;
local_P_SLICE = HevcDecoder_Algo_Parser_P_SLICE;
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_P_SLICE || local_slice_type == local_B_SLICE) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "five_minus_max_num_merge_cand ");
tmp_res = res[0];
MaxNumMergeCand = 5 - tmp_res;
}
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "slice_qp_delta ");
local_pps_id = pps_id;
tmp_pps_init_qp_minus26 = pps_init_qp_minus26[local_pps_id];
tmp_res0 = res[0];
slice_qp = tmp_pps_init_qp_minus26 + 26 + tmp_res0;
slice_cb_qp_offset = 0;
slice_cr_qp_offset = 0;
local_pps_id = pps_id;
tmp_pps_slice_chroma_qp_offsets_present_flag = pps_slice_chroma_qp_offsets_present_flag[local_pps_id];
if (tmp_pps_slice_chroma_qp_offsets_present_flag == 1) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "slice_cb_qp_offset ");
tmp_res1 = res[0];
slice_cb_qp_offset = tmp_res1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "slice_cr_qp_offset ");
tmp_res2 = res[0];
slice_cr_qp_offset = tmp_res2;
}
local_pps_id = pps_id;
tmp_pps_deblocking_filter_control_present_flag = pps_deblocking_filter_control_present_flag[local_pps_id];
if (tmp_pps_deblocking_filter_control_present_flag == 1) {
res[0] = 0;
local_pps_id = pps_id;
tmp_deblocking_filter_override_enabled_flag = deblocking_filter_override_enabled_flag[local_pps_id];
if (tmp_deblocking_filter_override_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "deblocking_filter_override_flag ");
}
tmp_res3 = res[0];
if (tmp_res3 == 1) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_disable_deblocking_filter_flag ");
slice_disable_deblocking_filter_flag = res[0];
if (slice_disable_deblocking_filter_flag == 0) {
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "beta_offset_div2 ");
tmp_res4 = res[0];
betaOff = tmp_res4 << 1;
HevcDecoder_Algo_Parser_vld_se_name(fifo, res, "tc_offset_div2 ");
tmp_res5 = res[0];
tcOff = tmp_res5 << 1;
}
}
}
local_sps_id = sps_id;
tmp_pps_loop_filter_across_slice_enabled_flag = pps_loop_filter_across_slice_enabled_flag[local_sps_id];
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[0];
tmp_slice_sample_adaptive_offset_flag0 = slice_sample_adaptive_offset_flag[1];
if (tmp_pps_loop_filter_across_slice_enabled_flag == 1 && (tmp_slice_sample_adaptive_offset_flag == 1 || tmp_slice_sample_adaptive_offset_flag0 == 1 || slice_disable_deblocking_filter_flag == 0)) {
HevcDecoder_Algo_Parser_vld_u_name(1, fifo, res, "slice_loop_filter_across_slices_enabled_flag");
}
local_se_idx = se_idx;
se_idx = local_se_idx + 1;
tokens_DBFDisable[(index_DBFDisable + (0)) % SIZE_DBFDisable] = slice_disable_deblocking_filter_flag != 0;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (0)] = betaOff;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (1)] = tcOff;
local_pps_id = pps_id;
tmp_pps_cb_qp_offset = pps_cb_qp_offset[local_pps_id];
local_slice_cb_qp_offset = slice_cb_qp_offset;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (2)] = tmp_pps_cb_qp_offset + local_slice_cb_qp_offset;
local_pps_id = pps_id;
tmp_pps_cr_qp_offset = pps_cr_qp_offset[local_pps_id];
local_slice_cr_qp_offset = slice_cr_qp_offset;
tokens_DbfSe[(index_DbfSe % SIZE_DbfSe) + (3)] = tmp_pps_cr_qp_offset + local_slice_cr_qp_offset;
// Update ports indexes
index_DBFDisable += 1;
index_DbfSe += 4;
write_end_DbfSe();
}
static i32 isSchedulable_read_SliceHeader_se_idx_6() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 6 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_6() {
u32 res[1];
u16 local_pps_id;
u8 tmp_pps_tiles_enabled_flag;
u8 tmp_pps_entropy_coding_sync_enabled_flag;
u32 tmp_res;
u16 local_num_entry_point_offsets;
u32 local_NUM_ENTRY_MAX;
u32 tmp_res0;
u32 local_TILE_SPLIT_ENABLE;
u8 tmp_pps_num_tile_columns_minus1;
u8 tmp_pps_num_tile_rows_minus1;
se_idx = 8;
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag = pps_tiles_enabled_flag[local_pps_id];
local_pps_id = pps_id;
tmp_pps_entropy_coding_sync_enabled_flag = pps_entropy_coding_sync_enabled_flag[local_pps_id];
if (tmp_pps_tiles_enabled_flag == 1 || tmp_pps_entropy_coding_sync_enabled_flag == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "num_entry_point_offsets ");
tmp_res = res[0];
num_entry_point_offsets = tmp_res;
local_num_entry_point_offsets = num_entry_point_offsets;
local_NUM_ENTRY_MAX = NUM_ENTRY_MAX;
if (local_num_entry_point_offsets > local_NUM_ENTRY_MAX) {
printf("ERROR: fix NUM_ENTRY_MAX\n");
}
local_num_entry_point_offsets = num_entry_point_offsets;
if (local_num_entry_point_offsets > 0) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "offset_len_minus1 ");
tmp_res0 = res[0];
offset_len = tmp_res0 + 1;
se_idx = 7;
}
}
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
if (local_TILE_SPLIT_ENABLE != 0) {
num_entry_offsets = 1;
} else {
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
local_pps_id = pps_id;
tmp_pps_num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
num_entry_offsets = (tmp_pps_num_tile_columns_minus1 + 1) * (tmp_pps_num_tile_rows_minus1 + 1);
}
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_7_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_num_entry_point_offsets;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_entry_point_offsets = num_entry_point_offsets;
result = local_se_idx == 7 && tmp_isFifoFull && local_cnt_i < local_num_entry_point_offsets;
return result;
}
static void read_SliceHeader_se_idx_7_loop() {
u32 res[1];
u16 local_offset_len;
u32 local_cnt_i;
u32 tmp_res;
local_offset_len = offset_len;
if (local_offset_len > 32) {
printf("ERROR with vld_ue : check offset_len size\n");
}
local_offset_len = offset_len;
HevcDecoder_Algo_Parser_vld_u_name(local_offset_len, fifo, res, "entry_point_offset ");
local_cnt_i = cnt_i;
tmp_res = res[0];
entryOffsetsTab[local_cnt_i] = tmp_res;
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_7_endLoop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_num_entry_point_offsets;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_num_entry_point_offsets = num_entry_point_offsets;
result = local_se_idx == 7 && tmp_isFifoFull && local_cnt_i == local_num_entry_point_offsets;
return result;
}
static void read_SliceHeader_se_idx_7_endLoop() {
cnt_i = 0;
se_idx = 8;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_8() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_se_idx == 8 && tmp_isFifoFull;
return result;
}
static void read_SliceHeader_se_idx_8() {
i32 res[1];
u16 local_pps_id;
u8 tmp_pps_slice_segment_header_extension_present_flag;
i32 tmp_res;
se_idx = 100;
local_pps_id = pps_id;
tmp_pps_slice_segment_header_extension_present_flag = pps_slice_segment_header_extension_present_flag[local_pps_id];
if (tmp_pps_slice_segment_header_extension_present_flag == 1) {
HevcDecoder_Algo_Parser_vld_ue_name(fifo, res, "slice_segment_header_extension_length ");
tmp_res = res[0];
slice_segment_header_extension_length = tmp_res;
se_idx = 9;
cnt_i = 0;
}
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_9_loop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_slice_segment_header_extension_length;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_slice_segment_header_extension_length = slice_segment_header_extension_length;
result = local_se_idx == 9 && tmp_isFifoFull && local_cnt_i < local_slice_segment_header_extension_length;
return result;
}
static void read_SliceHeader_se_idx_9_loop() {
u32 res[1];
u32 local_cnt_i;
HevcDecoder_Algo_Parser_vld_u_name(8, fifo, res, "slice_segment_header_extension_data_byte");
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_se_idx_9_endLoop() {
i32 result;
u16 local_se_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u16 local_slice_segment_header_extension_length;
local_se_idx = se_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_slice_segment_header_extension_length = slice_segment_header_extension_length;
result = local_se_idx == 9 && tmp_isFifoFull && local_cnt_i == local_slice_segment_header_extension_length;
return result;
}
static void read_SliceHeader_se_idx_9_endLoop() {
cnt_i = 0;
se_idx = 100;
// Update ports indexes
}
static i32 isSchedulable_read_SliceHeader_done() {
i32 result;
u16 local_se_idx;
local_se_idx = se_idx;
result = local_se_idx == 100;
return result;
}
static void read_SliceHeader_done_aligned() {
i32 local_DEBUG_CABAC;
i32 local_CHECK_CABAC;
i32 local_poc;
u8 local_dependent_slice_segment_flag;
u16 local_pps_id;
u8 tmp_pps_cu_qp_delta_enabled_flag;
i8 local_slice_qp;
u16 local_num_entry_point_offsets;
u32 local_TILE_SPLIT_ENABLE;
u8 tmp_TilesInfo;
i32 k;
u8 tmp_TilesInfo0;
u32 local_totalByPass;
u32 tmp_entryOffsetsTab;
u16 local_sps_id;
i32 tmp_sps_strong_intra_smoothing_enable_flag;
i32 tmp_pps_constrained_intra_pred_flag;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_CHECK_CABAC = HevcDecoder_Algo_Parser_CHECK_CABAC;
if (local_DEBUG_CABAC || local_CHECK_CABAC) {
local_poc = poc;
printf("\tPOC: %i\n", local_poc);
}
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
if (local_dependent_slice_segment_flag == 1) {
first_qp_group = 0;
} else {
first_qp_group = 1;
}
local_pps_id = pps_id;
tmp_pps_cu_qp_delta_enabled_flag = pps_cu_qp_delta_enabled_flag[local_pps_id];
if (tmp_pps_cu_qp_delta_enabled_flag == 0) {
local_slice_qp = slice_qp;
qp_y = local_slice_qp;
}
sliceData_idx = 1;
totalByPass = 0;
local_num_entry_point_offsets = num_entry_point_offsets;
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
if (local_num_entry_point_offsets > 0 && local_TILE_SPLIT_ENABLE != 0) {
tmp_TilesInfo = TilesInfo[1];
if (tmp_TilesInfo != 0) {
byPassFlag = 1;
HevcDecoder_Algo_Parser_byte_align(fifo);
k = 0;
tmp_TilesInfo0 = TilesInfo[1];
while (k <= tmp_TilesInfo0 - 1) {
local_totalByPass = totalByPass;
tmp_entryOffsetsTab = entryOffsetsTab[k];
totalByPass = local_totalByPass + tmp_entryOffsetsTab;
k = k + 1;
}
}
}
local_sps_id = sps_id;
tmp_sps_strong_intra_smoothing_enable_flag = sps_strong_intra_smoothing_enable_flag[local_sps_id];
tokens_StrongIntraSmoothing[(index_StrongIntraSmoothing % SIZE_StrongIntraSmoothing) + (0)] = tmp_sps_strong_intra_smoothing_enable_flag;
local_pps_id = pps_id;
tmp_pps_constrained_intra_pred_flag = pps_constrained_intra_pred_flag[local_pps_id];
tokens_StrongIntraSmoothing[(index_StrongIntraSmoothing % SIZE_StrongIntraSmoothing) + (1)] = tmp_pps_constrained_intra_pred_flag;
// Update ports indexes
index_StrongIntraSmoothing += 2;
write_end_StrongIntraSmoothing();
}
static i32 isSchedulable_read_SliceData_init() {
i32 result;
u8 local_sliceData_idx;
i32 tmp_isFifoFull;
u8 local_first_slice_segment_in_pic_flag;
u8 local_prev_pps_id;
u16 local_pps_id;
local_sliceData_idx = sliceData_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_first_slice_segment_in_pic_flag = first_slice_segment_in_pic_flag;
local_prev_pps_id = prev_pps_id;
local_pps_id = pps_id;
result = local_sliceData_idx == 1 && tmp_isFifoFull && (local_first_slice_segment_in_pic_flag == 1 || local_prev_pps_id != local_pps_id);
return result;
}
static void read_SliceData_init() {
u16 local_pps_id;
u8 num_tile_columns_minus1;
u8 num_tile_rows_minus1;
u16 ColBd[512];
u16 RowBd[256];
u16 tileX;
u16 tileY;
u16 val;
u16 tbX;
u16 tbY;
u16 tIdx;
u32 count;
i32 i;
i32 local_PICT_WIDTH;
i32 j;
i32 i0;
i32 j0;
u8 local_INTRA_DC;
u16 local_sps_id;
u8 tmp_sps_log2_min_transform_block_size;
u8 local_Log2MinTrafoSize;
u8 tmp_sps_log2_diff_max_min_transform_block_size;
i32 i1;
i32 j1;
u16 tmp_rowHeight;
u16 tmp_colWidth;
u16 tmp_nbCtbTile;
u16 tmp_rowHeight0;
u16 tmp_colWidth0;
i32 i2;
u16 tmp_ColBd;
u16 tmp_colWidth1;
i32 i3;
u16 tmp_RowBd;
u16 tmp_rowHeight1;
u16 local_PicHeightInCtbsY;
u16 local_PicWidthInCtbsY;
u32 local_CTB_ADDR_TS_MAX;
i32 ctbAddrRS_v;
u16 local_PicSizeInCtbsY;
i32 i4;
u16 tmp_ColBd0;
i32 j2;
u16 tmp_RowBd0;
i32 i5;
u16 tmp_rowHeight2;
u16 tmp_colWidth2;
i32 j3;
u16 tmp_rowHeight3;
u16 tmp_RowBd1;
u16 tmp_colWidth3;
u16 tmp_ColBd1;
i32 j4;
i32 i6;
i32 y;
u16 tmp_RowBd2;
i32 x;
u16 tmp_ColBd2;
u16 tmp_ctbAddrRStoTS;
u32 local_num_entry_offsets;
u8 tmp_pps_log2_parallel_merge_level;
u8 local_slice_temporal_mvp_enable_flag;
u8 local_collocated_from_lX;
u8 local_collocated_ref_idx;
u8 tmp_slice_sample_adaptive_offset_flag;
u8 tmp_slice_sample_adaptive_offset_flag0;
i32 idx_pictSize;
u16 local_pictSize;
u16 tmp_pictSize;
u16 tmp_pictSize0;
u8 tmp_pps_loop_filter_across_slice_enabled_flag;
u8 tmp_pps_loop_filter_across_slice_enabled_flag0;
u32 local_no_output_of_prior_pics_flag;
u32 tmp_sps_num_reorder_pics;
u32 local_pic_output_flag;
u8 local_video_sequence_id;
i32 idx_pictSize0;
u16 local_pictSize0;
i32 idx_pictOrTileSize;
u16 local_pictOrTileSize;
local_pps_id = pps_id;
num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
local_pps_id = pps_id;
num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
count = 0;
local_pps_id = pps_id;
prev_pps_id = local_pps_id;
i = 0;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
while (i <= local_PICT_WIDTH - 1) {
j = 0;
while (j <= 1) {
skip_flag_tab[i][j] = 0;
j = j + 1;
}
i = i + 1;
}
i0 = 0;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
while (i0 <= local_PICT_WIDTH - 1) {
j0 = 0;
while (j0 <= 1) {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
intraPredMode[i0][j0] = local_INTRA_DC;
j0 = j0 + 1;
}
i0 = i0 + 1;
}
local_sps_id = sps_id;
tmp_sps_log2_min_transform_block_size = sps_log2_min_transform_block_size[local_sps_id];
Log2MinTrafoSize = tmp_sps_log2_min_transform_block_size;
local_Log2MinTrafoSize = Log2MinTrafoSize;
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_transform_block_size = sps_log2_diff_max_min_transform_block_size[local_sps_id];
Log2MaxTrafoSize = local_Log2MinTrafoSize + tmp_sps_log2_diff_max_min_transform_block_size;
i1 = 0;
while (i1 <= num_tile_rows_minus1) {
j1 = 0;
while (j1 <= num_tile_columns_minus1) {
if (count == 0) {
local_pps_id = pps_id;
tmp_rowHeight = rowHeight[local_pps_id][i1];
local_pps_id = pps_id;
tmp_colWidth = colWidth[local_pps_id][j1];
nbCtbTile[count] = tmp_rowHeight * tmp_colWidth;
} else {
tmp_nbCtbTile = nbCtbTile[count - 1];
local_pps_id = pps_id;
tmp_rowHeight0 = rowHeight[local_pps_id][i1];
local_pps_id = pps_id;
tmp_colWidth0 = colWidth[local_pps_id][j1];
nbCtbTile[count] = tmp_nbCtbTile + tmp_rowHeight0 * tmp_colWidth0;
}
count = count + 1;
j1 = j1 + 1;
}
i1 = i1 + 1;
}
ColBd[0] = 0;
i2 = 0;
while (i2 <= num_tile_columns_minus1) {
tmp_ColBd = ColBd[i2];
local_pps_id = pps_id;
tmp_colWidth1 = colWidth[local_pps_id][i2];
ColBd[i2 + 1] = tmp_ColBd + tmp_colWidth1;
i2 = i2 + 1;
}
RowBd[0] = 0;
i3 = 0;
while (i3 <= num_tile_rows_minus1) {
tmp_RowBd = RowBd[i3];
local_pps_id = pps_id;
tmp_rowHeight1 = rowHeight[local_pps_id][i3];
RowBd[i3 + 1] = tmp_RowBd + tmp_rowHeight1;
i3 = i3 + 1;
}
local_PicHeightInCtbsY = PicHeightInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_CTB_ADDR_TS_MAX = HevcDecoder_Algo_Parser_CTB_ADDR_TS_MAX;
if (local_PicHeightInCtbsY * local_PicWidthInCtbsY >= local_CTB_ADDR_TS_MAX) {
local_PicHeightInCtbsY = PicHeightInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_CTB_ADDR_TS_MAX = HevcDecoder_Algo_Parser_CTB_ADDR_TS_MAX;
printf("Error read_SliceData.init : CtbAddrTS : %u >= %u\n", local_PicHeightInCtbsY * local_PicWidthInCtbsY, local_CTB_ADDR_TS_MAX);
}
ctbAddrRS_v = 0;
local_PicSizeInCtbsY = PicSizeInCtbsY;
while (ctbAddrRS_v <= local_PicSizeInCtbsY - 1) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
tbX = ctbAddrRS_v % local_PicWidthInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
tbY = ctbAddrRS_v / local_PicWidthInCtbsY;
tileX = 0;
tileY = 0;
i4 = 0;
while (i4 <= num_tile_columns_minus1) {
tmp_ColBd0 = ColBd[i4 + 1];
if (tbX < tmp_ColBd0) {
tileX = i4;
i4 = num_tile_columns_minus1;
}
i4 = i4 + 1;
}
j2 = 0;
while (j2 <= num_tile_rows_minus1) {
tmp_RowBd0 = RowBd[j2 + 1];
if (tbY < tmp_RowBd0) {
tileY = j2;
j2 = num_tile_rows_minus1;
}
j2 = j2 + 1;
}
val = 0;
i5 = 0;
while (i5 <= tileX - 1) {
local_pps_id = pps_id;
tmp_rowHeight2 = rowHeight[local_pps_id][tileY];
local_pps_id = pps_id;
tmp_colWidth2 = colWidth[local_pps_id][i5];
val = val + tmp_rowHeight2 * tmp_colWidth2;
i5 = i5 + 1;
}
j3 = 0;
while (j3 <= tileY - 1) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_pps_id = pps_id;
tmp_rowHeight3 = rowHeight[local_pps_id][j3];
val = val + local_PicWidthInCtbsY * tmp_rowHeight3;
j3 = j3 + 1;
}
tmp_RowBd1 = RowBd[tileY];
local_pps_id = pps_id;
tmp_colWidth3 = colWidth[local_pps_id][tileX];
tmp_ColBd1 = ColBd[tileX];
val = val + (tbY - tmp_RowBd1) * tmp_colWidth3 + tbX - tmp_ColBd1;
ctbAddrRStoTS[ctbAddrRS_v] = val;
ctbAddrTStoRS[val] = ctbAddrRS_v;
ctbAddrRS_v = ctbAddrRS_v + 1;
}
tIdx = 0;
j4 = 0;
while (j4 <= num_tile_rows_minus1) {
i6 = 0;
while (i6 <= num_tile_columns_minus1) {
y = RowBd[j4];
tmp_RowBd2 = RowBd[j4 + 1];
while (y <= tmp_RowBd2 - 1) {
x = ColBd[i6];
tmp_ColBd2 = ColBd[i6 + 1];
while (x <= tmp_ColBd2 - 1) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
tmp_ctbAddrRStoTS = ctbAddrRStoTS[y * local_PicWidthInCtbsY + x];
TileId[tmp_ctbAddrRStoTS] = tIdx;
x = x + 1;
}
y = y + 1;
}
tIdx = tIdx + 1;
i6 = i6 + 1;
}
j4 = j4 + 1;
}
HevcDecoder_Algo_Parser_InitScanningArray(ScanOrder);
local_num_entry_offsets = num_entry_offsets;
if (local_num_entry_offsets > 0) {
sliceData_idx = 20;
} else {
sliceData_idx = 21;
}
tokens_IsPicSlcLcu[(index_IsPicSlcLcu + (0)) % SIZE_IsPicSlcLcu] = 0;
tokens_IsPicSlc[(index_IsPicSlc + (0)) % SIZE_IsPicSlc] = 0;
local_pps_id = pps_id;
tmp_pps_log2_parallel_merge_level = pps_log2_parallel_merge_level[local_pps_id];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (0)) % SIZE_MvPredSyntaxElem] = tmp_pps_log2_parallel_merge_level;
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (1)) % SIZE_MvPredSyntaxElem] = local_slice_temporal_mvp_enable_flag;
local_collocated_from_lX = collocated_from_lX;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (2)) % SIZE_MvPredSyntaxElem] = local_collocated_from_lX;
local_collocated_ref_idx = collocated_ref_idx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (3)) % SIZE_MvPredSyntaxElem] = local_collocated_ref_idx;
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[0];
tmp_slice_sample_adaptive_offset_flag0 = slice_sample_adaptive_offset_flag[1];
tokens_SaoSe[(index_SaoSe + (0)) % SIZE_SaoSe] = tmp_slice_sample_adaptive_offset_flag + (tmp_slice_sample_adaptive_offset_flag0 << 1);
local_num_entry_offsets = num_entry_offsets;
tokens_TilesCoord[(index_TilesCoord + (0)) % SIZE_TilesCoord] = local_num_entry_offsets;
local_num_entry_offsets = num_entry_offsets;
idx_pictSize = 0;
while (idx_pictSize < 2) {
local_pictSize = pictSize[idx_pictSize];
tokens_PicSizeInMb[(index_PicSizeInMb % SIZE_PicSizeInMb) + (idx_pictSize)] = local_pictSize;
idx_pictSize = idx_pictSize + 1;
}
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (0)] = 0;
tmp_pictSize = pictSize[0];
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (1)] = tmp_pictSize - 1;
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (2)] = 0;
tmp_pictSize0 = pictSize[1];
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (3)] = tmp_pictSize0 - 1;
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag0 = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
tokens_LFAcrossSlcTile[(index_LFAcrossSlcTile + (0)) % SIZE_LFAcrossSlcTile] = tmp_pps_loop_filter_across_slice_enabled_flag + (tmp_pps_loop_filter_across_slice_enabled_flag0 << 1);
local_no_output_of_prior_pics_flag = no_output_of_prior_pics_flag;
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (0)] = local_no_output_of_prior_pics_flag;
local_sps_id = sps_id;
tmp_sps_num_reorder_pics = sps_num_reorder_pics[local_sps_id];
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (1)] = tmp_sps_num_reorder_pics;
local_pic_output_flag = pic_output_flag;
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (2)] = local_pic_output_flag;
local_video_sequence_id = video_sequence_id;
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (3)] = local_video_sequence_id;
idx_pictSize0 = 0;
while (idx_pictSize0 < 2) {
local_pictSize0 = pictSize[idx_pictSize0];
tokens_PictSize[(index_PictSize + (idx_pictSize0)) % SIZE_PictSize] = local_pictSize0;
idx_pictSize0 = idx_pictSize0 + 1;
}
idx_pictOrTileSize = 0;
while (idx_pictOrTileSize < 2) {
local_pictOrTileSize = pictOrTileSize[idx_pictOrTileSize];
idx_pictOrTileSize = idx_pictOrTileSize + 1;
}
// Update ports indexes
index_IsPicSlcLcu += 1;
index_IsPicSlc += 1;
index_MvPredSyntaxElem += 4;
write_end_MvPredSyntaxElem();
index_SaoSe += 1;
index_TilesCoord += 1;
index_PicSizeInMb += 2;
write_end_PicSizeInMb();
index_DispCoord += 4;
write_end_DispCoord();
index_LFAcrossSlcTile += 1;
index_ReorderPics += 4;
write_end_ReorderPics();
index_PictSize += 2;
write_end_PictSize();
}
static void read_SliceData_init_aligned() {
u16 local_pps_id;
u8 num_tile_columns_minus1;
u8 num_tile_rows_minus1;
u16 ColBd[512];
u16 RowBd[256];
u16 tileX;
u16 tileY;
u16 val;
u16 tbX;
u16 tbY;
u16 tIdx;
u32 count;
i32 i;
i32 local_PICT_WIDTH;
i32 j;
i32 i0;
i32 j0;
u8 local_INTRA_DC;
u16 local_sps_id;
u8 tmp_sps_log2_min_transform_block_size;
u8 local_Log2MinTrafoSize;
u8 tmp_sps_log2_diff_max_min_transform_block_size;
i32 i1;
i32 j1;
u16 tmp_rowHeight;
u16 tmp_colWidth;
u16 tmp_nbCtbTile;
u16 tmp_rowHeight0;
u16 tmp_colWidth0;
i32 i2;
u16 tmp_ColBd;
u16 tmp_colWidth1;
i32 i3;
u16 tmp_RowBd;
u16 tmp_rowHeight1;
u16 local_PicHeightInCtbsY;
u16 local_PicWidthInCtbsY;
u32 local_CTB_ADDR_TS_MAX;
i32 ctbAddrRS_v;
u16 local_PicSizeInCtbsY;
i32 i4;
u16 tmp_ColBd0;
i32 j2;
u16 tmp_RowBd0;
i32 i5;
u16 tmp_rowHeight2;
u16 tmp_colWidth2;
i32 j3;
u16 tmp_rowHeight3;
u16 tmp_RowBd1;
u16 tmp_colWidth3;
u16 tmp_ColBd1;
i32 j4;
i32 i6;
i32 y;
u16 tmp_RowBd2;
i32 x;
u16 tmp_ColBd2;
u16 tmp_ctbAddrRStoTS;
u32 local_num_entry_offsets;
u8 tmp_pps_log2_parallel_merge_level;
u8 local_slice_temporal_mvp_enable_flag;
u8 local_collocated_from_lX;
u8 local_collocated_ref_idx;
u8 tmp_slice_sample_adaptive_offset_flag;
u8 tmp_slice_sample_adaptive_offset_flag0;
i32 idx_pictSize;
u16 local_pictSize;
u16 tmp_pictSize;
u16 tmp_pictSize0;
u8 tmp_pps_loop_filter_across_slice_enabled_flag;
u8 tmp_pps_loop_filter_across_slice_enabled_flag0;
u32 local_no_output_of_prior_pics_flag;
u32 tmp_sps_num_reorder_pics;
u32 local_pic_output_flag;
u8 local_video_sequence_id;
i32 idx_pictSize0;
u16 local_pictSize0;
i32 idx_pictOrTileSize;
u16 local_pictOrTileSize;
local_pps_id = pps_id;
num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
local_pps_id = pps_id;
num_tile_rows_minus1 = pps_num_tile_rows_minus1[local_pps_id];
count = 0;
local_pps_id = pps_id;
prev_pps_id = local_pps_id;
i = 0;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
while (i <= local_PICT_WIDTH - 1) {
j = 0;
while (j <= 1) {
skip_flag_tab[i][j] = 0;
j = j + 1;
}
i = i + 1;
}
i0 = 0;
local_PICT_WIDTH = HevcDecoder_Algo_Parser_PICT_WIDTH;
while (i0 <= local_PICT_WIDTH - 1) {
j0 = 0;
while (j0 <= 1) {
local_INTRA_DC = HevcDecoder_Algo_Parser_INTRA_DC;
intraPredMode[i0][j0] = local_INTRA_DC;
j0 = j0 + 1;
}
i0 = i0 + 1;
}
local_sps_id = sps_id;
tmp_sps_log2_min_transform_block_size = sps_log2_min_transform_block_size[local_sps_id];
Log2MinTrafoSize = tmp_sps_log2_min_transform_block_size;
local_Log2MinTrafoSize = Log2MinTrafoSize;
local_sps_id = sps_id;
tmp_sps_log2_diff_max_min_transform_block_size = sps_log2_diff_max_min_transform_block_size[local_sps_id];
Log2MaxTrafoSize = local_Log2MinTrafoSize + tmp_sps_log2_diff_max_min_transform_block_size;
i1 = 0;
while (i1 <= num_tile_rows_minus1) {
j1 = 0;
while (j1 <= num_tile_columns_minus1) {
if (count == 0) {
local_pps_id = pps_id;
tmp_rowHeight = rowHeight[local_pps_id][i1];
local_pps_id = pps_id;
tmp_colWidth = colWidth[local_pps_id][j1];
nbCtbTile[count] = tmp_rowHeight * tmp_colWidth;
} else {
tmp_nbCtbTile = nbCtbTile[count - 1];
local_pps_id = pps_id;
tmp_rowHeight0 = rowHeight[local_pps_id][i1];
local_pps_id = pps_id;
tmp_colWidth0 = colWidth[local_pps_id][j1];
nbCtbTile[count] = tmp_nbCtbTile + tmp_rowHeight0 * tmp_colWidth0;
}
count = count + 1;
j1 = j1 + 1;
}
i1 = i1 + 1;
}
ColBd[0] = 0;
i2 = 0;
while (i2 <= num_tile_columns_minus1) {
tmp_ColBd = ColBd[i2];
local_pps_id = pps_id;
tmp_colWidth1 = colWidth[local_pps_id][i2];
ColBd[i2 + 1] = tmp_ColBd + tmp_colWidth1;
i2 = i2 + 1;
}
RowBd[0] = 0;
i3 = 0;
while (i3 <= num_tile_rows_minus1) {
tmp_RowBd = RowBd[i3];
local_pps_id = pps_id;
tmp_rowHeight1 = rowHeight[local_pps_id][i3];
RowBd[i3 + 1] = tmp_RowBd + tmp_rowHeight1;
i3 = i3 + 1;
}
local_PicHeightInCtbsY = PicHeightInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_CTB_ADDR_TS_MAX = HevcDecoder_Algo_Parser_CTB_ADDR_TS_MAX;
if (local_PicHeightInCtbsY * local_PicWidthInCtbsY >= local_CTB_ADDR_TS_MAX) {
local_PicHeightInCtbsY = PicHeightInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_CTB_ADDR_TS_MAX = HevcDecoder_Algo_Parser_CTB_ADDR_TS_MAX;
printf("Error read_SliceData.init : CtbAddrTS : %u >= %u\n", local_PicHeightInCtbsY * local_PicWidthInCtbsY, local_CTB_ADDR_TS_MAX);
}
ctbAddrRS_v = 0;
local_PicSizeInCtbsY = PicSizeInCtbsY;
while (ctbAddrRS_v <= local_PicSizeInCtbsY - 1) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
tbX = ctbAddrRS_v % local_PicWidthInCtbsY;
local_PicWidthInCtbsY = PicWidthInCtbsY;
tbY = ctbAddrRS_v / local_PicWidthInCtbsY;
tileX = 0;
tileY = 0;
i4 = 0;
while (i4 <= num_tile_columns_minus1) {
tmp_ColBd0 = ColBd[i4 + 1];
if (tbX < tmp_ColBd0) {
tileX = i4;
i4 = num_tile_columns_minus1;
}
i4 = i4 + 1;
}
j2 = 0;
while (j2 <= num_tile_rows_minus1) {
tmp_RowBd0 = RowBd[j2 + 1];
if (tbY < tmp_RowBd0) {
tileY = j2;
j2 = num_tile_rows_minus1;
}
j2 = j2 + 1;
}
val = 0;
i5 = 0;
while (i5 <= tileX - 1) {
local_pps_id = pps_id;
tmp_rowHeight2 = rowHeight[local_pps_id][tileY];
local_pps_id = pps_id;
tmp_colWidth2 = colWidth[local_pps_id][i5];
val = val + tmp_rowHeight2 * tmp_colWidth2;
i5 = i5 + 1;
}
j3 = 0;
while (j3 <= tileY - 1) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_pps_id = pps_id;
tmp_rowHeight3 = rowHeight[local_pps_id][j3];
val = val + local_PicWidthInCtbsY * tmp_rowHeight3;
j3 = j3 + 1;
}
tmp_RowBd1 = RowBd[tileY];
local_pps_id = pps_id;
tmp_colWidth3 = colWidth[local_pps_id][tileX];
tmp_ColBd1 = ColBd[tileX];
val = val + (tbY - tmp_RowBd1) * tmp_colWidth3 + tbX - tmp_ColBd1;
ctbAddrRStoTS[ctbAddrRS_v] = val;
ctbAddrTStoRS[val] = ctbAddrRS_v;
ctbAddrRS_v = ctbAddrRS_v + 1;
}
tIdx = 0;
j4 = 0;
while (j4 <= num_tile_rows_minus1) {
i6 = 0;
while (i6 <= num_tile_columns_minus1) {
y = RowBd[j4];
tmp_RowBd2 = RowBd[j4 + 1];
while (y <= tmp_RowBd2 - 1) {
x = ColBd[i6];
tmp_ColBd2 = ColBd[i6 + 1];
while (x <= tmp_ColBd2 - 1) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
tmp_ctbAddrRStoTS = ctbAddrRStoTS[y * local_PicWidthInCtbsY + x];
TileId[tmp_ctbAddrRStoTS] = tIdx;
x = x + 1;
}
y = y + 1;
}
tIdx = tIdx + 1;
i6 = i6 + 1;
}
j4 = j4 + 1;
}
HevcDecoder_Algo_Parser_InitScanningArray(ScanOrder);
local_num_entry_offsets = num_entry_offsets;
if (local_num_entry_offsets > 0) {
sliceData_idx = 20;
} else {
sliceData_idx = 21;
}
tokens_IsPicSlcLcu[(index_IsPicSlcLcu + (0)) % SIZE_IsPicSlcLcu] = 0;
tokens_IsPicSlc[(index_IsPicSlc + (0)) % SIZE_IsPicSlc] = 0;
local_pps_id = pps_id;
tmp_pps_log2_parallel_merge_level = pps_log2_parallel_merge_level[local_pps_id];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (0)] = tmp_pps_log2_parallel_merge_level;
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (1)] = local_slice_temporal_mvp_enable_flag;
local_collocated_from_lX = collocated_from_lX;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (2)] = local_collocated_from_lX;
local_collocated_ref_idx = collocated_ref_idx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (3)] = local_collocated_ref_idx;
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[0];
tmp_slice_sample_adaptive_offset_flag0 = slice_sample_adaptive_offset_flag[1];
tokens_SaoSe[(index_SaoSe + (0)) % SIZE_SaoSe] = tmp_slice_sample_adaptive_offset_flag + (tmp_slice_sample_adaptive_offset_flag0 << 1);
local_num_entry_offsets = num_entry_offsets;
tokens_TilesCoord[(index_TilesCoord + (0)) % SIZE_TilesCoord] = local_num_entry_offsets;
local_num_entry_offsets = num_entry_offsets;
idx_pictSize = 0;
while (idx_pictSize < 2) {
local_pictSize = pictSize[idx_pictSize];
tokens_PicSizeInMb[(index_PicSizeInMb % SIZE_PicSizeInMb) + (idx_pictSize)] = local_pictSize;
idx_pictSize = idx_pictSize + 1;
}
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (0)] = 0;
tmp_pictSize = pictSize[0];
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (1)] = tmp_pictSize - 1;
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (2)] = 0;
tmp_pictSize0 = pictSize[1];
tokens_DispCoord[(index_DispCoord % SIZE_DispCoord) + (3)] = tmp_pictSize0 - 1;
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag0 = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
tokens_LFAcrossSlcTile[(index_LFAcrossSlcTile + (0)) % SIZE_LFAcrossSlcTile] = tmp_pps_loop_filter_across_slice_enabled_flag + (tmp_pps_loop_filter_across_slice_enabled_flag0 << 1);
local_no_output_of_prior_pics_flag = no_output_of_prior_pics_flag;
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (0)] = local_no_output_of_prior_pics_flag;
local_sps_id = sps_id;
tmp_sps_num_reorder_pics = sps_num_reorder_pics[local_sps_id];
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (1)] = tmp_sps_num_reorder_pics;
local_pic_output_flag = pic_output_flag;
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (2)] = local_pic_output_flag;
local_video_sequence_id = video_sequence_id;
tokens_ReorderPics[(index_ReorderPics % SIZE_ReorderPics) + (3)] = local_video_sequence_id;
idx_pictSize0 = 0;
while (idx_pictSize0 < 2) {
local_pictSize0 = pictSize[idx_pictSize0];
tokens_PictSize[(index_PictSize % SIZE_PictSize) + (idx_pictSize0)] = local_pictSize0;
idx_pictSize0 = idx_pictSize0 + 1;
}
idx_pictOrTileSize = 0;
while (idx_pictOrTileSize < 2) {
local_pictOrTileSize = pictOrTileSize[idx_pictOrTileSize];
idx_pictOrTileSize = idx_pictOrTileSize + 1;
}
// Update ports indexes
index_IsPicSlcLcu += 1;
index_IsPicSlc += 1;
index_MvPredSyntaxElem += 4;
write_end_MvPredSyntaxElem();
index_SaoSe += 1;
index_TilesCoord += 1;
index_PicSizeInMb += 2;
write_end_PicSizeInMb();
index_DispCoord += 4;
write_end_DispCoord();
index_LFAcrossSlcTile += 1;
index_ReorderPics += 4;
write_end_ReorderPics();
index_PictSize += 2;
write_end_PictSize();
}
static i32 isSchedulable_read_SliceData_sendInfoSlice() {
i32 result;
u8 local_sliceData_idx;
local_sliceData_idx = sliceData_idx;
result = local_sliceData_idx == 21;
return result;
}
static void read_SliceData_sendInfoSlice() {
u16 tmp_pictSize;
u16 tmp_pictSize0;
sliceData_idx = 2;
tokens_TilesCoord[(index_TilesCoord + (0)) % SIZE_TilesCoord] = 0;
tokens_TilesCoord[(index_TilesCoord + (1)) % SIZE_TilesCoord] = 0;
tmp_pictSize = pictSize[0];
tokens_TilesCoord[(index_TilesCoord + (2)) % SIZE_TilesCoord] = tmp_pictSize;
tmp_pictSize0 = pictSize[1];
tokens_TilesCoord[(index_TilesCoord + (3)) % SIZE_TilesCoord] = tmp_pictSize0;
// Update ports indexes
index_TilesCoord += 4;
write_end_TilesCoord();
}
static void read_SliceData_sendInfoSlice_aligned() {
u16 tmp_pictSize;
u16 tmp_pictSize0;
sliceData_idx = 2;
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (0)] = 0;
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (1)] = 0;
tmp_pictSize = pictSize[0];
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (2)] = tmp_pictSize;
tmp_pictSize0 = pictSize[1];
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (3)] = tmp_pictSize0;
// Update ports indexes
index_TilesCoord += 4;
write_end_TilesCoord();
}
static i32 isSchedulable_read_SliceData_sendInfoTilesLoop() {
i32 result;
u8 local_sliceData_idx;
u32 local_cnt_i;
u32 local_num_entry_offsets;
local_sliceData_idx = sliceData_idx;
local_cnt_i = cnt_i;
local_num_entry_offsets = num_entry_offsets;
result = local_sliceData_idx == 20 && local_cnt_i < local_num_entry_offsets;
return result;
}
static void read_SliceData_sendInfoTilesLoop() {
u32 x0;
u32 y0;
u32 x1;
u32 y1;
u32 local_countCol;
u32 local_countRow;
u16 local_pps_id;
u8 tmp_pps_num_tile_columns_minus1;
u32 local_cnt_i;
u32 local_TILE_SPLIT_ENABLE;
x0 = 0;
y0 = 0;
x1 = pictSize[0];
y1 = pictSize[1];
local_countCol = countCol;
x0 = colTileInPix[local_countCol];
local_countCol = countCol;
x1 = colTileInPix[local_countCol + 1];
local_countRow = countRow;
y0 = rowTileInPix[local_countRow];
local_countRow = countRow;
y1 = rowTileInPix[local_countRow + 1];
local_countCol = countCol;
countCol = local_countCol + 1;
local_countCol = countCol;
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
if (local_countCol == tmp_pps_num_tile_columns_minus1 + 1) {
countCol = 0;
local_countRow = countRow;
countRow = local_countRow + 1;
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
if (local_TILE_SPLIT_ENABLE == 1) {
x0 = 0;
x1 = pictOrTileSize[0];
y0 = 0;
y1 = pictOrTileSize[1];
}
tokens_TilesCoord[(index_TilesCoord + (0)) % SIZE_TilesCoord] = x0;
tokens_TilesCoord[(index_TilesCoord + (1)) % SIZE_TilesCoord] = y0;
tokens_TilesCoord[(index_TilesCoord + (2)) % SIZE_TilesCoord] = x1;
tokens_TilesCoord[(index_TilesCoord + (3)) % SIZE_TilesCoord] = y1;
// Update ports indexes
index_TilesCoord += 4;
write_end_TilesCoord();
}
static void read_SliceData_sendInfoTilesLoop_aligned() {
u32 x0;
u32 y0;
u32 x1;
u32 y1;
u32 local_countCol;
u32 local_countRow;
u16 local_pps_id;
u8 tmp_pps_num_tile_columns_minus1;
u32 local_cnt_i;
u32 local_TILE_SPLIT_ENABLE;
x0 = 0;
y0 = 0;
x1 = pictSize[0];
y1 = pictSize[1];
local_countCol = countCol;
x0 = colTileInPix[local_countCol];
local_countCol = countCol;
x1 = colTileInPix[local_countCol + 1];
local_countRow = countRow;
y0 = rowTileInPix[local_countRow];
local_countRow = countRow;
y1 = rowTileInPix[local_countRow + 1];
local_countCol = countCol;
countCol = local_countCol + 1;
local_countCol = countCol;
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
if (local_countCol == tmp_pps_num_tile_columns_minus1 + 1) {
countCol = 0;
local_countRow = countRow;
countRow = local_countRow + 1;
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
if (local_TILE_SPLIT_ENABLE == 1) {
x0 = 0;
x1 = pictOrTileSize[0];
y0 = 0;
y1 = pictOrTileSize[1];
}
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (0)] = x0;
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (1)] = y0;
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (2)] = x1;
tokens_TilesCoord[(index_TilesCoord % SIZE_TilesCoord) + (3)] = y1;
// Update ports indexes
index_TilesCoord += 4;
write_end_TilesCoord();
}
static i32 isSchedulable_read_SliceData_sendRealInfoTilesLoop() {
i32 result;
u8 local_sliceData_idx;
u32 local_cnt_i;
u32 local_num_entry_offsets;
local_sliceData_idx = sliceData_idx;
local_cnt_i = cnt_i;
local_num_entry_offsets = num_entry_offsets;
result = local_sliceData_idx == 22 && local_cnt_i < local_num_entry_offsets;
return result;
}
static void read_SliceData_sendRealInfoTilesLoop() {
u32 x0;
u32 y0;
u32 x1;
u32 y1;
u32 local_countCol;
u32 local_countRow;
u16 local_pps_id;
u8 tmp_pps_num_tile_columns_minus1;
u32 local_cnt_i;
x0 = 0;
y0 = 0;
x1 = pictSize[0];
y1 = pictSize[1];
local_countCol = countCol;
x0 = colTileInPix[local_countCol];
local_countCol = countCol;
x1 = colTileInPix[local_countCol + 1];
local_countRow = countRow;
y0 = rowTileInPix[local_countRow];
local_countRow = countRow;
y1 = rowTileInPix[local_countRow + 1];
local_countCol = countCol;
countCol = local_countCol + 1;
local_countCol = countCol;
local_pps_id = pps_id;
tmp_pps_num_tile_columns_minus1 = pps_num_tile_columns_minus1[local_pps_id];
if (local_countCol == tmp_pps_num_tile_columns_minus1 + 1) {
countCol = 0;
local_countRow = countRow;
countRow = local_countRow + 1;
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SliceData_senInfoTilesEnd() {
i32 result;
u8 local_sliceData_idx;
u32 local_cnt_i;
u32 local_num_entry_offsets;
local_sliceData_idx = sliceData_idx;
local_cnt_i = cnt_i;
local_num_entry_offsets = num_entry_offsets;
result = local_sliceData_idx == 20 && local_cnt_i == local_num_entry_offsets;
return result;
}
static void read_SliceData_senInfoTilesEnd() {
countCol = 0;
countRow = 0;
cnt_i = 0;
sliceData_idx = 22;
// Update ports indexes
}
static i32 isSchedulable_read_SliceData_senRealInfoTilesEnd() {
i32 result;
u8 local_sliceData_idx;
u32 local_cnt_i;
u32 local_num_entry_offsets;
local_sliceData_idx = sliceData_idx;
local_cnt_i = cnt_i;
local_num_entry_offsets = num_entry_offsets;
result = local_sliceData_idx == 22 && local_cnt_i == local_num_entry_offsets;
return result;
}
static void read_SliceData_senRealInfoTilesEnd() {
countCol = 0;
countRow = 0;
cnt_i = 0;
sliceData_idx = 2;
// Update ports indexes
}
static i32 isSchedulable_read_SliceData_noInit() {
i32 result;
u8 local_sliceData_idx;
u8 local_first_slice_segment_in_pic_flag;
u8 local_dependent_slice_segment_flag;
u8 local_prev_pps_id;
u16 local_pps_id;
local_sliceData_idx = sliceData_idx;
local_first_slice_segment_in_pic_flag = first_slice_segment_in_pic_flag;
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
local_prev_pps_id = prev_pps_id;
local_pps_id = pps_id;
result = local_sliceData_idx == 1 && (local_first_slice_segment_in_pic_flag == 0 && local_dependent_slice_segment_flag == 1 && local_prev_pps_id == local_pps_id);
return result;
}
static void read_SliceData_noInit() {
u16 local_pps_id;
u8 tmp_pps_log2_parallel_merge_level;
u8 local_slice_temporal_mvp_enable_flag;
sliceData_idx = 2;
local_pps_id = pps_id;
tmp_pps_log2_parallel_merge_level = pps_log2_parallel_merge_level[local_pps_id];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (0)) % SIZE_MvPredSyntaxElem] = tmp_pps_log2_parallel_merge_level;
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (1)) % SIZE_MvPredSyntaxElem] = local_slice_temporal_mvp_enable_flag;
// Update ports indexes
index_MvPredSyntaxElem += 2;
write_end_MvPredSyntaxElem();
}
static void read_SliceData_noInit_aligned() {
u16 local_pps_id;
u8 tmp_pps_log2_parallel_merge_level;
u8 local_slice_temporal_mvp_enable_flag;
sliceData_idx = 2;
local_pps_id = pps_id;
tmp_pps_log2_parallel_merge_level = pps_log2_parallel_merge_level[local_pps_id];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (0)] = tmp_pps_log2_parallel_merge_level;
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (1)] = local_slice_temporal_mvp_enable_flag;
// Update ports indexes
index_MvPredSyntaxElem += 2;
write_end_MvPredSyntaxElem();
}
static i32 isSchedulable_read_SliceData_noInit_isSlc() {
i32 result;
u8 local_sliceData_idx;
u8 local_first_slice_segment_in_pic_flag;
u8 local_dependent_slice_segment_flag;
u8 local_prev_pps_id;
u16 local_pps_id;
local_sliceData_idx = sliceData_idx;
local_first_slice_segment_in_pic_flag = first_slice_segment_in_pic_flag;
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
local_prev_pps_id = prev_pps_id;
local_pps_id = pps_id;
result = local_sliceData_idx == 1 && (local_first_slice_segment_in_pic_flag == 0 && local_dependent_slice_segment_flag == 0 && local_prev_pps_id == local_pps_id);
return result;
}
static void read_SliceData_noInit_isSlc() {
u32 local_num_entry_offsets;
u16 local_pps_id;
u8 tmp_pps_log2_parallel_merge_level;
u8 local_slice_temporal_mvp_enable_flag;
u8 local_collocated_from_lX;
u8 local_collocated_ref_idx;
u8 tmp_pps_loop_filter_across_slice_enabled_flag;
u8 tmp_pps_loop_filter_across_slice_enabled_flag0;
i32 idx_pictSize;
u16 local_pictSize;
i32 idx_pictOrTileSize;
u16 local_pictOrTileSize;
local_num_entry_offsets = num_entry_offsets;
if (local_num_entry_offsets > 0) {
sliceData_idx = 20;
} else {
sliceData_idx = 21;
}
local_pps_id = pps_id;
tmp_pps_log2_parallel_merge_level = pps_log2_parallel_merge_level[local_pps_id];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (0)) % SIZE_MvPredSyntaxElem] = tmp_pps_log2_parallel_merge_level;
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (1)) % SIZE_MvPredSyntaxElem] = local_slice_temporal_mvp_enable_flag;
local_collocated_from_lX = collocated_from_lX;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (2)) % SIZE_MvPredSyntaxElem] = local_collocated_from_lX;
local_collocated_ref_idx = collocated_ref_idx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (3)) % SIZE_MvPredSyntaxElem] = local_collocated_ref_idx;
tokens_IsPicSlcLcu[(index_IsPicSlcLcu + (0)) % SIZE_IsPicSlcLcu] = 1;
local_num_entry_offsets = num_entry_offsets;
tokens_TilesCoord[(index_TilesCoord + (0)) % SIZE_TilesCoord] = local_num_entry_offsets;
local_num_entry_offsets = num_entry_offsets;
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag0 = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
tokens_LFAcrossSlcTile[(index_LFAcrossSlcTile + (0)) % SIZE_LFAcrossSlcTile] = tmp_pps_loop_filter_across_slice_enabled_flag + (tmp_pps_loop_filter_across_slice_enabled_flag0 << 1);
idx_pictSize = 0;
while (idx_pictSize < 2) {
local_pictSize = pictSize[idx_pictSize];
tokens_PictSize[(index_PictSize + (idx_pictSize)) % SIZE_PictSize] = local_pictSize;
idx_pictSize = idx_pictSize + 1;
}
idx_pictOrTileSize = 0;
while (idx_pictOrTileSize < 2) {
local_pictOrTileSize = pictOrTileSize[idx_pictOrTileSize];
idx_pictOrTileSize = idx_pictOrTileSize + 1;
}
tokens_IsPicSlc[(index_IsPicSlc + (0)) % SIZE_IsPicSlc] = 1;
// Update ports indexes
index_MvPredSyntaxElem += 4;
write_end_MvPredSyntaxElem();
index_IsPicSlcLcu += 1;
index_TilesCoord += 1;
index_LFAcrossSlcTile += 1;
index_PictSize += 2;
write_end_PictSize();
index_IsPicSlc += 1;
}
static void read_SliceData_noInit_isSlc_aligned() {
u32 local_num_entry_offsets;
u16 local_pps_id;
u8 tmp_pps_log2_parallel_merge_level;
u8 local_slice_temporal_mvp_enable_flag;
u8 local_collocated_from_lX;
u8 local_collocated_ref_idx;
u8 tmp_pps_loop_filter_across_slice_enabled_flag;
u8 tmp_pps_loop_filter_across_slice_enabled_flag0;
i32 idx_pictSize;
u16 local_pictSize;
i32 idx_pictOrTileSize;
u16 local_pictOrTileSize;
local_num_entry_offsets = num_entry_offsets;
if (local_num_entry_offsets > 0) {
sliceData_idx = 20;
} else {
sliceData_idx = 21;
}
local_pps_id = pps_id;
tmp_pps_log2_parallel_merge_level = pps_log2_parallel_merge_level[local_pps_id];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (0)] = tmp_pps_log2_parallel_merge_level;
local_slice_temporal_mvp_enable_flag = slice_temporal_mvp_enable_flag;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (1)] = local_slice_temporal_mvp_enable_flag;
local_collocated_from_lX = collocated_from_lX;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (2)] = local_collocated_from_lX;
local_collocated_ref_idx = collocated_ref_idx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (3)] = local_collocated_ref_idx;
tokens_IsPicSlcLcu[(index_IsPicSlcLcu + (0)) % SIZE_IsPicSlcLcu] = 1;
local_num_entry_offsets = num_entry_offsets;
tokens_TilesCoord[(index_TilesCoord + (0)) % SIZE_TilesCoord] = local_num_entry_offsets;
local_num_entry_offsets = num_entry_offsets;
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
local_pps_id = pps_id;
tmp_pps_loop_filter_across_slice_enabled_flag0 = pps_loop_filter_across_slice_enabled_flag[local_pps_id];
tokens_LFAcrossSlcTile[(index_LFAcrossSlcTile + (0)) % SIZE_LFAcrossSlcTile] = tmp_pps_loop_filter_across_slice_enabled_flag + (tmp_pps_loop_filter_across_slice_enabled_flag0 << 1);
idx_pictSize = 0;
while (idx_pictSize < 2) {
local_pictSize = pictSize[idx_pictSize];
tokens_PictSize[(index_PictSize % SIZE_PictSize) + (idx_pictSize)] = local_pictSize;
idx_pictSize = idx_pictSize + 1;
}
idx_pictOrTileSize = 0;
while (idx_pictOrTileSize < 2) {
local_pictOrTileSize = pictOrTileSize[idx_pictOrTileSize];
idx_pictOrTileSize = idx_pictOrTileSize + 1;
}
tokens_IsPicSlc[(index_IsPicSlc + (0)) % SIZE_IsPicSlc] = 1;
// Update ports indexes
index_MvPredSyntaxElem += 4;
write_end_MvPredSyntaxElem();
index_IsPicSlcLcu += 1;
index_TilesCoord += 1;
index_LFAcrossSlcTile += 1;
index_PictSize += 2;
write_end_PictSize();
index_IsPicSlc += 1;
}
static i32 isSchedulable_read_SliceData_start() {
i32 result;
u8 local_sliceData_idx;
local_sliceData_idx = sliceData_idx;
result = local_sliceData_idx == 2;
return result;
}
static void read_SliceData_start_aligned() {
u8 local_Log2CtbSize;
u32 CtbSize;
u32 local_slice_segment_address;
u32 local_CtbAddrRS;
u16 tmp_ctbAddrRStoTS;
u16 local_sps_id;
u16 tmp_sps_pic_width_in_luma_samples;
u32 tmp_InverseRasterScan;
u16 tmp_sps_pic_width_in_luma_samples0;
u32 tmp_InverseRasterScan0;
u16 local_xCtb;
u16 local_yCtb;
local_Log2CtbSize = Log2CtbSize;
CtbSize = 1 << local_Log2CtbSize;
local_slice_segment_address = slice_segment_address;
CtbAddrRS = local_slice_segment_address;
local_CtbAddrRS = CtbAddrRS;
tmp_ctbAddrRStoTS = ctbAddrRStoTS[local_CtbAddrRS];
CtbAddrTS = tmp_ctbAddrRStoTS;
local_CtbAddrRS = CtbAddrRS;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
tmp_InverseRasterScan = HevcDecoder_Algo_Parser_InverseRasterScan(local_CtbAddrRS, CtbSize, CtbSize, tmp_sps_pic_width_in_luma_samples, 0);
xCtb = tmp_InverseRasterScan;
local_CtbAddrRS = CtbAddrRS;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples0 = sps_pic_width_in_luma_samples[local_sps_id];
tmp_InverseRasterScan0 = HevcDecoder_Algo_Parser_InverseRasterScan(local_CtbAddrRS, CtbSize, CtbSize, tmp_sps_pic_width_in_luma_samples0, 1);
yCtb = tmp_InverseRasterScan0;
end_of_slice_flag = 0;
sliceData_idx = 3;
local_xCtb = xCtb;
tokens_SliceAddr[(index_SliceAddr % SIZE_SliceAddr) + (0)] = local_xCtb;
local_yCtb = yCtb;
tokens_SliceAddr[(index_SliceAddr % SIZE_SliceAddr) + (1)] = local_yCtb;
// Update ports indexes
index_SliceAddr += 2;
write_end_SliceAddr();
}
static i32 isSchedulable_read_SliceData_gotoCodingTree_start() {
i32 result;
u8 local_sliceData_idx;
i32 local_byPassFlag;
local_sliceData_idx = sliceData_idx;
local_byPassFlag = byPassFlag;
result = local_sliceData_idx == 3 && local_byPassFlag == 0;
return result;
}
static void read_SliceData_gotoCodingTree_start() {
sliceData_idx = 4;
codingTree_idx = 1;
// Update ports indexes
}
static i32 isSchedulable_read_SliceData_gotoCodingTree_byPass() {
i32 result;
u8 local_sliceData_idx;
i32 local_byPassFlag;
local_sliceData_idx = sliceData_idx;
local_byPassFlag = byPassFlag;
result = local_sliceData_idx == 3 && local_byPassFlag == 1;
return result;
}
static void read_SliceData_gotoCodingTree_byPass() {
sliceData_idx = 4;
codingTree_idx = 0;
// Update ports indexes
}
static i32 isSchedulable_read_CodingTree_byPassBeforeTileLoop() {
i32 result;
u8 local_codingTree_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u32 local_totalByPass;
u8 tmp_TilesInfo;
local_codingTree_idx = codingTree_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_totalByPass = totalByPass;
tmp_TilesInfo = TilesInfo[1];
result = local_codingTree_idx == 0 && tmp_isFifoFull && local_cnt_i < local_totalByPass + tmp_TilesInfo;
return result;
}
static void read_CodingTree_byPassBeforeTileLoop() {
u8 local_localizeAEB;
i32 local_countAEB;
u32 local_cnt_i;
local_localizeAEB = localizeAEB;
if ((local_localizeAEB & 1) == 0) {
HevcDecoder_Algo_Parser_flushBits_name(8, fifo, "bypassed");
} else {
local_countAEB = countAEB;
countAEB = local_countAEB + 1;
}
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_CodingTree_byPassBeforeTileEnd() {
i32 result;
u8 local_codingTree_idx;
i32 tmp_isFifoFull;
u32 local_cnt_i;
u32 local_totalByPass;
u8 tmp_TilesInfo;
local_codingTree_idx = codingTree_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_cnt_i = cnt_i;
local_totalByPass = totalByPass;
tmp_TilesInfo = TilesInfo[1];
result = local_codingTree_idx == 0 && tmp_isFifoFull && local_cnt_i == local_totalByPass + tmp_TilesInfo;
return result;
}
static void read_CodingTree_byPassBeforeTileEnd() {
u8 tmp_TilesInfo;
u32 local_tile_idx;
u16 tmp_nbCtbTile;
u32 local_CtbAddrTS;
u16 tmp_ctbAddrTStoRS;
cnt_i = 0;
byPassFlag = 0;
codingTree_idx = 1;
tmp_TilesInfo = TilesInfo[1];
tile_idx = tmp_TilesInfo;
local_tile_idx = tile_idx;
tmp_nbCtbTile = nbCtbTile[local_tile_idx - 1];
CtbAddrTS = tmp_nbCtbTile;
local_CtbAddrTS = CtbAddrTS;
tmp_ctbAddrTStoRS = ctbAddrTStoRS[local_CtbAddrTS];
CtbAddrRS = tmp_ctbAddrTStoRS;
// Update ports indexes
}
static i32 isSchedulable_read_SliceData_retCodingTree() {
i32 result;
u8 local_sliceData_idx;
i32 tmp_isFifoFull;
local_sliceData_idx = sliceData_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_sliceData_idx == 4 && tmp_isFifoFull;
return result;
}
static void read_SliceData_retCodingTree() {
u32 res[1];
u32 tmp_res;
u32 local_CtbAddrTS;
u16 tmp_ctbAddrTStoRS;
u16 local_pps_id;
u8 tmp_pps_entropy_coding_sync_enabled_flag;
u16 local_PicWidthInCtbsY;
u16 local_sps_id;
u16 tmp_sps_ctb_width;
u16 tmp_sps_ctb_width0;
i32 i;
u8 local_NB_MAX_SE;
i32 j;
u8 local_NB_MAX_NUM_CTX;
u16 tmp_ctxTable;
u32 local_end_of_slice_flag;
u8 tmp_pps_tiles_enabled_flag;
u16 tmp_TileId;
u16 tmp_TileId0;
u32 local_TILE_SPLIT_ENABLE;
i32 local_counter;
res[0] = 0;
HevcDecoder_Algo_Parser_get_END_OF_SLICE_FLAG(codIRange, codIOffset, fifo, res);
tmp_res = res[0];
end_of_slice_flag = tmp_res;
local_CtbAddrTS = CtbAddrTS;
CtbAddrTS = local_CtbAddrTS + 1;
local_CtbAddrTS = CtbAddrTS;
tmp_ctbAddrTStoRS = ctbAddrTStoRS[local_CtbAddrTS];
CtbAddrRS = tmp_ctbAddrTStoRS;
local_pps_id = pps_id;
tmp_pps_entropy_coding_sync_enabled_flag = pps_entropy_coding_sync_enabled_flag[local_pps_id];
local_CtbAddrTS = CtbAddrTS;
local_PicWidthInCtbsY = PicWidthInCtbsY;
local_sps_id = sps_id;
tmp_sps_ctb_width = sps_ctb_width[local_sps_id];
local_CtbAddrTS = CtbAddrTS;
local_sps_id = sps_id;
tmp_sps_ctb_width0 = sps_ctb_width[local_sps_id];
if (tmp_pps_entropy_coding_sync_enabled_flag != 0 && (local_CtbAddrTS % local_PicWidthInCtbsY == 2 || tmp_sps_ctb_width == 2 && local_CtbAddrTS % tmp_sps_ctb_width0 == 0)) {
i = 0;
local_NB_MAX_SE = HevcDecoder_Algo_Parser_NB_MAX_SE;
while (i <= local_NB_MAX_SE - 1) {
j = 0;
local_NB_MAX_NUM_CTX = HevcDecoder_Algo_Parser_NB_MAX_NUM_CTX;
while (j <= local_NB_MAX_NUM_CTX - 1) {
tmp_ctxTable = ctxTable[i][j];
ctxTableWPP[i][j] = tmp_ctxTable;
j = j + 1;
}
i = i + 1;
}
}
local_end_of_slice_flag = end_of_slice_flag;
if (local_end_of_slice_flag == 0) {
sliceData_idx = 3;
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag = pps_tiles_enabled_flag[local_pps_id];
local_CtbAddrTS = CtbAddrTS;
tmp_TileId = TileId[local_CtbAddrTS];
local_CtbAddrTS = CtbAddrTS;
tmp_TileId0 = TileId[local_CtbAddrTS - 1];
if (tmp_pps_tiles_enabled_flag != 0 && tmp_TileId != tmp_TileId0) {
local_TILE_SPLIT_ENABLE = TILE_SPLIT_ENABLE;
if (local_TILE_SPLIT_ENABLE == 0) {
sliceData_idx = 3;
} else {
sliceData_idx = 5;
}
}
} else {
local_counter = counter;
counter = local_counter + 1;
sliceData_idx = 5;
CtbAddrTS = 0;
CtbAddrRS = 0;
byPassFlag = 0;
}
// Update ports indexes
}
static i32 isSchedulable_read_SliceData_end() {
i32 result;
u8 local_sliceData_idx;
local_sliceData_idx = sliceData_idx;
result = local_sliceData_idx == 5;
return result;
}
static void read_SliceData_end() {
// Update ports indexes
}
static i32 isSchedulable_read_CodingTree_start() {
i32 result;
u8 local_codingTree_idx;
i32 tmp_isFifoFull;
local_codingTree_idx = codingTree_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_codingTree_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_CodingTree_start() {
u32 res[1];
u8 local_Log2CtbSize;
u32 CtbSize;
u32 local_CtbAddrTS;
u32 CtbAddrRS;
i32 tile_left_boundary;
i32 tile_up_boundary;
u32 indexTS;
u32 indexRS_0;
u32 indexRS_1;
u32 local_slice_addr;
u16 local_sps_id;
u16 tmp_sps_ctb_width;
u16 tmp_sps_ctb_width0;
u16 tmp_sps_pic_width_in_luma_samples;
u32 tmp_InverseRasterScan;
u16 tmp_sps_pic_width_in_luma_samples0;
u32 tmp_InverseRasterScan0;
u16 local_pps_id;
u8 tmp_pps_entropy_coding_sync_enabled_flag;
u16 local_xCtb;
u16 local_yCtb;
u8 tmp_pps_tiles_enabled_flag;
u16 tmp_TileId;
u16 tmp_TileId0;
u8 tmp_pps_tiles_enabled_flag0;
u16 tmp_TileId1;
u16 tmp_ctbAddrRStoTS;
u16 tmp_TileId2;
u16 tmp_TileId3;
u16 tmp_ctbAddrRStoTS0;
u16 tmp_TileId4;
i32 local_ctb_addr_in_slice;
u16 tmp_sps_ctb_width1;
u32 local_slice_segment_address;
u16 tmp_ctbAddrRStoTS1;
u8 local_dependent_slice_segment_flag;
u8 tmp_pps_tiles_enabled_flag1;
u16 tmp_TileId5;
u16 tmp_TileId6;
i8 local_slice_qp;
u8 local_slice_type;
u8 local_cabac_init_flag;
u8 local_first_slice_segment_in_pic_flag;
u8 tmp_pps_entropy_coding_sync_enabled_flag0;
u16 local_PicWidthInCtbsY;
i32 i;
u8 local_NB_MAX_SE;
i32 j;
u8 local_NB_MAX_NUM_CTX;
u16 tmp_ctxTableWPP;
u8 tmp_pps_tiles_enabled_flag2;
u16 tmp_TileId7;
u16 tmp_TileId8;
u8 tmp_pps_entropy_coding_sync_enabled_flag1;
i32 i0;
i32 j0;
u16 tmp_ctxTableWPP0;
local_Log2CtbSize = Log2CtbSize;
CtbSize = 1 << local_Log2CtbSize;
local_CtbAddrTS = CtbAddrTS;
CtbAddrRS = ctbAddrTStoRS[local_CtbAddrTS];
indexTS = 0;
indexRS_0 = 0;
indexRS_1 = 0;
local_slice_addr = slice_addr;
ctb_addr_in_slice = CtbAddrRS - local_slice_addr;
local_CtbAddrTS = CtbAddrTS;
if (local_CtbAddrTS != 0) {
local_CtbAddrTS = CtbAddrTS;
indexTS = local_CtbAddrTS - 1;
}
if (CtbAddrRS != 0) {
indexRS_0 = CtbAddrRS - 1;
}
local_sps_id = sps_id;
tmp_sps_ctb_width = sps_ctb_width[local_sps_id];
if (CtbAddrRS >= tmp_sps_ctb_width) {
local_sps_id = sps_id;
tmp_sps_ctb_width0 = sps_ctb_width[local_sps_id];
indexRS_1 = CtbAddrRS - tmp_sps_ctb_width0;
}
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
tmp_InverseRasterScan = HevcDecoder_Algo_Parser_InverseRasterScan(CtbAddrRS, CtbSize, CtbSize, tmp_sps_pic_width_in_luma_samples, 0);
xCtb = tmp_InverseRasterScan;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples0 = sps_pic_width_in_luma_samples[local_sps_id];
tmp_InverseRasterScan0 = HevcDecoder_Algo_Parser_InverseRasterScan(CtbAddrRS, CtbSize, CtbSize, tmp_sps_pic_width_in_luma_samples0, 1);
yCtb = tmp_InverseRasterScan0;
local_pps_id = pps_id;
tmp_pps_entropy_coding_sync_enabled_flag = pps_entropy_coding_sync_enabled_flag[local_pps_id];
if (tmp_pps_entropy_coding_sync_enabled_flag != 0) {
local_xCtb = xCtb;
local_yCtb = yCtb;
if (local_xCtb == 0 && (local_yCtb & CtbSize - 1) == 0) {
first_qp_group = 1;
}
} else {
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag = pps_tiles_enabled_flag[local_pps_id];
if (tmp_pps_tiles_enabled_flag != 0) {
local_CtbAddrTS = CtbAddrTS;
local_CtbAddrTS = CtbAddrTS;
tmp_TileId = TileId[local_CtbAddrTS];
tmp_TileId0 = TileId[indexTS];
if (local_CtbAddrTS != 0 && tmp_TileId != tmp_TileId0) {
first_qp_group = 1;
}
}
}
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag0 = pps_tiles_enabled_flag[local_pps_id];
if (tmp_pps_tiles_enabled_flag0 == 1) {
local_xCtb = xCtb;
local_CtbAddrTS = CtbAddrTS;
tmp_TileId1 = TileId[local_CtbAddrTS];
tmp_ctbAddrRStoTS = ctbAddrRStoTS[indexRS_0];
tmp_TileId2 = TileId[tmp_ctbAddrRStoTS];
if (local_xCtb > 0 && tmp_TileId1 != tmp_TileId2) {
tile_left_boundary = 1;
} else {
tile_left_boundary = 0;
}
local_yCtb = yCtb;
local_CtbAddrTS = CtbAddrTS;
tmp_TileId3 = TileId[local_CtbAddrTS];
tmp_ctbAddrRStoTS0 = ctbAddrRStoTS[indexRS_1];
tmp_TileId4 = TileId[tmp_ctbAddrRStoTS0];
if (local_yCtb > 0 && tmp_TileId3 != tmp_TileId4) {
tile_up_boundary = 1;
} else {
tile_up_boundary = 0;
}
} else {
tile_left_boundary = 0;
tile_up_boundary = 0;
}
local_xCtb = xCtb;
local_ctb_addr_in_slice = ctb_addr_in_slice;
ctb_left_flag = local_xCtb > 0 && local_ctb_addr_in_slice > 0 && tile_left_boundary == 0;
local_yCtb = yCtb;
local_ctb_addr_in_slice = ctb_addr_in_slice;
local_sps_id = sps_id;
tmp_sps_ctb_width1 = sps_ctb_width[local_sps_id];
ctb_up_flag = local_yCtb > 0 && local_ctb_addr_in_slice >= tmp_sps_ctb_width1 && tile_up_boundary == 0;
codingTree_idx = 2;
local_CtbAddrTS = CtbAddrTS;
local_slice_segment_address = slice_segment_address;
tmp_ctbAddrRStoTS1 = ctbAddrRStoTS[local_slice_segment_address];
if (local_CtbAddrTS == tmp_ctbAddrRStoTS1) {
HevcDecoder_Algo_Parser_decodeStart(codIRange, codIOffset, fifo);
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag1 = pps_tiles_enabled_flag[local_pps_id];
local_CtbAddrTS = CtbAddrTS;
tmp_TileId5 = TileId[local_CtbAddrTS];
tmp_TileId6 = TileId[indexTS];
if (local_dependent_slice_segment_flag == 0 || tmp_pps_tiles_enabled_flag1 != 0 && tmp_TileId5 != tmp_TileId6) {
local_slice_qp = slice_qp;
local_slice_type = slice_type;
local_cabac_init_flag = cabac_init_flag;
HevcDecoder_Algo_Parser_contextInit(local_slice_qp, local_slice_type, ctxTable, local_cabac_init_flag);
}
local_first_slice_segment_in_pic_flag = first_slice_segment_in_pic_flag;
local_pps_id = pps_id;
tmp_pps_entropy_coding_sync_enabled_flag0 = pps_entropy_coding_sync_enabled_flag[local_pps_id];
if (local_first_slice_segment_in_pic_flag == 0 && tmp_pps_entropy_coding_sync_enabled_flag0 != 0) {
local_CtbAddrTS = CtbAddrTS;
local_PicWidthInCtbsY = PicWidthInCtbsY;
if (local_CtbAddrTS % local_PicWidthInCtbsY == 0) {
local_PicWidthInCtbsY = PicWidthInCtbsY;
if (local_PicWidthInCtbsY == 1) {
local_slice_qp = slice_qp;
local_slice_type = slice_type;
local_cabac_init_flag = cabac_init_flag;
HevcDecoder_Algo_Parser_contextInit(local_slice_qp, local_slice_type, ctxTable, local_cabac_init_flag);
} else {
local_dependent_slice_segment_flag = dependent_slice_segment_flag;
if (local_dependent_slice_segment_flag != 0) {
i = 0;
local_NB_MAX_SE = HevcDecoder_Algo_Parser_NB_MAX_SE;
while (i <= local_NB_MAX_SE - 1) {
j = 0;
local_NB_MAX_NUM_CTX = HevcDecoder_Algo_Parser_NB_MAX_NUM_CTX;
while (j <= local_NB_MAX_NUM_CTX - 1) {
tmp_ctxTableWPP = ctxTableWPP[i][j];
ctxTable[i][j] = tmp_ctxTableWPP;
j = j + 1;
}
i = i + 1;
}
}
}
}
}
} else {
local_CtbAddrTS = CtbAddrTS;
local_pps_id = pps_id;
tmp_pps_tiles_enabled_flag2 = pps_tiles_enabled_flag[local_pps_id];
local_CtbAddrTS = CtbAddrTS;
tmp_TileId7 = TileId[local_CtbAddrTS];
tmp_TileId8 = TileId[indexTS];
if (local_CtbAddrTS == 0 || tmp_pps_tiles_enabled_flag2 != 0 && tmp_TileId7 != tmp_TileId8) {
HevcDecoder_Algo_Parser_decodeReInit(codIRange, codIOffset, fifo);
local_slice_qp = slice_qp;
local_slice_type = slice_type;
local_cabac_init_flag = cabac_init_flag;
HevcDecoder_Algo_Parser_contextInit(local_slice_qp, local_slice_type, ctxTable, local_cabac_init_flag);
}
local_pps_id = pps_id;
tmp_pps_entropy_coding_sync_enabled_flag1 = pps_entropy_coding_sync_enabled_flag[local_pps_id];
if (tmp_pps_entropy_coding_sync_enabled_flag1 != 0) {
local_CtbAddrTS = CtbAddrTS;
local_PicWidthInCtbsY = PicWidthInCtbsY;
if (local_CtbAddrTS % local_PicWidthInCtbsY == 0) {
HevcDecoder_Algo_Parser_get_END_OF_SUB_STREAM_ONE_BIT(codIRange, codIOffset, fifo, res);
HevcDecoder_Algo_Parser_decodeReInit(codIRange, codIOffset, fifo);
local_PicWidthInCtbsY = PicWidthInCtbsY;
if (local_PicWidthInCtbsY == 1) {
local_slice_qp = slice_qp;
local_slice_type = slice_type;
local_cabac_init_flag = cabac_init_flag;
HevcDecoder_Algo_Parser_contextInit(local_slice_qp, local_slice_type, ctxTable, local_cabac_init_flag);
} else {
i0 = 0;
local_NB_MAX_SE = HevcDecoder_Algo_Parser_NB_MAX_SE;
while (i0 <= local_NB_MAX_SE - 1) {
j0 = 0;
local_NB_MAX_NUM_CTX = HevcDecoder_Algo_Parser_NB_MAX_NUM_CTX;
while (j0 <= local_NB_MAX_NUM_CTX - 1) {
tmp_ctxTableWPP0 = ctxTableWPP[i0][j0];
ctxTable[i0][j0] = tmp_ctxTableWPP0;
j0 = j0 + 1;
}
i0 = i0 + 1;
}
}
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_CodingTree_gotoSaoParam() {
i32 result;
u8 local_codingTree_idx;
u8 tmp_slice_sample_adaptive_offset_flag;
u8 tmp_slice_sample_adaptive_offset_flag0;
local_codingTree_idx = codingTree_idx;
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[0];
tmp_slice_sample_adaptive_offset_flag0 = slice_sample_adaptive_offset_flag[1];
result = local_codingTree_idx == 2 && (tmp_slice_sample_adaptive_offset_flag == 1 || tmp_slice_sample_adaptive_offset_flag0 == 1);
return result;
}
static void read_CodingTree_gotoSaoParam() {
u16 local_xCtb;
u8 local_Log2CtbSize;
u16 local_yCtb;
codingTree_idx = 3;
sao_idx = 1;
local_xCtb = xCtb;
local_Log2CtbSize = Log2CtbSize;
sao_rx = local_xCtb >> local_Log2CtbSize;
local_yCtb = yCtb;
local_Log2CtbSize = Log2CtbSize;
sao_ry = local_yCtb >> local_Log2CtbSize;
sao_cIdx = 0;
// Update ports indexes
}
static i32 isSchedulable_read_CodingTree_noGotoSaoParam() {
i32 result;
u8 local_codingTree_idx;
u8 tmp_slice_sample_adaptive_offset_flag;
u8 tmp_slice_sample_adaptive_offset_flag0;
local_codingTree_idx = codingTree_idx;
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[0];
tmp_slice_sample_adaptive_offset_flag0 = slice_sample_adaptive_offset_flag[1];
result = local_codingTree_idx == 2 && (tmp_slice_sample_adaptive_offset_flag == 0 && tmp_slice_sample_adaptive_offset_flag0 == 0);
return result;
}
static void read_CodingTree_noGotoSaoParam() {
codingTree_idx = 3;
// Update ports indexes
}
static i32 isSchedulable_read_CodingTree_gotoCodingQuadTree() {
i32 result;
u8 local_codingTree_idx;
local_codingTree_idx = codingTree_idx;
result = local_codingTree_idx == 3;
return result;
}
static void read_CodingTree_gotoCodingQuadTree() {
u8 local_CT_idx;
u16 local_CT_x0;
u16 local_xCtb;
u16 local_CT_y0;
u16 local_yCtb;
u8 local_CT_log2CbSize;
u8 local_Log2CtbSize;
u8 local_CT_ctDepth;
u8 local_NEW_LCU;
codingTree_idx = 4;
ctStack_idx = 0;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[0][local_CT_idx] = 1;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
local_xCtb = xCtb;
ctStack[0][local_CT_x0] = local_xCtb;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
local_yCtb = yCtb;
ctStack[0][local_CT_y0] = local_yCtb;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
local_Log2CtbSize = Log2CtbSize;
ctStack[0][local_CT_log2CbSize] = local_Log2CtbSize;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
ctStack[0][local_CT_ctDepth] = 0;
local_NEW_LCU = HevcDecoder_Algo_Parser_NEW_LCU;
tokens_IsPicSlcLcu[(index_IsPicSlcLcu + (0)) % SIZE_IsPicSlcLcu] = local_NEW_LCU;
// Update ports indexes
index_IsPicSlcLcu += 1;
}
static i32 isSchedulable_read_CodingTree_end() {
i32 result;
u8 local_codingTree_idx;
local_codingTree_idx = codingTree_idx;
result = local_codingTree_idx == 4;
return result;
}
static void read_CodingTree_end() {
// Update ports indexes
}
static i32 isSchedulable_read_SaoParam_start() {
i32 result;
u8 local_sao_idx;
i32 tmp_isFifoFull;
local_sao_idx = sao_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_sao_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_SaoParam_start() {
i32 res[1];
u8 sao_merge_left_flag;
u8 sao_merge_up_flag;
u8 local_SAO_NO_MERGE;
i16 sao_merge;
u16 local_sao_rx;
i32 local_ctb_left_flag;
u8 local_SAO_MERGE_LEFT;
u16 local_sao_ry;
i32 local_ctb_up_flag;
u8 local_SAO_MERGE_UP;
sao_merge_left_flag = 0;
sao_merge_up_flag = 0;
local_SAO_NO_MERGE = HevcDecoder_Algo_Parser_SAO_NO_MERGE;
sao_merge = local_SAO_NO_MERGE;
local_sao_rx = sao_rx;
if (local_sao_rx > 0) {
local_ctb_left_flag = ctb_left_flag;
if (local_ctb_left_flag) {
HevcDecoder_Algo_Parser_get_SAO_MERGE_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
sao_merge_left_flag = res[0];
if (sao_merge_left_flag == 1) {
local_SAO_MERGE_LEFT = HevcDecoder_Algo_Parser_SAO_MERGE_LEFT;
sao_merge = local_SAO_MERGE_LEFT;
}
}
}
local_sao_ry = sao_ry;
if (local_sao_ry > 0 && sao_merge_left_flag == 0) {
local_ctb_up_flag = ctb_up_flag;
if (local_ctb_up_flag) {
HevcDecoder_Algo_Parser_get_SAO_MERGE_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
sao_merge_up_flag = res[0];
if (sao_merge_up_flag == 1) {
local_SAO_MERGE_UP = HevcDecoder_Algo_Parser_SAO_MERGE_UP;
sao_merge = local_SAO_MERGE_UP;
}
}
}
sao_idx = 2;
if (sao_merge_left_flag == 0 && sao_merge_up_flag == 0) {
sao_cIdx = 0;
} else {
sao_cIdx = 3;
}
tokens_SaoSe[(index_SaoSe + (0)) % SIZE_SaoSe] = sao_merge;
// Update ports indexes
index_SaoSe += 1;
}
static i32 isSchedulable_read_SaoParam_loop1() {
i32 result;
u8 local_sao_idx;
i32 tmp_isFifoFull;
u8 local_sao_cIdx;
u8 tmp_slice_sample_adaptive_offset_flag;
local_sao_idx = sao_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_sao_cIdx = sao_cIdx;
local_sao_cIdx = sao_cIdx;
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[local_sao_cIdx];
result = local_sao_idx == 2 && tmp_isFifoFull && (local_sao_cIdx < 3 && tmp_slice_sample_adaptive_offset_flag == 1);
return result;
}
static void read_SaoParam_loop1() {
i32 res[1];
u8 local_sao_cIdx;
u8 local_SAO_NOT_APPLIED;
i32 tmp_res;
i16 local_sao_typeIdx;
local_sao_cIdx = sao_cIdx;
if (local_sao_cIdx != 2) {
local_SAO_NOT_APPLIED = HevcDecoder_Algo_Parser_SAO_NOT_APPLIED;
sao_typeIdx = local_SAO_NOT_APPLIED;
HevcDecoder_Algo_Parser_get_SAO_TYPE_IDX(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
sao_typeIdx = tmp_res;
}
local_sao_typeIdx = sao_typeIdx;
local_SAO_NOT_APPLIED = HevcDecoder_Algo_Parser_SAO_NOT_APPLIED;
if (local_sao_typeIdx != local_SAO_NOT_APPLIED) {
sao_idx = 3;
} else {
local_sao_cIdx = sao_cIdx;
sao_cIdx = local_sao_cIdx + 1;
}
local_sao_typeIdx = sao_typeIdx;
tokens_SaoSe[(index_SaoSe + (0)) % SIZE_SaoSe] = local_sao_typeIdx;
// Update ports indexes
index_SaoSe += 1;
}
static i32 isSchedulable_read_SaoParam_loop2() {
i32 result;
u8 local_sao_idx;
i32 tmp_isFifoFull;
local_sao_idx = sao_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_sao_idx == 3 && tmp_isFifoFull;
return result;
}
static void read_SaoParam_loop2() {
u8 offsetTh;
i16 offset[4];
i32 res[1];
i32 i;
i32 tmp_res;
i16 local_sao_typeIdx;
u8 local_SAO_BAND;
i32 i0;
i16 tmp_offset;
i32 tmp_res0;
i16 tmp_offset0;
i32 tmp_res1;
i16 tmp_offset1;
i16 tmp_offset2;
u8 local_sao_cIdx;
i32 tmp_res2;
i16 tmp_offset3;
i16 tmp_offset4;
i16 tmp_offset5;
i16 tmp_offset6;
i16 local_sao_eo;
offsetTh = (1 << 3) - 1;
offset[0] = 0;
offset[1] = 0;
offset[2] = 0;
offset[3] = 0;
res[0] = 0;
i = 0;
while (i <= 3) {
HevcDecoder_Algo_Parser_get_SAO_OFFSET_ABS(offsetTh, codIRange, codIOffset, fifo, res);
tmp_res = res[0];
offset[i] = tmp_res;
i = i + 1;
}
local_sao_typeIdx = sao_typeIdx;
local_SAO_BAND = HevcDecoder_Algo_Parser_SAO_BAND;
if (local_sao_typeIdx == local_SAO_BAND) {
i0 = 0;
while (i0 <= 3) {
tmp_offset = offset[i0];
if (tmp_offset != 0) {
HevcDecoder_Algo_Parser_get_SAO_OFFSET_SIGN(codIRange, codIOffset, fifo, res);
tmp_res0 = res[0];
if (tmp_res0 != 0) {
tmp_offset0 = offset[i0];
offset[i0] = -tmp_offset0;
}
}
i0 = i0 + 1;
}
HevcDecoder_Algo_Parser_get_SAO_BAND_POSITION(codIRange, codIOffset, fifo, res);
tmp_res1 = res[0];
sao_eo = tmp_res1;
} else {
tmp_offset1 = offset[2];
offset[2] = -tmp_offset1;
tmp_offset2 = offset[3];
offset[3] = -tmp_offset2;
local_sao_cIdx = sao_cIdx;
if (local_sao_cIdx != 2) {
HevcDecoder_Algo_Parser_get_SAO_EO(codIRange, codIOffset, fifo, res);
tmp_res2 = res[0];
sao_eo = tmp_res2;
}
}
local_sao_cIdx = sao_cIdx;
sao_cIdx = local_sao_cIdx + 1;
sao_idx = 2;
tmp_offset3 = offset[0];
tokens_SaoSe[(index_SaoSe + (0)) % SIZE_SaoSe] = tmp_offset3;
tmp_offset4 = offset[1];
tokens_SaoSe[(index_SaoSe + (1)) % SIZE_SaoSe] = tmp_offset4;
tmp_offset5 = offset[2];
tokens_SaoSe[(index_SaoSe + (2)) % SIZE_SaoSe] = tmp_offset5;
tmp_offset6 = offset[3];
tokens_SaoSe[(index_SaoSe + (3)) % SIZE_SaoSe] = tmp_offset6;
local_sao_eo = sao_eo;
tokens_SaoSe[(index_SaoSe + (4)) % SIZE_SaoSe] = local_sao_eo;
// Update ports indexes
index_SaoSe += 5;
write_end_SaoSe();
}
static void read_SaoParam_loop2_aligned() {
u8 offsetTh;
i16 offset[4];
i32 res[1];
i32 i;
i32 tmp_res;
i16 local_sao_typeIdx;
u8 local_SAO_BAND;
i32 i0;
i16 tmp_offset;
i32 tmp_res0;
i16 tmp_offset0;
i32 tmp_res1;
i16 tmp_offset1;
i16 tmp_offset2;
u8 local_sao_cIdx;
i32 tmp_res2;
i16 tmp_offset3;
i16 tmp_offset4;
i16 tmp_offset5;
i16 tmp_offset6;
i16 local_sao_eo;
offsetTh = (1 << 3) - 1;
offset[0] = 0;
offset[1] = 0;
offset[2] = 0;
offset[3] = 0;
res[0] = 0;
i = 0;
while (i <= 3) {
HevcDecoder_Algo_Parser_get_SAO_OFFSET_ABS(offsetTh, codIRange, codIOffset, fifo, res);
tmp_res = res[0];
offset[i] = tmp_res;
i = i + 1;
}
local_sao_typeIdx = sao_typeIdx;
local_SAO_BAND = HevcDecoder_Algo_Parser_SAO_BAND;
if (local_sao_typeIdx == local_SAO_BAND) {
i0 = 0;
while (i0 <= 3) {
tmp_offset = offset[i0];
if (tmp_offset != 0) {
HevcDecoder_Algo_Parser_get_SAO_OFFSET_SIGN(codIRange, codIOffset, fifo, res);
tmp_res0 = res[0];
if (tmp_res0 != 0) {
tmp_offset0 = offset[i0];
offset[i0] = -tmp_offset0;
}
}
i0 = i0 + 1;
}
HevcDecoder_Algo_Parser_get_SAO_BAND_POSITION(codIRange, codIOffset, fifo, res);
tmp_res1 = res[0];
sao_eo = tmp_res1;
} else {
tmp_offset1 = offset[2];
offset[2] = -tmp_offset1;
tmp_offset2 = offset[3];
offset[3] = -tmp_offset2;
local_sao_cIdx = sao_cIdx;
if (local_sao_cIdx != 2) {
HevcDecoder_Algo_Parser_get_SAO_EO(codIRange, codIOffset, fifo, res);
tmp_res2 = res[0];
sao_eo = tmp_res2;
}
}
local_sao_cIdx = sao_cIdx;
sao_cIdx = local_sao_cIdx + 1;
sao_idx = 2;
tmp_offset3 = offset[0];
tokens_SaoSe[(index_SaoSe % SIZE_SaoSe) + (0)] = tmp_offset3;
tmp_offset4 = offset[1];
tokens_SaoSe[(index_SaoSe % SIZE_SaoSe) + (1)] = tmp_offset4;
tmp_offset5 = offset[2];
tokens_SaoSe[(index_SaoSe % SIZE_SaoSe) + (2)] = tmp_offset5;
tmp_offset6 = offset[3];
tokens_SaoSe[(index_SaoSe % SIZE_SaoSe) + (3)] = tmp_offset6;
local_sao_eo = sao_eo;
tokens_SaoSe[(index_SaoSe % SIZE_SaoSe) + (4)] = local_sao_eo;
// Update ports indexes
index_SaoSe += 5;
write_end_SaoSe();
}
static i32 isSchedulable_read_SaoParam_nextLoop() {
i32 result;
u8 local_sao_idx;
u8 local_sao_cIdx;
u8 tmp_slice_sample_adaptive_offset_flag;
local_sao_idx = sao_idx;
local_sao_cIdx = sao_cIdx;
local_sao_cIdx = sao_cIdx;
tmp_slice_sample_adaptive_offset_flag = slice_sample_adaptive_offset_flag[local_sao_cIdx];
result = local_sao_idx == 2 && (local_sao_cIdx < 3 && tmp_slice_sample_adaptive_offset_flag == 0);
return result;
}
static void read_SaoParam_nextLoop() {
u8 local_sao_cIdx;
local_sao_cIdx = sao_cIdx;
sao_cIdx = local_sao_cIdx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_SaoParam_endLoop() {
i32 result;
u8 local_sao_idx;
u8 local_sao_cIdx;
local_sao_idx = sao_idx;
local_sao_cIdx = sao_cIdx;
result = local_sao_idx == 2 && local_sao_cIdx == 3;
return result;
}
static void read_SaoParam_endLoop() {
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_start() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
i32 tmp_isFifoFull;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_ctStack == 1 && tmp_isFifoFull;
return result;
}
static void read_CodingQuadTree_start() {
u32 res[1];
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 ct_x0;
u16 local_CT_y0;
u16 ct_y0;
u8 local_CT_ctDepth;
u8 ct_ctDepth;
u8 local_Log2MinCbSize;
u8 top_ctDepth;
u8 left_ctDepth;
u8 split_cu_flag;
u8 local_Log2CtbSize;
u16 local_pps_id;
u16 tmp_pps_diff_cu_qp_delta_depth;
u8 Log2MinCuQpDeltaSize;
u16 tbX;
u16 tbY;
u16 MinCbAddrZS;
u16 m;
u16 x0b;
u16 y0b;
u16 local_sps_id;
u16 tmp_sps_log2_ctb_size;
u16 tmp_pps_diff_cu_qp_delta_depth0;
u8 local_CT_log2CbSize;
u16 tmp_ctStack;
u16 local_PicWidthInCtbsY;
u32 local_CtbAddrRS;
u16 tmp_ctbAddrRStoTS;
i32 local_DEBUG_CABAC;
i32 local_DEBUG_TRACE1;
u8 local_ct_log2CbSize;
u16 tmp_ctStack0;
i32 i;
u32 tmp_if;
u64 tmp_if0;
i32 local_ctb_left_flag;
i32 local_ctb_up_flag;
u16 tmp_sps_pic_width_in_luma_samples;
u16 tmp_sps_pic_height_in_luma_samples;
u8 tmp_pps_cu_qp_delta_enabled_flag;
u16 local_CT_x1;
u16 local_CT_y1;
u8 local_CT_idx;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
ct_x0 = ctStack[local_ctStack_idx][local_CT_x0];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
ct_y0 = ctStack[local_ctStack_idx][local_CT_y0];
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
ct_ctDepth = ctStack[local_ctStack_idx][local_CT_ctDepth];
local_Log2MinCbSize = Log2MinCbSize;
top_ctDepth = cu_top_ctDepth[ct_x0 >> local_Log2MinCbSize];
local_Log2MinCbSize = Log2MinCbSize;
left_ctDepth = cu_left_ctDepth[ct_y0 >> local_Log2MinCbSize];
local_Log2CtbSize = Log2CtbSize;
local_pps_id = pps_id;
tmp_pps_diff_cu_qp_delta_depth = pps_diff_cu_qp_delta_depth[local_pps_id];
Log2MinCuQpDeltaSize = local_Log2CtbSize - tmp_pps_diff_cu_qp_delta_depth;
local_Log2MinCbSize = Log2MinCbSize;
local_Log2MinCbSize = Log2MinCbSize;
local_Log2CtbSize = Log2CtbSize;
tbX = ((ct_x0 >> local_Log2MinCbSize) << local_Log2MinCbSize) >> local_Log2CtbSize;
local_Log2MinCbSize = Log2MinCbSize;
local_Log2MinCbSize = Log2MinCbSize;
local_Log2CtbSize = Log2CtbSize;
tbY = ((ct_y0 >> local_Log2MinCbSize) << local_Log2MinCbSize) >> local_Log2CtbSize;
local_Log2CtbSize = Log2CtbSize;
x0b = ct_x0 & (1 << local_Log2CtbSize) - 1;
local_Log2CtbSize = Log2CtbSize;
y0b = ct_y0 & (1 << local_Log2CtbSize) - 1;
local_sps_id = sps_id;
tmp_sps_log2_ctb_size = sps_log2_ctb_size[local_sps_id];
local_pps_id = pps_id;
tmp_pps_diff_cu_qp_delta_depth0 = pps_diff_cu_qp_delta_depth[local_pps_id];
qp_block_mask = (1 << (tmp_sps_log2_ctb_size - tmp_pps_diff_cu_qp_delta_depth0)) - 1;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_log2CbSize];
ct_log2CbSize = tmp_ctStack;
local_PicWidthInCtbsY = PicWidthInCtbsY;
CtbAddrRS = local_PicWidthInCtbsY * tbY + tbX;
local_CtbAddrRS = CtbAddrRS;
tmp_ctbAddrRStoTS = ctbAddrRStoTS[local_CtbAddrRS];
local_Log2CtbSize = Log2CtbSize;
local_Log2MinCbSize = Log2MinCbSize;
MinCbAddrZS = tmp_ctbAddrRStoTS << ((local_Log2CtbSize - local_Log2MinCbSize) * 2);
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_DEBUG_TRACE1 = HevcDecoder_Algo_Parser_DEBUG_TRACE1;
if (local_DEBUG_CABAC && local_DEBUG_TRACE1) {
local_ct_log2CbSize = ct_log2CbSize;
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_ctDepth];
printf("read_CodingTree.start (%u, %u, %llu, %u)\n", ct_x0, ct_y0, 1 << local_ct_log2CbSize, tmp_ctStack0);
} else {
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_CodingTree.start\n");
}
}
i = 0;
local_Log2CtbSize = Log2CtbSize;
local_Log2MinCbSize = Log2MinCbSize;
while (i <= local_Log2CtbSize - local_Log2MinCbSize - 1) {
m = 1 << i;
local_Log2MinCbSize = Log2MinCbSize;
if ((m & ct_x0 >> local_Log2MinCbSize) != 0) {
tmp_if = m * m;
} else {
tmp_if = 0;
}
local_Log2MinCbSize = Log2MinCbSize;
if ((m & ct_y0 >> local_Log2MinCbSize) != 0) {
tmp_if0 = 2 * m * m;
} else {
tmp_if0 = 0;
}
MinCbAddrZS = MinCbAddrZS + tmp_if + tmp_if0;
i = i + 1;
}
local_ctb_left_flag = ctb_left_flag;
if (local_ctb_left_flag || x0b > 0) {
local_Log2MinCbSize = Log2MinCbSize;
left_ctDepth = cu_left_ctDepth[ct_y0 >> local_Log2MinCbSize];
}
local_ctb_up_flag = ctb_up_flag;
if (local_ctb_up_flag || y0b > 0) {
local_Log2MinCbSize = Log2MinCbSize;
top_ctDepth = cu_top_ctDepth[ct_x0 >> local_Log2MinCbSize];
}
local_ct_log2CbSize = ct_log2CbSize;
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
local_ct_log2CbSize = ct_log2CbSize;
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
local_ct_log2CbSize = ct_log2CbSize;
local_Log2MinCbSize = Log2MinCbSize;
if (ct_x0 + (1 << local_ct_log2CbSize) <= tmp_sps_pic_width_in_luma_samples && ct_y0 + (1 << local_ct_log2CbSize) <= tmp_sps_pic_height_in_luma_samples && local_ct_log2CbSize > local_Log2MinCbSize) {
local_ctb_left_flag = ctb_left_flag;
local_ctb_up_flag = ctb_up_flag;
HevcDecoder_Algo_Parser_get_SPLIT_CODING_UNIT_FLAG(codIRange, codIOffset, ctxTable, fifo, res, ct_ctDepth, local_ctb_left_flag || x0b > 0, left_ctDepth, local_ctb_up_flag || y0b > 0, top_ctDepth);
split_cu_flag = res[0];
} else {
local_ct_log2CbSize = ct_log2CbSize;
local_Log2MinCbSize = Log2MinCbSize;
if (local_ct_log2CbSize > local_Log2MinCbSize) {
split_cu_flag = 1;
} else {
split_cu_flag = 0;
}
}
local_pps_id = pps_id;
tmp_pps_cu_qp_delta_enabled_flag = pps_cu_qp_delta_enabled_flag[local_pps_id];
local_ct_log2CbSize = ct_log2CbSize;
if (tmp_pps_cu_qp_delta_enabled_flag != 0 && local_ct_log2CbSize >= Log2MinCuQpDeltaSize) {
IsCuQpDeltaCoded = 0;
CuQpDelta = 0;
}
if (split_cu_flag == 1) {
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
local_ct_log2CbSize = ct_log2CbSize;
ctStack[local_ctStack_idx][local_CT_x1] = ct_x0 + ((1 << local_ct_log2CbSize) >> 1);
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
local_ct_log2CbSize = ct_log2CbSize;
ctStack[local_ctStack_idx][local_CT_y1] = ct_y0 + ((1 << local_ct_log2CbSize) >> 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 2;
} else {
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 6;
}
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_case1() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
result = tmp_ctStack == 2;
return result;
}
static void read_CodingQuadTree_case1() {
u8 local_ctStack_idx;
u8 idx;
u8 local_CT_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u16 local_CT_y0;
u16 tmp_ctStack0;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u8 local_CT_ctDepth;
u16 tmp_ctStack2;
local_ctStack_idx = ctStack_idx;
idx = local_ctStack_idx;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 3;
local_ctStack_idx = ctStack_idx;
ctStack_idx = local_ctStack_idx + 1;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 1;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[idx][local_CT_x0];
ctStack[local_ctStack_idx][local_CT_x0] = tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[idx][local_CT_y0];
ctStack[local_ctStack_idx][local_CT_y0] = tmp_ctStack0;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[idx][local_CT_log2CbSize];
ctStack[local_ctStack_idx][local_CT_log2CbSize] = tmp_ctStack1 - 1;
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
tmp_ctStack2 = ctStack[idx][local_CT_ctDepth];
ctStack[local_ctStack_idx][local_CT_ctDepth] = tmp_ctStack2 + 1;
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_case2() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
u16 local_CT_x1;
u16 tmp_ctStack0;
u16 local_sps_id;
u16 tmp_sps_pic_width_in_luma_samples;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_x1];
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
result = tmp_ctStack == 3 && tmp_ctStack0 < tmp_sps_pic_width_in_luma_samples;
return result;
}
static void read_CodingQuadTree_case2() {
u8 local_ctStack_idx;
u8 idx;
u8 local_CT_idx;
u16 local_CT_x0;
u16 local_CT_x1;
u16 tmp_ctStack;
u16 local_CT_y0;
u16 tmp_ctStack0;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u8 local_CT_ctDepth;
u16 tmp_ctStack2;
local_ctStack_idx = ctStack_idx;
idx = local_ctStack_idx;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 4;
local_ctStack_idx = ctStack_idx;
ctStack_idx = local_ctStack_idx + 1;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 1;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack = ctStack[idx][local_CT_x1];
ctStack[local_ctStack_idx][local_CT_x0] = tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[idx][local_CT_y0];
ctStack[local_ctStack_idx][local_CT_y0] = tmp_ctStack0;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[idx][local_CT_log2CbSize];
ctStack[local_ctStack_idx][local_CT_log2CbSize] = tmp_ctStack1 - 1;
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
tmp_ctStack2 = ctStack[idx][local_CT_ctDepth];
ctStack[local_ctStack_idx][local_CT_ctDepth] = tmp_ctStack2 + 1;
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_noCase2() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
u16 local_CT_x1;
u16 tmp_ctStack0;
u16 local_sps_id;
u16 tmp_sps_pic_width_in_luma_samples;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_x1];
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
result = tmp_ctStack == 3 && tmp_ctStack0 >= tmp_sps_pic_width_in_luma_samples;
return result;
}
static void read_CodingQuadTree_noCase2() {
u8 local_OTHER;
u8 local_ctStack_idx;
u16 local_CT_x1;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u16 tmp_ctStack3;
u16 tmp_ctStack4;
u16 tmp_ctStack5;
u16 tmp_ctStack6;
u8 local_CT_idx;
u8 local_PART_2Nx2N;
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x1];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x1];
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = tmp_ctStack3;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = tmp_ctStack4;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = 1 << (tmp_ctStack5 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = 1 << (tmp_ctStack6 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 4;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_PartMode += 1;
}
static void read_CodingQuadTree_noCase2_aligned() {
u8 local_OTHER;
u8 local_ctStack_idx;
u16 local_CT_x1;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u16 tmp_ctStack3;
u16 tmp_ctStack4;
u16 tmp_ctStack5;
u16 tmp_ctStack6;
u8 local_CT_idx;
u8 local_PART_2Nx2N;
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x1];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x1];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = tmp_ctStack3;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = tmp_ctStack4;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = 1 << (tmp_ctStack5 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = 1 << (tmp_ctStack6 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 4;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_PartMode += 1;
}
static i32 isSchedulable_read_CodingQuadTree_case3() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
u16 local_CT_y1;
u16 tmp_ctStack0;
u16 local_sps_id;
u16 tmp_sps_pic_height_in_luma_samples;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y1];
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
result = tmp_ctStack == 4 && tmp_ctStack0 < tmp_sps_pic_height_in_luma_samples;
return result;
}
static void read_CodingQuadTree_case3() {
u8 local_ctStack_idx;
u8 idx;
u8 local_CT_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u16 local_CT_y0;
u16 local_CT_y1;
u16 tmp_ctStack0;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u8 local_CT_ctDepth;
u16 tmp_ctStack2;
local_ctStack_idx = ctStack_idx;
idx = local_ctStack_idx;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 5;
local_ctStack_idx = ctStack_idx;
ctStack_idx = local_ctStack_idx + 1;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 1;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[idx][local_CT_x0];
ctStack[local_ctStack_idx][local_CT_x0] = tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[idx][local_CT_y1];
ctStack[local_ctStack_idx][local_CT_y0] = tmp_ctStack0;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[idx][local_CT_log2CbSize];
ctStack[local_ctStack_idx][local_CT_log2CbSize] = tmp_ctStack1 - 1;
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
tmp_ctStack2 = ctStack[idx][local_CT_ctDepth];
ctStack[local_ctStack_idx][local_CT_ctDepth] = tmp_ctStack2 + 1;
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_noCase3() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
u16 local_CT_y1;
u16 tmp_ctStack0;
u16 local_sps_id;
u16 tmp_sps_pic_height_in_luma_samples;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y1];
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
result = tmp_ctStack == 4 && tmp_ctStack0 >= tmp_sps_pic_height_in_luma_samples;
return result;
}
static void read_CodingQuadTree_noCase3() {
u8 local_OTHER;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y1;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u16 tmp_ctStack3;
u16 tmp_ctStack4;
u16 tmp_ctStack5;
u16 tmp_ctStack6;
u8 local_CT_idx;
u8 local_PART_2Nx2N;
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y1];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = tmp_ctStack3;
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y1];
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = tmp_ctStack4;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = 1 << (tmp_ctStack5 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = 1 << (tmp_ctStack6 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 5;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_PartMode += 1;
}
static void read_CodingQuadTree_noCase3_aligned() {
u8 local_OTHER;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y1;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u16 tmp_ctStack3;
u16 tmp_ctStack4;
u16 tmp_ctStack5;
u16 tmp_ctStack6;
u8 local_CT_idx;
u8 local_PART_2Nx2N;
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y1];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = tmp_ctStack3;
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y1];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = tmp_ctStack4;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = 1 << (tmp_ctStack5 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = 1 << (tmp_ctStack6 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 5;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_PartMode += 1;
}
static i32 isSchedulable_read_CodingQuadTree_case4() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
u16 local_CT_x1;
u16 tmp_ctStack0;
u16 local_sps_id;
u16 tmp_sps_pic_width_in_luma_samples;
u16 local_CT_y1;
u16 tmp_ctStack1;
u16 tmp_sps_pic_height_in_luma_samples;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_x1];
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_y1];
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
result = tmp_ctStack == 5 && tmp_ctStack0 < tmp_sps_pic_width_in_luma_samples && tmp_ctStack1 < tmp_sps_pic_height_in_luma_samples;
return result;
}
static void read_CodingQuadTree_case4() {
u8 local_ctStack_idx;
u8 idx;
u8 local_CT_idx;
u16 local_CT_x0;
u16 local_CT_x1;
u16 tmp_ctStack;
u16 local_CT_y0;
u16 local_CT_y1;
u16 tmp_ctStack0;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u8 local_CT_ctDepth;
u16 tmp_ctStack2;
local_ctStack_idx = ctStack_idx;
idx = local_ctStack_idx;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 7;
local_ctStack_idx = ctStack_idx;
ctStack_idx = local_ctStack_idx + 1;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 1;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack = ctStack[idx][local_CT_x1];
ctStack[local_ctStack_idx][local_CT_x0] = tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[idx][local_CT_y1];
ctStack[local_ctStack_idx][local_CT_y0] = tmp_ctStack0;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[idx][local_CT_log2CbSize];
ctStack[local_ctStack_idx][local_CT_log2CbSize] = tmp_ctStack1 - 1;
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
tmp_ctStack2 = ctStack[idx][local_CT_ctDepth];
ctStack[local_ctStack_idx][local_CT_ctDepth] = tmp_ctStack2 + 1;
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_noCase4() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
u16 local_CT_x1;
u16 tmp_ctStack0;
u16 local_sps_id;
u16 tmp_sps_pic_width_in_luma_samples;
u16 local_CT_y1;
u16 tmp_ctStack1;
u16 tmp_sps_pic_height_in_luma_samples;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_x1];
local_sps_id = sps_id;
tmp_sps_pic_width_in_luma_samples = sps_pic_width_in_luma_samples[local_sps_id];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_y1];
local_sps_id = sps_id;
tmp_sps_pic_height_in_luma_samples = sps_pic_height_in_luma_samples[local_sps_id];
result = tmp_ctStack == 5 && (tmp_ctStack0 >= tmp_sps_pic_width_in_luma_samples || tmp_ctStack1 >= tmp_sps_pic_height_in_luma_samples);
return result;
}
static void read_CodingQuadTree_noCase4() {
u8 local_OTHER;
u8 local_ctStack_idx;
u16 local_CT_x1;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y1;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u16 tmp_ctStack3;
u16 tmp_ctStack4;
u16 tmp_ctStack5;
u16 tmp_ctStack6;
u8 local_CT_idx;
u8 local_PART_2Nx2N;
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x1];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y1];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x1];
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = tmp_ctStack3;
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y1];
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = tmp_ctStack4;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = 1 << (tmp_ctStack5 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = 1 << (tmp_ctStack6 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 7;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_PartMode += 1;
}
static void read_CodingQuadTree_noCase4_aligned() {
u8 local_OTHER;
u8 local_ctStack_idx;
u16 local_CT_x1;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y1;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u16 tmp_ctStack3;
u16 tmp_ctStack4;
u16 tmp_ctStack5;
u16 tmp_ctStack6;
u8 local_CT_idx;
u8 local_PART_2Nx2N;
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x1];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y1];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
local_OTHER = HevcDecoder_Algo_Parser_OTHER;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_OTHER;
local_ctStack_idx = ctStack_idx;
local_CT_x1 = HevcDecoder_Algo_Parser_CT_x1;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x1];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = tmp_ctStack3;
local_ctStack_idx = ctStack_idx;
local_CT_y1 = HevcDecoder_Algo_Parser_CT_y1;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y1];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = tmp_ctStack4;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = 1 << (tmp_ctStack5 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = 1 << (tmp_ctStack6 - 1);
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 7;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_PartMode += 1;
}
static i32 isSchedulable_read_CodingQuadTree_gotoCodingUnit() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
result = tmp_ctStack == 6;
return result;
}
static void read_CodingQuadTree_gotoCodingUnit() {
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u16 local_CT_y0;
u16 tmp_ctStack0;
u8 local_CT_log2CbSize;
u16 tmp_ctStack1;
u8 local_CT_ctDepth;
u16 tmp_ctStack2;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
ctStack[local_ctStack_idx][local_CT_idx] = 7;
cu_idx = 1;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
cu_x0 = tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
cu_y0 = tmp_ctStack0;
local_ctStack_idx = ctStack_idx;
local_CT_log2CbSize = HevcDecoder_Algo_Parser_CT_log2CbSize;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_log2CbSize];
cu_log2CbSize = tmp_ctStack1;
local_ctStack_idx = ctStack_idx;
local_CT_ctDepth = HevcDecoder_Algo_Parser_CT_ctDepth;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_ctDepth];
cu_ctDepth = tmp_ctStack2;
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_noEnd() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
result = tmp_ctStack == 7 && local_ctStack_idx != 0;
return result;
}
static void read_CodingQuadTree_noEnd() {
u8 local_ctStack_idx;
local_ctStack_idx = ctStack_idx;
ctStack_idx = local_ctStack_idx - 1;
// Update ports indexes
}
static i32 isSchedulable_read_CodingQuadTree_end() {
i32 result;
u8 local_ctStack_idx;
u8 local_CT_idx;
u16 tmp_ctStack;
local_ctStack_idx = ctStack_idx;
local_CT_idx = HevcDecoder_Algo_Parser_CT_idx;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_idx];
local_ctStack_idx = ctStack_idx;
result = tmp_ctStack == 7 && local_ctStack_idx == 0;
return result;
}
static void read_CodingQuadTree_end() {
u16 local_cu_x0;
u8 local_cu_log2CbSize;
i32 local_qp_block_mask;
u16 local_cu_y0;
i8 local_qp_y;
local_cu_x0 = cu_x0;
local_cu_log2CbSize = cu_log2CbSize;
local_qp_block_mask = qp_block_mask;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
local_qp_block_mask = qp_block_mask;
if ((local_cu_x0 + (1 << local_cu_log2CbSize) & local_qp_block_mask) == 0 && (local_cu_y0 + (1 << local_cu_log2CbSize) & local_qp_block_mask) == 0) {
local_qp_y = qp_y;
qPy_pred = local_qp_y;
}
// Update ports indexes
}
static i32 isSchedulable_read_CodingUnit_start() {
i32 result;
u8 local_cu_idx;
i32 tmp_isFifoFull;
local_cu_idx = cu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_cu_idx == 1 && tmp_isFifoFull;
return result;
}
static void read_CodingUnit_start() {
u32 res[1];
u8 local_cu_log2CbSize;
u8 local_Log2MinCbSize;
u8 length;
u16 local_cu_x0;
i32 x_cb;
u16 local_cu_y0;
i32 y_cb;
u8 local_ctStack_idx;
u16 local_CT_x0;
i32 ct_x0;
u16 local_CT_y0;
i32 ct_y0;
u8 local_Log2CtbSize;
i32 x0b;
i32 y0b;
i32 leftFlag;
i32 upFlag;
u16 local_sps_id;
u16 tmp_sps_log2_ctb_size;
u16 local_pps_id;
u16 tmp_pps_diff_cu_qp_delta_depth;
i32 local_ctb_left_flag;
i32 local_ctb_up_flag;
i32 i;
i32 local_DEBUG_CABAC;
i32 local_DEBUG_TRACE1;
u8 local_INTRA;
u8 tmp_pps_transquant_bypass_enable_flag;
u32 tmp_res;
u8 local_cu_transquant_bypass_flag;
u8 local_slice_type;
u8 local_I_SLICE;
u32 tmp_res0;
u8 local_SKIP;
u8 local_skip_flag;
u8 local_INTER;
u32 i0;
i32 local_counterfillSkip;
u8 local_PART_2Nx2N;
local_cu_log2CbSize = cu_log2CbSize;
local_Log2MinCbSize = Log2MinCbSize;
length = (1 << local_cu_log2CbSize) >> local_Log2MinCbSize;
local_cu_x0 = cu_x0;
local_Log2MinCbSize = Log2MinCbSize;
x_cb = local_cu_x0 >> local_Log2MinCbSize;
local_cu_y0 = cu_y0;
local_Log2MinCbSize = Log2MinCbSize;
y_cb = local_cu_y0 >> local_Log2MinCbSize;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
ct_x0 = ctStack[local_ctStack_idx][local_CT_x0];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
ct_y0 = ctStack[local_ctStack_idx][local_CT_y0];
local_Log2CtbSize = Log2CtbSize;
x0b = ct_x0 & (1 << local_Log2CtbSize) - 1;
local_Log2CtbSize = Log2CtbSize;
y0b = ct_y0 & (1 << local_Log2CtbSize) - 1;
local_sps_id = sps_id;
tmp_sps_log2_ctb_size = sps_log2_ctb_size[local_sps_id];
local_pps_id = pps_id;
tmp_pps_diff_cu_qp_delta_depth = pps_diff_cu_qp_delta_depth[local_pps_id];
qp_block_mask = (1 << (tmp_sps_log2_ctb_size - tmp_pps_diff_cu_qp_delta_depth)) - 1;
pcm_flag = 0;
local_ctb_left_flag = ctb_left_flag;
leftFlag = local_ctb_left_flag || x0b > 0;
local_ctb_up_flag = ctb_up_flag;
upFlag = local_ctb_up_flag || y0b > 0;
skip_flag = 0;
merge_flag = 0;
i = 0;
while (i <= 3) {
intra_pred_mode[i] = 1;
i = i + 1;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_DEBUG_TRACE1 = HevcDecoder_Algo_Parser_DEBUG_TRACE1;
if (local_DEBUG_CABAC && local_DEBUG_TRACE1) {
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
printf("read_CodingUnit.start (%u, %u, %u)\n", local_cu_x0, local_cu_y0, local_cu_log2CbSize);
} else {
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_CodingUnit.start\n");
}
}
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
predMode = local_INTRA;
local_pps_id = pps_id;
tmp_pps_transquant_bypass_enable_flag = pps_transquant_bypass_enable_flag[local_pps_id];
if (tmp_pps_transquant_bypass_enable_flag != 0) {
HevcDecoder_Algo_Parser_get_CU_TRANSQUANT_BYPASS_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
cu_transquant_bypass_flag = tmp_res;
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
if (local_cu_transquant_bypass_flag != 0) {
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
set_deblocking_bypass(local_cu_x0, local_cu_y0, local_cu_log2CbSize);
}
} else {
cu_transquant_bypass_flag = 0;
}
local_slice_type = slice_type;
local_I_SLICE = HevcDecoder_Algo_Parser_I_SLICE;
if (local_slice_type != local_I_SLICE) {
HevcDecoder_Algo_Parser_get_SKIP_FLAG(codIRange, codIOffset, ctxTable, fifo, res, skip_flag_tab, x_cb, y_cb, leftFlag, upFlag);
tmp_res0 = res[0];
skip_flag = tmp_res0;
local_SKIP = HevcDecoder_Algo_Parser_SKIP;
predMode = local_SKIP;
local_skip_flag = skip_flag;
if (local_skip_flag == 1) {
local_SKIP = HevcDecoder_Algo_Parser_SKIP;
predMode = local_SKIP;
} else {
local_INTER = HevcDecoder_Algo_Parser_INTER;
predMode = local_INTER;
}
i0 = 0;
while (i0 <= length - 1) {
local_skip_flag = skip_flag;
skip_flag_tab[x_cb + i0][0] = local_skip_flag;
local_skip_flag = skip_flag;
skip_flag_tab[y_cb + i0][1] = local_skip_flag;
i0 = i0 + 1;
}
local_counterfillSkip = counterfillSkip;
counterfillSkip = local_counterfillSkip + 1;
}
local_cu_log2CbSize = cu_log2CbSize;
cu_nCbS = 1 << local_cu_log2CbSize;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
partMode = local_PART_2Nx2N;
cu_idx = 2;
// Update ports indexes
}
static i32 isSchedulable_read_CodingUnit_gotoPredictionUnit_goto1() {
i32 result;
u8 local_cu_idx;
u8 local_skip_flag;
local_cu_idx = cu_idx;
local_skip_flag = skip_flag;
result = local_cu_idx == 2 && local_skip_flag != 0;
return result;
}
static void read_CodingUnit_gotoPredictionUnit_goto1() {
u8 local_SKIP;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_cu_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u8 local_cu_nCbS;
u16 local_cu_x0;
u16 local_cu_y0;
u8 local_partMode;
u8 local_Log2MinCbSize;
u8 local_PART_2Nx2N;
i8 local_slice_qp;
u8 local_TEXT_LUMA;
u8 local_TEXT_CHROMA_U;
u8 local_TEXT_CHROMA_V;
local_SKIP = HevcDecoder_Algo_Parser_SKIP;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_cu_log2CbSize = cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
local_SKIP = HevcDecoder_Algo_Parser_SKIP;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_SKIP;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = tmp_ctStack1;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = tmp_ctStack2;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = 1 << local_cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = 1 << local_cu_log2CbSize;
cu_idx = 10;
pu_idx = 1;
local_cu_nCbS = cu_nCbS;
pu_PbW = local_cu_nCbS;
local_cu_nCbS = cu_nCbS;
pu_PbH = local_cu_nCbS;
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
local_partMode = partMode;
local_Log2MinCbSize = Log2MinCbSize;
HevcDecoder_Algo_Parser_intra_prediction_unit_default_value(local_cu_x0, local_cu_y0, local_cu_log2CbSize, local_partMode, local_Log2MinCbSize - 1, intraPredMode);
tokens_Cbf[(index_Cbf + (0)) % SIZE_Cbf] = 0;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
tokens_SplitTransform[(index_SplitTransform + (0)) % SIZE_SplitTransform] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize + (0)) % SIZE_TUSize] = 1 << local_cu_log2CbSize;
tokens_TUSize[(index_TUSize + (1)) % SIZE_TUSize] = 1;
tokens_TUSize[(index_TUSize + (2)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (3)) % SIZE_TUSize] = 0;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize + (4)) % SIZE_TUSize] = local_slice_qp;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
tokens_TUSize[(index_TUSize + (5)) % SIZE_TUSize] = local_TEXT_LUMA;
tokens_TUSize[(index_TUSize + (6)) % SIZE_TUSize] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize + (7)) % SIZE_TUSize] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize + (8)) % SIZE_TUSize] = 1;
tokens_TUSize[(index_TUSize + (9)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (10)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (11)) % SIZE_TUSize] = 0;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize + (12)) % SIZE_TUSize] = local_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize + (13)) % SIZE_TUSize] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize + (14)) % SIZE_TUSize] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize + (15)) % SIZE_TUSize] = 1;
tokens_TUSize[(index_TUSize + (16)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (17)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (18)) % SIZE_TUSize] = 0;
local_TEXT_CHROMA_V = HevcDecoder_Algo_Parser_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize + (19)) % SIZE_TUSize] = local_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize + (20)) % SIZE_TUSize] = 0;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_Cbf += 1;
index_PartMode += 1;
index_SplitTransform += 1;
index_TUSize += 21;
write_end_TUSize();
}
static void read_CodingUnit_gotoPredictionUnit_goto1_aligned() {
u8 local_SKIP;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_cu_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u8 local_cu_nCbS;
u16 local_cu_x0;
u16 local_cu_y0;
u8 local_partMode;
u8 local_Log2MinCbSize;
u8 local_PART_2Nx2N;
i8 local_slice_qp;
u8 local_TEXT_LUMA;
u8 local_TEXT_CHROMA_U;
u8 local_TEXT_CHROMA_V;
local_SKIP = HevcDecoder_Algo_Parser_SKIP;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_cu_log2CbSize = cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
local_SKIP = HevcDecoder_Algo_Parser_SKIP;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_SKIP;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = tmp_ctStack1;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = tmp_ctStack2;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = 1 << local_cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = 1 << local_cu_log2CbSize;
cu_idx = 10;
pu_idx = 1;
local_cu_nCbS = cu_nCbS;
pu_PbW = local_cu_nCbS;
local_cu_nCbS = cu_nCbS;
pu_PbH = local_cu_nCbS;
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
local_partMode = partMode;
local_Log2MinCbSize = Log2MinCbSize;
HevcDecoder_Algo_Parser_intra_prediction_unit_default_value(local_cu_x0, local_cu_y0, local_cu_log2CbSize, local_partMode, local_Log2MinCbSize - 1, intraPredMode);
tokens_Cbf[(index_Cbf + (0)) % SIZE_Cbf] = 0;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_PART_2Nx2N;
tokens_SplitTransform[(index_SplitTransform + (0)) % SIZE_SplitTransform] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (0)] = 1 << local_cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (1)] = 1;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (2)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (3)] = 0;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (4)] = local_slice_qp;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (5)] = local_TEXT_LUMA;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (6)] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (7)] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (8)] = 1;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (9)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (10)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (11)] = 0;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (12)] = local_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (13)] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (14)] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (15)] = 1;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (16)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (17)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (18)] = 0;
local_TEXT_CHROMA_V = HevcDecoder_Algo_Parser_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (19)] = local_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (20)] = 0;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
index_Cbf += 1;
index_PartMode += 1;
index_SplitTransform += 1;
index_TUSize += 21;
write_end_TUSize();
}
static i32 isSchedulable_read_CodingUnit_noGoto1() {
i32 result;
u8 local_cu_idx;
i32 tmp_isFifoFull;
u8 local_skip_flag;
local_cu_idx = cu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_skip_flag = skip_flag;
result = local_cu_idx == 2 && tmp_isFifoFull && local_skip_flag == 0;
return result;
}
static void read_CodingUnit_noGoto1() {
u8 prev_intra_luma_pred_flag[4];
u8 intra_chroma_table[4];
u32 res[1];
u8 local_Log2MinCbSize;
u8 Log2MinIPCMCUSize;
u8 pbOffset;
u8 pbEnd;
u8 local_slice_type;
u8 local_I_SLICE;
u32 tmp_res;
u8 local_predMode;
u8 local_INTRA;
u8 local_cu_log2CbSize;
u8 local_amp_enabled_flag;
u32 tmp_res0;
u8 local_partMode;
u8 local_PART_NxN;
u8 local_PART_2Nx2N;
u16 local_sps_id;
u8 tmp_sps_pcm_enabled_flag;
u32 tmp_log2_min_pcm_cb_size;
u32 tmp_log2_max_pcm_cb_size;
u32 tmp_res1;
u8 local_pcm_flag;
u16 local_cu_x0;
u16 local_cu_y0;
u8 local_cu_nCbS;
i32 i;
i32 j;
u32 tmp_res2;
i32 i0;
i32 j0;
u8 tmp_prev_intra_luma_pred_flag;
u8 tmp_prev_intra_luma_pred_flag0;
u32 tmp_res3;
u8 local_Log2CtbSize;
i32 local_ctb_up_flag;
i32 local_ctb_left_flag;
u32 tmp_res4;
u32 tmp_res5;
u32 tmp_res6;
u8 tmp_intra_pred_mode;
u32 tmp_res7;
u8 tmp_intra_chroma_table;
u32 tmp_res8;
u8 tmp_intra_chroma_table0;
u8 tmp_intra_pred_mode0;
intra_chroma_table[0] = 0;
intra_chroma_table[1] = 26;
intra_chroma_table[2] = 10;
intra_chroma_table[3] = 1;
local_Log2MinCbSize = Log2MinCbSize;
Log2MinIPCMCUSize = local_Log2MinCbSize;
IntraSplitFlag = 0;
local_slice_type = slice_type;
local_I_SLICE = HevcDecoder_Algo_Parser_I_SLICE;
if (local_slice_type != local_I_SLICE) {
HevcDecoder_Algo_Parser_get_PRED_MODE_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
predMode = tmp_res;
}
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
local_cu_log2CbSize = cu_log2CbSize;
local_Log2MinCbSize = Log2MinCbSize;
if (local_predMode != local_INTRA || local_cu_log2CbSize == local_Log2MinCbSize) {
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
local_cu_log2CbSize = cu_log2CbSize;
local_Log2MinCbSize = Log2MinCbSize;
local_amp_enabled_flag = amp_enabled_flag;
HevcDecoder_Algo_Parser_get_PART_SIZE(codIRange, codIOffset, ctxTable, fifo, res, local_predMode == local_INTRA, local_cu_log2CbSize, local_Log2MinCbSize, local_amp_enabled_flag);
tmp_res0 = res[0];
partMode = tmp_res0;
local_partMode = partMode;
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (local_partMode == local_PART_NxN && local_predMode == local_INTRA) {
IntraSplitFlag = 1;
} else {
IntraSplitFlag = 0;
}
}
cu_idx = 4;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (local_predMode == local_INTRA) {
pcm_flag = 0;
local_partMode = partMode;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
local_sps_id = sps_id;
tmp_sps_pcm_enabled_flag = sps_pcm_enabled_flag[local_sps_id];
local_cu_log2CbSize = cu_log2CbSize;
local_sps_id = sps_id;
tmp_log2_min_pcm_cb_size = log2_min_pcm_cb_size[local_sps_id];
local_cu_log2CbSize = cu_log2CbSize;
local_sps_id = sps_id;
tmp_log2_max_pcm_cb_size = log2_max_pcm_cb_size[local_sps_id];
if (local_partMode == local_PART_2Nx2N && tmp_sps_pcm_enabled_flag == 1 && local_cu_log2CbSize >= tmp_log2_min_pcm_cb_size && local_cu_log2CbSize <= tmp_log2_max_pcm_cb_size) {
HevcDecoder_Algo_Parser_get_PCM_FLAG(codIRange, codIOffset, fifo, res);
tmp_res1 = res[0];
pcm_flag = tmp_res1;
}
local_pcm_flag = pcm_flag;
if (local_pcm_flag != 0) {
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
local_partMode = partMode;
local_Log2MinCbSize = Log2MinCbSize;
HevcDecoder_Algo_Parser_intra_prediction_unit_default_value(local_cu_x0, local_cu_y0, local_cu_log2CbSize, local_partMode, local_Log2MinCbSize - 1, intraPredMode);
cu_idx = 3;
} else {
local_partMode = partMode;
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
if (local_partMode == local_PART_NxN) {
local_cu_nCbS = cu_nCbS;
pbOffset = local_cu_nCbS >> 1;
} else {
local_cu_nCbS = cu_nCbS;
pbOffset = local_cu_nCbS;
}
local_partMode = partMode;
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
if (local_partMode == local_PART_NxN) {
pbEnd = 1;
} else {
pbEnd = 0;
}
i = 0;
while (i <= pbEnd) {
j = 0;
while (j <= pbEnd) {
HevcDecoder_Algo_Parser_get_PREV_INTRA_LUMA_PRED_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res2 = res[0];
prev_intra_luma_pred_flag[(i << 1) + j] = tmp_res2;
j = j + 1;
}
i = i + 1;
}
i0 = 0;
while (i0 <= pbEnd) {
j0 = 0;
while (j0 <= pbEnd) {
tmp_prev_intra_luma_pred_flag = prev_intra_luma_pred_flag[(i0 << 1) + j0];
if (tmp_prev_intra_luma_pred_flag == 1) {
HevcDecoder_Algo_Parser_get_MPM_IDX(codIRange, codIOffset, fifo, res);
} else {
HevcDecoder_Algo_Parser_get_REM_INTRA_LUMA_PRED_MODE(codIRange, codIOffset, fifo, res);
}
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
tmp_prev_intra_luma_pred_flag0 = prev_intra_luma_pred_flag[(i0 << 1) + j0];
tmp_res3 = res[0];
local_Log2CtbSize = Log2CtbSize;
local_ctb_up_flag = ctb_up_flag;
local_ctb_left_flag = ctb_left_flag;
HevcDecoder_Algo_Parser_luma_intra_pred_mode(local_cu_x0 + j0 * pbOffset, local_cu_y0 + i0 * pbOffset, pbOffset, tmp_prev_intra_luma_pred_flag0, tmp_res3, res, Log2MinIPCMCUSize - 1, local_Log2CtbSize, intraPredMode, local_ctb_up_flag, local_ctb_left_flag);
tmp_res4 = res[0];
intra_pred_mode[(i0 << 1) + j0] = tmp_res4;
j0 = j0 + 1;
}
i0 = i0 + 1;
}
HevcDecoder_Algo_Parser_get_INTRA_CHROMA_PRED_MODE(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res5 = res[0];
intraChrPredModIdx = tmp_res5;
tmp_res6 = res[0];
if (tmp_res6 != 4) {
tmp_intra_pred_mode = intra_pred_mode[0];
tmp_res7 = res[0];
tmp_intra_chroma_table = intra_chroma_table[tmp_res7];
if (tmp_intra_pred_mode == tmp_intra_chroma_table) {
intra_pred_mode_c = 34;
} else {
tmp_res8 = res[0];
tmp_intra_chroma_table0 = intra_chroma_table[tmp_res8];
intra_pred_mode_c = tmp_intra_chroma_table0;
}
} else {
tmp_intra_pred_mode0 = intra_pred_mode[0];
intra_pred_mode_c = tmp_intra_pred_mode0;
}
cu_idx = 8;
}
} else {
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
local_partMode = partMode;
local_Log2MinCbSize = Log2MinCbSize;
HevcDecoder_Algo_Parser_intra_prediction_unit_default_value(local_cu_x0, local_cu_y0, local_cu_log2CbSize, local_partMode, local_Log2MinCbSize - 1, intraPredMode);
}
local_partMode = partMode;
tokens_PartMode[(index_PartMode + (0)) % SIZE_PartMode] = local_partMode;
// Update ports indexes
index_PartMode += 1;
}
static i32 isSchedulable_sendIntraPredMode_skip() {
i32 result;
u8 local_predMode;
u8 local_INTRA;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
result = local_predMode != local_INTRA;
return result;
}
static void sendIntraPredMode_skip() {
// Update ports indexes
}
static i32 isSchedulable_sendIntraPredMode_part2Nx2N() {
i32 result;
u8 local_partMode;
u8 tmp_partModeToNumPart;
u8 local_predMode;
u8 local_INTRA;
local_partMode = partMode;
tmp_partModeToNumPart = HevcDecoder_Algo_Parser_partModeToNumPart[local_partMode];
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
result = tmp_partModeToNumPart == 1 && local_predMode == local_INTRA;
return result;
}
static void sendIntraPredMode_part2Nx2N() {
u8 local_predMode;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_cu_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u8 predMode_v;
u8 idx;
u8 local_intraChrPredModIdx;
u8 tmp_intra_pred_mode;
u8 tmp_intra_pred_mode0;
u8 tmp_intra_pred_mode1;
u8 tmp_intra_pred_mode2;
u8 tmp_intra_pred_mode3;
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_cu_log2CbSize = cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = tmp_ctStack1;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = tmp_ctStack2;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = 1 << local_cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = 1 << local_cu_log2CbSize;
local_intraChrPredModIdx = intraChrPredModIdx;
if (local_intraChrPredModIdx == 4) {
predMode_v = intra_pred_mode[0];
} else {
tmp_intra_pred_mode = intra_pred_mode[0];
if (tmp_intra_pred_mode == 0) {
idx = 0;
} else {
tmp_intra_pred_mode0 = intra_pred_mode[0];
if (tmp_intra_pred_mode0 == 26) {
idx = 1;
} else {
tmp_intra_pred_mode1 = intra_pred_mode[0];
if (tmp_intra_pred_mode1 == 10) {
idx = 2;
} else {
tmp_intra_pred_mode2 = intra_pred_mode[0];
if (tmp_intra_pred_mode2 == 1) {
idx = 3;
} else {
idx = 4;
}
}
}
}
local_intraChrPredModIdx = intraChrPredModIdx;
predMode_v = intraPredModeC[local_intraChrPredModIdx][idx];
}
tmp_intra_pred_mode3 = intra_pred_mode[0];
tokens_IntraPredMode[(index_IntraPredMode + (0)) % SIZE_IntraPredMode] = tmp_intra_pred_mode3;
tokens_IntraPredMode[(index_IntraPredMode + (1)) % SIZE_IntraPredMode] = predMode_v;
// Update ports indexes
index_IntraPredMode += 2;
write_end_IntraPredMode();
index_CUInfo += 5;
write_end_CUInfo();
}
static void sendIntraPredMode_part2Nx2N_aligned() {
u8 local_predMode;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_cu_log2CbSize;
u16 tmp_ctStack1;
u16 tmp_ctStack2;
u8 predMode_v;
u8 idx;
u8 local_intraChrPredModIdx;
u8 tmp_intra_pred_mode;
u8 tmp_intra_pred_mode0;
u8 tmp_intra_pred_mode1;
u8 tmp_intra_pred_mode2;
u8 tmp_intra_pred_mode3;
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_cu_log2CbSize = cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = tmp_ctStack1;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = tmp_ctStack2;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = 1 << local_cu_log2CbSize;
local_cu_log2CbSize = cu_log2CbSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = 1 << local_cu_log2CbSize;
local_intraChrPredModIdx = intraChrPredModIdx;
if (local_intraChrPredModIdx == 4) {
predMode_v = intra_pred_mode[0];
} else {
tmp_intra_pred_mode = intra_pred_mode[0];
if (tmp_intra_pred_mode == 0) {
idx = 0;
} else {
tmp_intra_pred_mode0 = intra_pred_mode[0];
if (tmp_intra_pred_mode0 == 26) {
idx = 1;
} else {
tmp_intra_pred_mode1 = intra_pred_mode[0];
if (tmp_intra_pred_mode1 == 10) {
idx = 2;
} else {
tmp_intra_pred_mode2 = intra_pred_mode[0];
if (tmp_intra_pred_mode2 == 1) {
idx = 3;
} else {
idx = 4;
}
}
}
}
local_intraChrPredModIdx = intraChrPredModIdx;
predMode_v = intraPredModeC[local_intraChrPredModIdx][idx];
}
tmp_intra_pred_mode3 = intra_pred_mode[0];
tokens_IntraPredMode[(index_IntraPredMode % SIZE_IntraPredMode) + (0)] = tmp_intra_pred_mode3;
tokens_IntraPredMode[(index_IntraPredMode % SIZE_IntraPredMode) + (1)] = predMode_v;
// Update ports indexes
index_IntraPredMode += 2;
write_end_IntraPredMode();
index_CUInfo += 5;
write_end_CUInfo();
}
static i32 isSchedulable_sendIntraPredMode_partNxN() {
i32 result;
u8 local_partMode;
u8 tmp_partModeToNumPart;
u8 local_predMode;
u8 local_INTRA;
local_partMode = partMode;
tmp_partModeToNumPart = HevcDecoder_Algo_Parser_partModeToNumPart[local_partMode];
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
result = tmp_partModeToNumPart != 1 && local_predMode == local_INTRA;
return result;
}
static void sendIntraPredMode_partNxN() {
u8 local_cu_log2CbSize;
u8 CUSize;
u8 local_predMode;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u16 tmp_ctStack1;
u16 tmp_colTileInPix0;
u16 tmp_ctStack2;
u16 tmp_rowTileInPix0;
u16 tmp_ctStack3;
u16 tmp_colTileInPix1;
u16 tmp_ctStack4;
u16 tmp_rowTileInPix1;
u16 tmp_ctStack5;
u16 tmp_colTileInPix2;
u16 tmp_ctStack6;
u16 tmp_rowTileInPix2;
u16 tmp_ctStack7;
u16 tmp_ctStack8;
u16 tmp_ctStack9;
u16 tmp_ctStack10;
u16 tmp_ctStack11;
u16 tmp_ctStack12;
u16 tmp_ctStack13;
u16 tmp_ctStack14;
u8 idx;
u32 i;
u8 tmp_intra_pred_mode;
u8 local_intraChrPredModIdx;
u8 tmp_intra_pred_mode0;
u8 tmp_intra_pred_mode1;
u8 tmp_intra_pred_mode2;
u8 tmp_intra_pred_mode3;
u8 tmp_intra_pred_mode4;
u8 tmp_intraPredModeC;
local_cu_log2CbSize = cu_log2CbSize;
CUSize = 1 << (local_cu_log2CbSize - 1);
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix0 = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix0 = rowTileInPix[local_rowIndex];
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix1 = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix1 = rowTileInPix[local_rowIndex];
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix2 = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix2 = rowTileInPix[local_rowIndex];
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack7 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = tmp_ctStack7;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack8 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = tmp_ctStack8;
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = CUSize;
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = CUSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo + (5)) % SIZE_CUInfo] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack9 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (6)) % SIZE_CUInfo] = tmp_ctStack9 + CUSize;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack10 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (7)) % SIZE_CUInfo] = tmp_ctStack10;
tokens_CUInfo[(index_CUInfo + (8)) % SIZE_CUInfo] = CUSize;
tokens_CUInfo[(index_CUInfo + (9)) % SIZE_CUInfo] = CUSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo + (10)) % SIZE_CUInfo] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack11 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (11)) % SIZE_CUInfo] = tmp_ctStack11;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack12 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (12)) % SIZE_CUInfo] = tmp_ctStack12 + CUSize;
tokens_CUInfo[(index_CUInfo + (13)) % SIZE_CUInfo] = CUSize;
tokens_CUInfo[(index_CUInfo + (14)) % SIZE_CUInfo] = CUSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo + (15)) % SIZE_CUInfo] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack13 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo + (16)) % SIZE_CUInfo] = tmp_ctStack13 + CUSize;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack14 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo + (17)) % SIZE_CUInfo] = tmp_ctStack14 + CUSize;
tokens_CUInfo[(index_CUInfo + (18)) % SIZE_CUInfo] = CUSize;
tokens_CUInfo[(index_CUInfo + (19)) % SIZE_CUInfo] = CUSize;
i = 0;
while (i <= 3) {
tmp_intra_pred_mode = intra_pred_mode[i];
tokens_IntraPredMode[(index_IntraPredMode + (2 * i)) % SIZE_IntraPredMode] = tmp_intra_pred_mode;
local_intraChrPredModIdx = intraChrPredModIdx;
if (local_intraChrPredModIdx == 4) {
tmp_intra_pred_mode0 = intra_pred_mode[i];
tokens_IntraPredMode[(index_IntraPredMode + (2 * i + 1)) % SIZE_IntraPredMode] = tmp_intra_pred_mode0;
} else {
tmp_intra_pred_mode1 = intra_pred_mode[i];
if (tmp_intra_pred_mode1 == 0) {
idx = 0;
} else {
tmp_intra_pred_mode2 = intra_pred_mode[i];
if (tmp_intra_pred_mode2 == 26) {
idx = 1;
} else {
tmp_intra_pred_mode3 = intra_pred_mode[i];
if (tmp_intra_pred_mode3 == 10) {
idx = 2;
} else {
tmp_intra_pred_mode4 = intra_pred_mode[i];
if (tmp_intra_pred_mode4 == 1) {
idx = 3;
} else {
idx = 4;
}
}
}
}
local_intraChrPredModIdx = intraChrPredModIdx;
tmp_intraPredModeC = intraPredModeC[local_intraChrPredModIdx][idx];
tokens_IntraPredMode[(index_IntraPredMode + (2 * i + 1)) % SIZE_IntraPredMode] = tmp_intraPredModeC;
}
i = i + 1;
}
// Update ports indexes
index_IntraPredMode += 8;
write_end_IntraPredMode();
index_CUInfo += 20;
write_end_CUInfo();
}
static void sendIntraPredMode_partNxN_aligned() {
u8 local_cu_log2CbSize;
u8 CUSize;
u8 local_predMode;
u8 local_ctStack_idx;
u16 local_CT_x0;
u16 tmp_ctStack;
u32 local_colIndex;
u16 tmp_colTileInPix;
u16 local_CT_y0;
u16 tmp_ctStack0;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u16 tmp_ctStack1;
u16 tmp_colTileInPix0;
u16 tmp_ctStack2;
u16 tmp_rowTileInPix0;
u16 tmp_ctStack3;
u16 tmp_colTileInPix1;
u16 tmp_ctStack4;
u16 tmp_rowTileInPix1;
u16 tmp_ctStack5;
u16 tmp_colTileInPix2;
u16 tmp_ctStack6;
u16 tmp_rowTileInPix2;
u16 tmp_ctStack7;
u16 tmp_ctStack8;
u16 tmp_ctStack9;
u16 tmp_ctStack10;
u16 tmp_ctStack11;
u16 tmp_ctStack12;
u16 tmp_ctStack13;
u16 tmp_ctStack14;
u8 idx;
u32 i;
u8 tmp_intra_pred_mode;
u8 local_intraChrPredModIdx;
u8 tmp_intra_pred_mode0;
u8 tmp_intra_pred_mode1;
u8 tmp_intra_pred_mode2;
u8 tmp_intra_pred_mode3;
u8 tmp_intra_pred_mode4;
u8 tmp_intraPredModeC;
local_cu_log2CbSize = cu_log2CbSize;
CUSize = 1 << (local_cu_log2CbSize - 1);
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack0 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack1 = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix0 = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack2 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix0 = rowTileInPix[local_rowIndex];
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack3 = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix1 = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack4 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix1 = rowTileInPix[local_rowIndex];
local_predMode = predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack5 = ctStack[local_ctStack_idx][local_CT_x0];
local_colIndex = colIndex;
tmp_colTileInPix2 = colTileInPix[local_colIndex];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack6 = ctStack[local_ctStack_idx][local_CT_y0];
local_rowIndex = rowIndex;
tmp_rowTileInPix2 = rowTileInPix[local_rowIndex];
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack7 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = tmp_ctStack7;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack8 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = tmp_ctStack8;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = CUSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = CUSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (5)] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack9 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (6)] = tmp_ctStack9 + CUSize;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack10 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (7)] = tmp_ctStack10;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (8)] = CUSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (9)] = CUSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (10)] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack11 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (11)] = tmp_ctStack11;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack12 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (12)] = tmp_ctStack12 + CUSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (13)] = CUSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (14)] = CUSize;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (15)] = local_predMode;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
tmp_ctStack13 = ctStack[local_ctStack_idx][local_CT_x0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (16)] = tmp_ctStack13 + CUSize;
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
tmp_ctStack14 = ctStack[local_ctStack_idx][local_CT_y0];
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (17)] = tmp_ctStack14 + CUSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (18)] = CUSize;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (19)] = CUSize;
i = 0;
while (i <= 3) {
tmp_intra_pred_mode = intra_pred_mode[i];
tokens_IntraPredMode[(index_IntraPredMode % SIZE_IntraPredMode) + (2 * i)] = tmp_intra_pred_mode;
local_intraChrPredModIdx = intraChrPredModIdx;
if (local_intraChrPredModIdx == 4) {
tmp_intra_pred_mode0 = intra_pred_mode[i];
tokens_IntraPredMode[(index_IntraPredMode % SIZE_IntraPredMode) + (2 * i + 1)] = tmp_intra_pred_mode0;
} else {
tmp_intra_pred_mode1 = intra_pred_mode[i];
if (tmp_intra_pred_mode1 == 0) {
idx = 0;
} else {
tmp_intra_pred_mode2 = intra_pred_mode[i];
if (tmp_intra_pred_mode2 == 26) {
idx = 1;
} else {
tmp_intra_pred_mode3 = intra_pred_mode[i];
if (tmp_intra_pred_mode3 == 10) {
idx = 2;
} else {
tmp_intra_pred_mode4 = intra_pred_mode[i];
if (tmp_intra_pred_mode4 == 1) {
idx = 3;
} else {
idx = 4;
}
}
}
}
local_intraChrPredModIdx = intraChrPredModIdx;
tmp_intraPredModeC = intraPredModeC[local_intraChrPredModIdx][idx];
tokens_IntraPredMode[(index_IntraPredMode % SIZE_IntraPredMode) + (2 * i + 1)] = tmp_intraPredModeC;
}
i = i + 1;
}
// Update ports indexes
index_IntraPredMode += 8;
write_end_IntraPredMode();
index_CUInfo += 20;
write_end_CUInfo();
}
static i32 isSchedulable_read_CodingUnit_gotoPCMSample() {
i32 result;
u8 local_cu_idx;
local_cu_idx = cu_idx;
result = local_cu_idx == 3;
return result;
}
static void read_CodingUnit_gotoPCMSample() {
cu_idx = 8;
// Update ports indexes
}
static i32 isSchedulable_read_CodingUnit_gotoPredictionUnit_goto2() {
i32 result;
u8 local_cu_idx;
local_cu_idx = cu_idx;
local_cu_idx = cu_idx;
local_cu_idx = cu_idx;
local_cu_idx = cu_idx;
result = local_cu_idx == 4 || local_cu_idx == 5 || local_cu_idx == 6 || local_cu_idx == 7;
return result;
}
static void read_CodingUnit_gotoPredictionUnit_goto2() {
u8 local_cu_nCbS;
u8 nCbS_2;
u8 nCbS_4;
u8 nCbS_3_4;
u8 local_ctStack_idx;
u16 local_CT_x0;
i32 x0;
u16 local_CT_y0;
i32 y0;
u8 local_partMode;
u8 local_PART_2Nx2N;
u8 local_PART_2NxN;
u8 local_cu_idx;
u8 local_PART_Nx2N;
u8 local_PART_2NxnU;
u8 local_PART_2NxnD;
u8 local_PART_nLx2N;
u8 local_PART_nRx2N;
u8 local_predMode;
u32 local_colIndex;
u16 tmp_colTileInPix;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_pu_PbW;
u8 local_pu_PbH;
local_cu_nCbS = cu_nCbS;
nCbS_2 = local_cu_nCbS >> 1;
local_cu_nCbS = cu_nCbS;
nCbS_4 = local_cu_nCbS >> 2;
local_cu_nCbS = cu_nCbS;
nCbS_3_4 = local_cu_nCbS - nCbS_4;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
x0 = ctStack[local_ctStack_idx][local_CT_x0];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
y0 = ctStack[local_ctStack_idx][local_CT_y0];
pu_idx = 1;
local_cu_nCbS = cu_nCbS;
pu_PbW = local_cu_nCbS;
local_cu_nCbS = cu_nCbS;
pu_PbH = local_cu_nCbS;
local_partMode = partMode;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
if (local_partMode == local_PART_2Nx2N) {
cu_idx = 8;
} else {
local_partMode = partMode;
local_PART_2NxN = HevcDecoder_Algo_Parser_PART_2NxN;
if (local_partMode == local_PART_2NxN) {
pu_PbH = nCbS_2;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
cu_idx = 8;
y0 = y0 + nCbS_2;
}
} else {
local_partMode = partMode;
local_PART_Nx2N = HevcDecoder_Algo_Parser_PART_Nx2N;
if (local_partMode == local_PART_Nx2N) {
pu_PbW = nCbS_2;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
cu_idx = 8;
x0 = x0 + nCbS_2;
}
} else {
local_partMode = partMode;
local_PART_2NxnU = HevcDecoder_Algo_Parser_PART_2NxnU;
if (local_partMode == local_PART_2NxnU) {
pu_PbH = nCbS_4;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
pu_PbH = nCbS_3_4;
cu_idx = 8;
y0 = y0 + nCbS_4;
}
} else {
local_partMode = partMode;
local_PART_2NxnD = HevcDecoder_Algo_Parser_PART_2NxnD;
if (local_partMode == local_PART_2NxnD) {
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
pu_PbH = nCbS_3_4;
cu_idx = 5;
} else {
pu_PbH = nCbS_4;
cu_idx = 8;
y0 = y0 + nCbS_3_4;
}
} else {
local_partMode = partMode;
local_PART_nLx2N = HevcDecoder_Algo_Parser_PART_nLx2N;
if (local_partMode == local_PART_nLx2N) {
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
pu_PbW = nCbS_4;
cu_idx = 5;
} else {
pu_PbW = nCbS_3_4;
x0 = x0 + nCbS_4;
cu_idx = 8;
}
} else {
local_partMode = partMode;
local_PART_nRx2N = HevcDecoder_Algo_Parser_PART_nRx2N;
if (local_partMode == local_PART_nRx2N) {
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
pu_PbW = nCbS_3_4;
cu_idx = 5;
} else {
pu_PbW = nCbS_4;
x0 = x0 + nCbS_3_4;
cu_idx = 8;
}
} else {
pu_PbW = nCbS_2;
pu_PbH = nCbS_2;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
local_cu_idx = cu_idx;
if (local_cu_idx == 5) {
x0 = x0 + nCbS_2;
cu_idx = 6;
} else {
local_cu_idx = cu_idx;
if (local_cu_idx == 6) {
y0 = y0 + nCbS_2;
cu_idx = 7;
} else {
x0 = x0 + nCbS_2;
y0 = y0 + nCbS_2;
cu_idx = 8;
}
}
}
}
}
}
}
}
}
}
local_predMode = predMode;
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_pu_PbW = pu_PbW;
local_pu_PbH = pu_PbH;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo + (0)) % SIZE_CUInfo] = local_predMode;
tokens_CUInfo[(index_CUInfo + (1)) % SIZE_CUInfo] = x0;
tokens_CUInfo[(index_CUInfo + (2)) % SIZE_CUInfo] = y0;
local_pu_PbW = pu_PbW;
tokens_CUInfo[(index_CUInfo + (3)) % SIZE_CUInfo] = local_pu_PbW;
local_pu_PbH = pu_PbH;
tokens_CUInfo[(index_CUInfo + (4)) % SIZE_CUInfo] = local_pu_PbH;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
}
static void read_CodingUnit_gotoPredictionUnit_goto2_aligned() {
u8 local_cu_nCbS;
u8 nCbS_2;
u8 nCbS_4;
u8 nCbS_3_4;
u8 local_ctStack_idx;
u16 local_CT_x0;
i32 x0;
u16 local_CT_y0;
i32 y0;
u8 local_partMode;
u8 local_PART_2Nx2N;
u8 local_PART_2NxN;
u8 local_cu_idx;
u8 local_PART_Nx2N;
u8 local_PART_2NxnU;
u8 local_PART_2NxnD;
u8 local_PART_nLx2N;
u8 local_PART_nRx2N;
u8 local_predMode;
u32 local_colIndex;
u16 tmp_colTileInPix;
u32 local_rowIndex;
u16 tmp_rowTileInPix;
u8 local_pu_PbW;
u8 local_pu_PbH;
local_cu_nCbS = cu_nCbS;
nCbS_2 = local_cu_nCbS >> 1;
local_cu_nCbS = cu_nCbS;
nCbS_4 = local_cu_nCbS >> 2;
local_cu_nCbS = cu_nCbS;
nCbS_3_4 = local_cu_nCbS - nCbS_4;
local_ctStack_idx = ctStack_idx;
local_CT_x0 = HevcDecoder_Algo_Parser_CT_x0;
x0 = ctStack[local_ctStack_idx][local_CT_x0];
local_ctStack_idx = ctStack_idx;
local_CT_y0 = HevcDecoder_Algo_Parser_CT_y0;
y0 = ctStack[local_ctStack_idx][local_CT_y0];
pu_idx = 1;
local_cu_nCbS = cu_nCbS;
pu_PbW = local_cu_nCbS;
local_cu_nCbS = cu_nCbS;
pu_PbH = local_cu_nCbS;
local_partMode = partMode;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
if (local_partMode == local_PART_2Nx2N) {
cu_idx = 8;
} else {
local_partMode = partMode;
local_PART_2NxN = HevcDecoder_Algo_Parser_PART_2NxN;
if (local_partMode == local_PART_2NxN) {
pu_PbH = nCbS_2;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
cu_idx = 8;
y0 = y0 + nCbS_2;
}
} else {
local_partMode = partMode;
local_PART_Nx2N = HevcDecoder_Algo_Parser_PART_Nx2N;
if (local_partMode == local_PART_Nx2N) {
pu_PbW = nCbS_2;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
cu_idx = 8;
x0 = x0 + nCbS_2;
}
} else {
local_partMode = partMode;
local_PART_2NxnU = HevcDecoder_Algo_Parser_PART_2NxnU;
if (local_partMode == local_PART_2NxnU) {
pu_PbH = nCbS_4;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
pu_PbH = nCbS_3_4;
cu_idx = 8;
y0 = y0 + nCbS_4;
}
} else {
local_partMode = partMode;
local_PART_2NxnD = HevcDecoder_Algo_Parser_PART_2NxnD;
if (local_partMode == local_PART_2NxnD) {
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
pu_PbH = nCbS_3_4;
cu_idx = 5;
} else {
pu_PbH = nCbS_4;
cu_idx = 8;
y0 = y0 + nCbS_3_4;
}
} else {
local_partMode = partMode;
local_PART_nLx2N = HevcDecoder_Algo_Parser_PART_nLx2N;
if (local_partMode == local_PART_nLx2N) {
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
pu_PbW = nCbS_4;
cu_idx = 5;
} else {
pu_PbW = nCbS_3_4;
x0 = x0 + nCbS_4;
cu_idx = 8;
}
} else {
local_partMode = partMode;
local_PART_nRx2N = HevcDecoder_Algo_Parser_PART_nRx2N;
if (local_partMode == local_PART_nRx2N) {
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
pu_PbW = nCbS_3_4;
cu_idx = 5;
} else {
pu_PbW = nCbS_4;
x0 = x0 + nCbS_3_4;
cu_idx = 8;
}
} else {
pu_PbW = nCbS_2;
pu_PbH = nCbS_2;
local_cu_idx = cu_idx;
if (local_cu_idx == 4) {
cu_idx = 5;
} else {
local_cu_idx = cu_idx;
if (local_cu_idx == 5) {
x0 = x0 + nCbS_2;
cu_idx = 6;
} else {
local_cu_idx = cu_idx;
if (local_cu_idx == 6) {
y0 = y0 + nCbS_2;
cu_idx = 7;
} else {
x0 = x0 + nCbS_2;
y0 = y0 + nCbS_2;
cu_idx = 8;
}
}
}
}
}
}
}
}
}
}
local_predMode = predMode;
local_colIndex = colIndex;
tmp_colTileInPix = colTileInPix[local_colIndex];
local_rowIndex = rowIndex;
tmp_rowTileInPix = rowTileInPix[local_rowIndex];
local_pu_PbW = pu_PbW;
local_pu_PbH = pu_PbH;
local_predMode = predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (0)] = local_predMode;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (1)] = x0;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (2)] = y0;
local_pu_PbW = pu_PbW;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (3)] = local_pu_PbW;
local_pu_PbH = pu_PbH;
tokens_CUInfo[(index_CUInfo % SIZE_CUInfo) + (4)] = local_pu_PbH;
// Update ports indexes
index_CUInfo += 5;
write_end_CUInfo();
}
static i32 isSchedulable_read_CodingUnit_endFunction() {
i32 result;
u8 local_cu_idx;
i32 tmp_isFifoFull;
local_cu_idx = cu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_cu_idx == 8 && tmp_isFifoFull;
return result;
}
static void read_CodingUnit_endFunction() {
u32 res[1];
u8 local_pcm_flag;
u8 local_predMode;
u8 local_INTRA;
u8 local_partMode;
u8 local_PART_2Nx2N;
u8 local_merge_flag;
u32 tmp_res;
u16 local_sps_id;
u8 tmp_sps_max_transform_hierarchy_depth_intra;
u8 local_IntraSplitFlag;
u8 tmp_sps_max_transform_hierarchy_depth_inter;
res[0] = 1;
cu_idx = 10;
local_pcm_flag = pcm_flag;
if (local_pcm_flag == 0) {
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
local_partMode = partMode;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
local_merge_flag = merge_flag;
if (local_predMode != local_INTRA && !(local_partMode == local_PART_2Nx2N && local_merge_flag == 1)) {
HevcDecoder_Algo_Parser_get_NO_RESIDUAL_SYNTAX_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
}
tmp_res = res[0];
if (tmp_res != 0) {
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (local_predMode == local_INTRA) {
local_sps_id = sps_id;
tmp_sps_max_transform_hierarchy_depth_intra = sps_max_transform_hierarchy_depth_intra[local_sps_id];
local_IntraSplitFlag = IntraSplitFlag;
MaxTrafoDepth = tmp_sps_max_transform_hierarchy_depth_intra + local_IntraSplitFlag;
} else {
local_sps_id = sps_id;
tmp_sps_max_transform_hierarchy_depth_inter = sps_max_transform_hierarchy_depth_inter[local_sps_id];
MaxTrafoDepth = tmp_sps_max_transform_hierarchy_depth_inter;
}
cu_idx = 9;
} else {
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (local_predMode != local_INTRA) {
cu_idx = 11;
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_CodingUnit_endFunctionSend() {
i32 result;
u8 local_cu_idx;
local_cu_idx = cu_idx;
result = local_cu_idx == 11;
return result;
}
static void read_CodingUnit_endFunctionSend() {
u8 local_cu_log2CbSize;
i8 local_slice_qp;
u8 local_TEXT_LUMA;
u8 local_TEXT_CHROMA_U;
u8 local_TEXT_CHROMA_V;
cu_idx = 10;
tokens_SplitTransform[(index_SplitTransform + (0)) % SIZE_SplitTransform] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize + (0)) % SIZE_TUSize] = 1 << local_cu_log2CbSize;
tokens_TUSize[(index_TUSize + (1)) % SIZE_TUSize] = 1;
tokens_TUSize[(index_TUSize + (2)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (3)) % SIZE_TUSize] = 0;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize + (4)) % SIZE_TUSize] = local_slice_qp;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
tokens_TUSize[(index_TUSize + (5)) % SIZE_TUSize] = local_TEXT_LUMA;
tokens_TUSize[(index_TUSize + (6)) % SIZE_TUSize] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize + (7)) % SIZE_TUSize] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize + (8)) % SIZE_TUSize] = 1;
tokens_TUSize[(index_TUSize + (9)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (10)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (11)) % SIZE_TUSize] = 0;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize + (12)) % SIZE_TUSize] = local_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize + (13)) % SIZE_TUSize] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize + (14)) % SIZE_TUSize] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize + (15)) % SIZE_TUSize] = 1;
tokens_TUSize[(index_TUSize + (16)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (17)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (18)) % SIZE_TUSize] = 0;
local_TEXT_CHROMA_V = HevcDecoder_Algo_Parser_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize + (19)) % SIZE_TUSize] = local_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize + (20)) % SIZE_TUSize] = 0;
tokens_Cbf[(index_Cbf + (0)) % SIZE_Cbf] = 0;
// Update ports indexes
index_SplitTransform += 1;
index_TUSize += 21;
write_end_TUSize();
index_Cbf += 1;
}
static void read_CodingUnit_endFunctionSend_aligned() {
u8 local_cu_log2CbSize;
i8 local_slice_qp;
u8 local_TEXT_LUMA;
u8 local_TEXT_CHROMA_U;
u8 local_TEXT_CHROMA_V;
cu_idx = 10;
tokens_SplitTransform[(index_SplitTransform + (0)) % SIZE_SplitTransform] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (0)] = 1 << local_cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (1)] = 1;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (2)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (3)] = 0;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (4)] = local_slice_qp;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (5)] = local_TEXT_LUMA;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (6)] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (7)] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (8)] = 1;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (9)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (10)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (11)] = 0;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (12)] = local_TEXT_CHROMA_U;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (13)] = 0;
local_cu_log2CbSize = cu_log2CbSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (14)] = 1 << (local_cu_log2CbSize - 1);
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (15)] = 1;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (16)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (17)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (18)] = 0;
local_TEXT_CHROMA_V = HevcDecoder_Algo_Parser_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (19)] = local_TEXT_CHROMA_V;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (20)] = 0;
tokens_Cbf[(index_Cbf + (0)) % SIZE_Cbf] = 0;
// Update ports indexes
index_SplitTransform += 1;
index_TUSize += 21;
write_end_TUSize();
index_Cbf += 1;
}
static i32 isSchedulable_read_CodingUnit_gotoTransformTree() {
i32 result;
u8 local_cu_idx;
local_cu_idx = cu_idx;
result = local_cu_idx == 9;
return result;
}
static void read_CodingUnit_gotoTransformTree() {
u8 local_TT_idx;
u16 local_TT_x0;
u16 local_cu_x0;
u16 local_TT_y0;
u16 local_cu_y0;
u16 local_TT_xBase;
u16 local_TT_yBase;
u8 local_TT_log2TrafoSize;
u8 local_cu_log2CbSize;
u8 local_TT_trafoDepth;
u8 local_TT_blkIdx;
cu_idx = 10;
ttStack_idx = 0;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
ttStack[0][local_TT_idx] = 1;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
local_cu_x0 = cu_x0;
ttStack[0][local_TT_x0] = local_cu_x0;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
local_cu_y0 = cu_y0;
ttStack[0][local_TT_y0] = local_cu_y0;
local_TT_xBase = HevcDecoder_Algo_Parser_TT_xBase;
local_cu_x0 = cu_x0;
ttStack[0][local_TT_xBase] = local_cu_x0;
local_TT_yBase = HevcDecoder_Algo_Parser_TT_yBase;
local_cu_y0 = cu_y0;
ttStack[0][local_TT_yBase] = local_cu_y0;
local_TT_log2TrafoSize = HevcDecoder_Algo_Parser_TT_log2TrafoSize;
local_cu_log2CbSize = cu_log2CbSize;
ttStack[0][local_TT_log2TrafoSize] = local_cu_log2CbSize;
local_TT_trafoDepth = HevcDecoder_Algo_Parser_TT_trafoDepth;
ttStack[0][local_TT_trafoDepth] = 0;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
ttStack[0][local_TT_blkIdx] = 0;
// Update ports indexes
}
static i32 isSchedulable_read_CodingUnit_end() {
i32 result;
u8 local_cu_idx;
local_cu_idx = cu_idx;
result = local_cu_idx == 10;
return result;
}
static void read_CodingUnit_end() {
u16 local_cu_x0;
u8 local_Log2MinCbSize;
u16 ct_x_cb;
u16 local_cu_y0;
u16 ct_y_cb;
i32 x;
u8 local_cu_log2CbSize;
u16 local_pps_id;
u8 tmp_pps_cu_qp_delta_enabled_flag;
u8 local_IsCuQpDeltaCoded;
i32 local_min_cb_width;
i32 y;
u8 local_length;
i32 i;
i8 local_qp_y;
i32 local_qp_block_mask;
u32 i0;
u8 local_cu_ctDepth;
local_cu_x0 = cu_x0;
local_Log2MinCbSize = Log2MinCbSize;
ct_x_cb = local_cu_x0 >> local_Log2MinCbSize;
local_cu_y0 = cu_y0;
local_Log2MinCbSize = Log2MinCbSize;
ct_y_cb = local_cu_y0 >> local_Log2MinCbSize;
x = 0;
local_cu_log2CbSize = cu_log2CbSize;
local_Log2MinCbSize = Log2MinCbSize;
length = (1 << local_cu_log2CbSize) >> local_Log2MinCbSize;
local_pps_id = pps_id;
tmp_pps_cu_qp_delta_enabled_flag = pps_cu_qp_delta_enabled_flag[local_pps_id];
local_IsCuQpDeltaCoded = IsCuQpDeltaCoded;
if (tmp_pps_cu_qp_delta_enabled_flag != 0 && local_IsCuQpDeltaCoded == 0) {
set_qPy();
}
local_min_cb_width = min_cb_width;
x = ct_y_cb * local_min_cb_width + ct_x_cb;
y = 0;
local_length = length;
while (y <= local_length - 1) {
i = 0;
local_length = length;
while (i <= local_length - 1) {
local_qp_y = qp_y;
qp_y_tab[x + i] = local_qp_y;
i = i + 1;
}
local_min_cb_width = min_cb_width;
x = x + local_min_cb_width;
y = y + 1;
}
local_cu_x0 = cu_x0;
local_cu_log2CbSize = cu_log2CbSize;
local_qp_block_mask = qp_block_mask;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
local_qp_block_mask = qp_block_mask;
if ((local_cu_x0 + (1 << local_cu_log2CbSize) & local_qp_block_mask) == 0 && (local_cu_y0 + (1 << local_cu_log2CbSize) & local_qp_block_mask) == 0) {
local_qp_y = qp_y;
qPy_pred = local_qp_y;
}
i0 = 0;
local_length = length;
while (i0 <= local_length - 1) {
local_cu_ctDepth = cu_ctDepth;
cu_top_ctDepth[ct_x_cb + i0] = local_cu_ctDepth;
local_cu_ctDepth = cu_ctDepth;
cu_left_ctDepth[ct_y_cb + i0] = local_cu_ctDepth;
i0 = i0 + 1;
}
// Update ports indexes
}
static i32 isSchedulable_read_CodingUnit_end_sendQp_blk4x4() {
i32 result;
u8 local_length;
local_length = length;
result = local_length == 0;
return result;
}
static void read_CodingUnit_end_sendQp_blk4x4() {
i8 local_qp_y;
local_qp_y = qp_y;
tokens_Qp[(index_Qp + (0)) % SIZE_Qp] = local_qp_y;
// Update ports indexes
index_Qp += 1;
}
static i32 isSchedulable_read_CodingUnit_end_sendQp_blk8x8() {
i32 result;
u8 local_length;
local_length = length;
result = local_length == 1;
return result;
}
static void read_CodingUnit_end_sendQp_blk8x8() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 3) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp + (k)) % SIZE_Qp] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 4;
write_end_Qp();
}
static void read_CodingUnit_end_sendQp_blk8x8_aligned() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 3) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp % SIZE_Qp) + (k)] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 4;
write_end_Qp();
}
static i32 isSchedulable_read_CodingUnit_end_sendQp_blk16x16() {
i32 result;
u8 local_length;
local_length = length;
result = local_length == 2;
return result;
}
static void read_CodingUnit_end_sendQp_blk16x16() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 15) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp + (k)) % SIZE_Qp] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 16;
write_end_Qp();
}
static void read_CodingUnit_end_sendQp_blk16x16_aligned() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 15) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp % SIZE_Qp) + (k)] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 16;
write_end_Qp();
}
static i32 isSchedulable_read_CodingUnit_end_sendQp_blk32x32() {
i32 result;
u8 local_length;
local_length = length;
result = local_length == 4;
return result;
}
static void read_CodingUnit_end_sendQp_blk32x32() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 63) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp + (k)) % SIZE_Qp] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 64;
write_end_Qp();
}
static void read_CodingUnit_end_sendQp_blk32x32_aligned() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 63) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp % SIZE_Qp) + (k)] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 64;
write_end_Qp();
}
static i32 isSchedulable_read_CodingUnit_end_sendQp_blk64x64() {
i32 result;
u8 local_length;
local_length = length;
result = local_length == 8;
return result;
}
static void read_CodingUnit_end_sendQp_blk64x64() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 255) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp + (k)) % SIZE_Qp] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 256;
write_end_Qp();
}
static void read_CodingUnit_end_sendQp_blk64x64_aligned() {
i32 k;
i8 local_qp_y;
k = 0;
while (k <= 255) {
local_qp_y = qp_y;
tokens_Qp[(index_Qp % SIZE_Qp) + (k)] = local_qp_y;
k = k + 1;
}
// Update ports indexes
index_Qp += 256;
write_end_Qp();
}
static i32 isSchedulable_read_PredictionUnit_start() {
i32 result;
i32 tmp_isFifoFull;
u8 local_pu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_pu_idx = pu_idx;
result = tmp_isFifoFull && local_pu_idx == 1;
return result;
}
static void read_PredictionUnit_start() {
u32 res[1];
u8 local_PRED_L0;
u8 local_skip_flag;
u16 local_MaxNumMergeCand;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u32 tmp_res2;
u8 local_slice_type;
u8 local_B_SLICE;
u8 local_partMode;
u8 local_pu_PbW;
u8 local_pu_PbH;
u8 local_cu_ctDepth;
u32 tmp_res3;
u8 local_inter_pred_idc;
u8 local_PRED_L1;
u8 local_num_ref_idx_l0_active;
u32 tmp_res4;
local_PRED_L0 = HevcDecoder_Algo_Parser_PRED_L0;
inter_pred_idc = local_PRED_L0;
mergeIdx = -1;
mvp_lx[0] = -1;
mvp_lx[1] = -1;
ref_idx_lx[0] = -1;
ref_idx_lx[1] = -1;
mvd[0] = 0;
mvd[1] = 0;
mvd[2] = 0;
mvd[3] = 0;
mvd_x = 0;
mvd_y = 0;
local_skip_flag = skip_flag;
if (local_skip_flag == 1) {
local_MaxNumMergeCand = MaxNumMergeCand;
if (local_MaxNumMergeCand > 1) {
local_MaxNumMergeCand = MaxNumMergeCand;
HevcDecoder_Algo_Parser_get_MERGE_IDX(codIRange, codIOffset, ctxTable, fifo, res, local_MaxNumMergeCand);
tmp_res = res[0];
mergeIdx = tmp_res;
} else {
mergeIdx = 0;
}
pu_idx = 7;
} else {
HevcDecoder_Algo_Parser_get_MERGE_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res0 = res[0];
merge_flag = tmp_res0;
tmp_res1 = res[0];
if (tmp_res1 == 1) {
local_MaxNumMergeCand = MaxNumMergeCand;
if (local_MaxNumMergeCand > 1) {
local_MaxNumMergeCand = MaxNumMergeCand;
HevcDecoder_Algo_Parser_get_MERGE_IDX(codIRange, codIOffset, ctxTable, fifo, res, local_MaxNumMergeCand);
tmp_res2 = res[0];
mergeIdx = tmp_res2;
} else {
mergeIdx = 0;
}
pu_idx = 7;
} else {
local_slice_type = slice_type;
local_B_SLICE = HevcDecoder_Algo_Parser_B_SLICE;
if (local_slice_type == local_B_SLICE) {
local_partMode = partMode;
local_pu_PbW = pu_PbW;
local_pu_PbH = pu_PbH;
local_cu_ctDepth = cu_ctDepth;
HevcDecoder_Algo_Parser_get_INTER_PRED_IDC(codIRange, codIOffset, ctxTable, fifo, res, local_partMode, local_pu_PbW, local_pu_PbH, local_cu_ctDepth);
tmp_res3 = res[0];
inter_pred_idc = tmp_res3;
}
local_inter_pred_idc = inter_pred_idc;
local_PRED_L1 = HevcDecoder_Algo_Parser_PRED_L1;
if (local_inter_pred_idc != local_PRED_L1) {
ref_idx_lx[0] = 0;
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
if (local_num_ref_idx_l0_active > 1) {
local_num_ref_idx_l0_active = num_ref_idx_l0_active;
HevcDecoder_Algo_Parser_get_REF_IDX_LX(codIRange, codIOffset, ctxTable, fifo, res, local_num_ref_idx_l0_active - 1);
tmp_res4 = res[0];
ref_idx_lx[0] = tmp_res4;
}
pu_idx = 3;
} else {
pu_idx = 4;
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_PredictionUnit_retMVDcoding_goto1() {
i32 result;
u8 local_pu_idx;
i32 tmp_isFifoFull;
local_pu_idx = pu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_pu_idx == 4 && tmp_isFifoFull;
return result;
}
static void read_PredictionUnit_retMVDcoding_goto1() {
u32 res[1];
i32 local_mvd_x;
i32 local_mvd_y;
u8 local_inter_pred_idc;
u8 local_PRED_L1;
u32 tmp_res;
u8 local_PRED_L0;
u8 local_num_ref_idx_l1_active;
u32 tmp_res0;
u8 local_mvd_l1_zero_flag;
u8 local_BI_PRED;
local_mvd_x = mvd_x;
mvd[0] = local_mvd_x;
local_mvd_y = mvd_y;
mvd[1] = local_mvd_y;
mvd_x = 0;
mvd_y = 0;
local_inter_pred_idc = inter_pred_idc;
local_PRED_L1 = HevcDecoder_Algo_Parser_PRED_L1;
if (local_inter_pred_idc != local_PRED_L1) {
HevcDecoder_Algo_Parser_get_MVP_LX_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
mvp_lx[0] = tmp_res;
}
pu_idx = 7;
local_inter_pred_idc = inter_pred_idc;
local_PRED_L0 = HevcDecoder_Algo_Parser_PRED_L0;
if (local_inter_pred_idc != local_PRED_L0) {
ref_idx_lx[1] = 0;
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
if (local_num_ref_idx_l1_active > 1) {
local_num_ref_idx_l1_active = num_ref_idx_l1_active;
HevcDecoder_Algo_Parser_get_REF_IDX_LX(codIRange, codIOffset, ctxTable, fifo, res, local_num_ref_idx_l1_active - 1);
tmp_res0 = res[0];
ref_idx_lx[1] = tmp_res0;
}
local_mvd_l1_zero_flag = mvd_l1_zero_flag;
local_inter_pred_idc = inter_pred_idc;
local_BI_PRED = HevcDecoder_Algo_Parser_BI_PRED;
if (local_mvd_l1_zero_flag == 1 && local_inter_pred_idc == local_BI_PRED) {
pu_idx = 6;
} else {
pu_idx = 5;
}
}
// Update ports indexes
}
static i32 isSchedulable_read_PredictionUnit_gotoMVDCoding() {
i32 result;
u8 local_pu_idx;
local_pu_idx = pu_idx;
local_pu_idx = pu_idx;
result = local_pu_idx == 3 || local_pu_idx == 5;
return result;
}
static void read_PredictionUnit_gotoMVDCoding() {
u8 local_pu_idx;
local_pu_idx = pu_idx;
pu_idx = local_pu_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_PredictionUnit_retMVDcoding_goto2() {
i32 result;
u8 local_pu_idx;
i32 tmp_isFifoFull;
local_pu_idx = pu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_pu_idx == 6 && tmp_isFifoFull;
return result;
}
static void read_PredictionUnit_retMVDcoding_goto2() {
u32 res[1];
i32 local_mvd_x;
i32 local_mvd_y;
u32 tmp_res;
local_mvd_x = mvd_x;
mvd[2] = local_mvd_x;
local_mvd_y = mvd_y;
mvd[3] = local_mvd_y;
HevcDecoder_Algo_Parser_get_MVP_LX_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
mvp_lx[1] = tmp_res;
pu_idx = 7;
// Update ports indexes
}
static i32 isSchedulable_read_PredictionUnit_end_mergeIdx_Eq_min1() {
i32 result;
u8 local_pu_idx;
i16 local_mergeIdx;
local_pu_idx = pu_idx;
local_mergeIdx = mergeIdx;
result = local_pu_idx == 7 && local_mergeIdx == -1;
return result;
}
static void read_PredictionUnit_end_mergeIdx_Eq_min1() {
i16 local_mergeIdx;
i16 tmp_mvp_lx;
i16 tmp_mvp_lx0;
i16 tmp_ref_idx_lx;
i16 tmp_ref_idx_lx0;
i16 tmp_mvd;
i16 tmp_mvd0;
i16 tmp_mvd1;
i16 tmp_mvd2;
local_mergeIdx = mergeIdx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (0)) % SIZE_MvPredSyntaxElem] = local_mergeIdx;
tmp_mvp_lx = mvp_lx[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (1)) % SIZE_MvPredSyntaxElem] = tmp_mvp_lx;
tmp_mvp_lx0 = mvp_lx[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (2)) % SIZE_MvPredSyntaxElem] = tmp_mvp_lx0;
tmp_ref_idx_lx = ref_idx_lx[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (3)) % SIZE_MvPredSyntaxElem] = tmp_ref_idx_lx;
tmp_ref_idx_lx0 = ref_idx_lx[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (4)) % SIZE_MvPredSyntaxElem] = tmp_ref_idx_lx0;
tmp_mvd = mvd[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (5)) % SIZE_MvPredSyntaxElem] = tmp_mvd;
tmp_mvd0 = mvd[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (6)) % SIZE_MvPredSyntaxElem] = tmp_mvd0;
tmp_mvd1 = mvd[2];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (7)) % SIZE_MvPredSyntaxElem] = tmp_mvd1;
tmp_mvd2 = mvd[3];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (8)) % SIZE_MvPredSyntaxElem] = tmp_mvd2;
// Update ports indexes
index_MvPredSyntaxElem += 9;
write_end_MvPredSyntaxElem();
}
static void read_PredictionUnit_end_mergeIdx_Eq_min1_aligned() {
i16 local_mergeIdx;
i16 tmp_mvp_lx;
i16 tmp_mvp_lx0;
i16 tmp_ref_idx_lx;
i16 tmp_ref_idx_lx0;
i16 tmp_mvd;
i16 tmp_mvd0;
i16 tmp_mvd1;
i16 tmp_mvd2;
local_mergeIdx = mergeIdx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (0)] = local_mergeIdx;
tmp_mvp_lx = mvp_lx[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (1)] = tmp_mvp_lx;
tmp_mvp_lx0 = mvp_lx[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (2)] = tmp_mvp_lx0;
tmp_ref_idx_lx = ref_idx_lx[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (3)] = tmp_ref_idx_lx;
tmp_ref_idx_lx0 = ref_idx_lx[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (4)] = tmp_ref_idx_lx0;
tmp_mvd = mvd[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (5)] = tmp_mvd;
tmp_mvd0 = mvd[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (6)] = tmp_mvd0;
tmp_mvd1 = mvd[2];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (7)] = tmp_mvd1;
tmp_mvd2 = mvd[3];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (8)] = tmp_mvd2;
// Update ports indexes
index_MvPredSyntaxElem += 9;
write_end_MvPredSyntaxElem();
}
static i32 isSchedulable_read_PredictionUnit_end_mergeIdx_notEq_min1() {
i32 result;
u8 local_pu_idx;
i16 local_mergeIdx;
local_pu_idx = pu_idx;
local_mergeIdx = mergeIdx;
result = local_pu_idx == 7 && local_mergeIdx != -1;
return result;
}
static void read_PredictionUnit_end_mergeIdx_notEq_min1() {
i16 local_mergeIdx;
i16 tmp_mvd;
i16 tmp_mvd0;
i16 tmp_mvd1;
i16 tmp_mvd2;
local_mergeIdx = mergeIdx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (0)) % SIZE_MvPredSyntaxElem] = local_mergeIdx;
tmp_mvd = mvd[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (1)) % SIZE_MvPredSyntaxElem] = tmp_mvd;
tmp_mvd0 = mvd[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (2)) % SIZE_MvPredSyntaxElem] = tmp_mvd0;
tmp_mvd1 = mvd[2];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (3)) % SIZE_MvPredSyntaxElem] = tmp_mvd1;
tmp_mvd2 = mvd[3];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem + (4)) % SIZE_MvPredSyntaxElem] = tmp_mvd2;
// Update ports indexes
index_MvPredSyntaxElem += 5;
write_end_MvPredSyntaxElem();
}
static void read_PredictionUnit_end_mergeIdx_notEq_min1_aligned() {
i16 local_mergeIdx;
i16 tmp_mvd;
i16 tmp_mvd0;
i16 tmp_mvd1;
i16 tmp_mvd2;
local_mergeIdx = mergeIdx;
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (0)] = local_mergeIdx;
tmp_mvd = mvd[0];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (1)] = tmp_mvd;
tmp_mvd0 = mvd[1];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (2)] = tmp_mvd0;
tmp_mvd1 = mvd[2];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (3)] = tmp_mvd1;
tmp_mvd2 = mvd[3];
tokens_MvPredSyntaxElem[(index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) + (4)] = tmp_mvd2;
// Update ports indexes
index_MvPredSyntaxElem += 5;
write_end_MvPredSyntaxElem();
}
static i32 isSchedulable_read_MVDCoding_start() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_MVDCoding_start() {
u32 res[1];
u8 abs_mvd_greater0_flag_0;
u8 abs_mvd_greater1_flag_0;
i16 abs_mvd_minus2_0;
u8 mvd_sign_flag_0;
u32 tmp_res;
u8 local_abs_mvd_greater0_flag_1;
u32 tmp_res0;
abs_mvd_minus2_0 = 0;
mvd_sign_flag_0 = 0;
HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER0_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
abs_mvd_greater0_flag_0 = res[0];
HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER0_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
abs_mvd_greater0_flag_1 = tmp_res;
if (abs_mvd_greater0_flag_0 == 1) {
HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER1_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
abs_mvd_greater1_flag_0 = res[0];
}
local_abs_mvd_greater0_flag_1 = abs_mvd_greater0_flag_1;
if (local_abs_mvd_greater0_flag_1 == 1) {
HevcDecoder_Algo_Parser_get_ABS_MVD_GREATER1_FLAG(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res0 = res[0];
abs_mvd_greater1_flag_1 = tmp_res0;
}
if (abs_mvd_greater0_flag_0 == 1) {
abs_mvd_minus2_0 = -1;
if (abs_mvd_greater1_flag_0 == 1) {
HevcDecoder_Algo_Parser_get_ABS_MVD_MINUS2(codIRange, codIOffset, fifo, res);
abs_mvd_minus2_0 = res[0];
}
HevcDecoder_Algo_Parser_get_MVD_SIGN_FLAG(codIRange, codIOffset, fifo, res);
mvd_sign_flag_0 = res[0];
}
mvd_x = abs_mvd_greater0_flag_0 * (abs_mvd_minus2_0 + 2) * (1 - (mvd_sign_flag_0 << 1));
// Update ports indexes
}
static i32 isSchedulable_read_MVDCoding_ended() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_MVDCoding_ended() {
u32 res[1];
i16 abs_mvd_minus2_1;
u8 mvd_sign_flag_1;
u8 local_abs_mvd_greater0_flag_1;
u8 local_abs_mvd_greater1_flag_1;
abs_mvd_minus2_1 = 0;
mvd_sign_flag_1 = 0;
local_abs_mvd_greater0_flag_1 = abs_mvd_greater0_flag_1;
if (local_abs_mvd_greater0_flag_1 == 1) {
abs_mvd_minus2_1 = -1;
local_abs_mvd_greater1_flag_1 = abs_mvd_greater1_flag_1;
if (local_abs_mvd_greater1_flag_1 == 1) {
HevcDecoder_Algo_Parser_get_ABS_MVD_MINUS2(codIRange, codIOffset, fifo, res);
abs_mvd_minus2_1 = res[0];
}
HevcDecoder_Algo_Parser_get_MVD_SIGN_FLAG(codIRange, codIOffset, fifo, res);
mvd_sign_flag_1 = res[0];
}
local_abs_mvd_greater0_flag_1 = abs_mvd_greater0_flag_1;
mvd_y = local_abs_mvd_greater0_flag_1 * (abs_mvd_minus2_1 + 2) * (1 - (mvd_sign_flag_1 << 1));
// Update ports indexes
}
static i32 isSchedulable_read_PCMSample_start() {
i32 result;
result = 1;
return result;
}
static void read_PCMSample_start() {
u8 local_cu_log2CbSize;
i32 cb_size;
i32 length;
i32 local_DEBUG_CABAC;
u16 local_sps_id;
u32 tmp_pcm_bit_depth;
u32 tmp_pcm_bit_depth_chroma;
local_cu_log2CbSize = cu_log2CbSize;
cb_size = 1 << local_cu_log2CbSize;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_PCMSample\n");
}
local_sps_id = sps_id;
tmp_pcm_bit_depth = pcm_bit_depth[local_sps_id];
local_sps_id = sps_id;
tmp_pcm_bit_depth_chroma = pcm_bit_depth_chroma[local_sps_id];
length = cb_size * cb_size * tmp_pcm_bit_depth + ((cb_size * cb_size) >> 1) * tmp_pcm_bit_depth_chroma;
pcm_skip_length = (length + 7) >> 3;
cnt_i = 0;
// Update ports indexes
}
static i32 isSchedulable_read_PCMSample_skipLoop() {
i32 result;
u32 local_cnt_i;
i32 local_pcm_skip_length;
i32 tmp_isFifoFull;
local_cnt_i = cnt_i;
local_pcm_skip_length = pcm_skip_length;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_cnt_i < local_pcm_skip_length && tmp_isFifoFull;
return result;
}
static void read_PCMSample_skipLoop() {
u32 local_cnt_i;
HevcDecoder_Algo_Parser_flushBits(8, fifo);
local_cnt_i = cnt_i;
cnt_i = local_cnt_i + 1;
// Update ports indexes
}
static i32 isSchedulable_read_PCMSample_skipLoop_end() {
i32 result;
u32 local_cnt_i;
i32 local_pcm_skip_length;
i32 tmp_isFifoFull;
local_cnt_i = cnt_i;
local_pcm_skip_length = pcm_skip_length;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = local_cnt_i == local_pcm_skip_length && tmp_isFifoFull;
return result;
}
static void read_PCMSample_skipLoop_end() {
i32 i;
u8 local_cu_log2CbSize;
u16 local_sps_id;
u32 tmp_pcm_bit_depth;
i32 i0;
u32 tmp_pcm_bit_depth_chroma;
u32 tmp_pcm_loop_filter_disable_flag;
u16 local_cu_x0;
u16 local_cu_y0;
cnt_i = 0;
HevcDecoder_Algo_Parser_decodeReInit(codIRange, codIOffset, fifo);
i = 0;
local_cu_log2CbSize = cu_log2CbSize;
while (i <= 1 << local_cu_log2CbSize) {
local_sps_id = sps_id;
tmp_pcm_bit_depth = pcm_bit_depth[local_sps_id];
pcm_sample_luma[i] = tmp_pcm_bit_depth;
i = i + 1;
}
i0 = 0;
local_cu_log2CbSize = cu_log2CbSize;
while (i0 <= 1 << (local_cu_log2CbSize << 1)) {
local_sps_id = sps_id;
tmp_pcm_bit_depth_chroma = pcm_bit_depth_chroma[local_sps_id];
pcm_sample_chroma[i0] = tmp_pcm_bit_depth_chroma;
i0 = i0 + 1;
}
local_sps_id = sps_id;
tmp_pcm_loop_filter_disable_flag = pcm_loop_filter_disable_flag[local_sps_id];
if (tmp_pcm_loop_filter_disable_flag != 0) {
local_cu_x0 = cu_x0;
local_cu_y0 = cu_y0;
local_cu_log2CbSize = cu_log2CbSize;
set_deblocking_bypass(local_cu_x0, local_cu_y0, local_cu_log2CbSize);
}
// Update ports indexes
}
static i32 isSchedulable_read_TransformTree_start() {
i32 result;
i32 tmp_isFifoFull;
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 tmp_ttStack;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
result = tmp_isFifoFull && tmp_ttStack == 1;
return result;
}
static void read_TransformTree_start() {
u8 local_ttStack_idx;
u16 local_TT_x0;
u16 x0;
u16 local_TT_y0;
u16 y0;
u16 local_TT_xBase;
u16 xBase;
u16 local_TT_yBase;
u16 yBase;
u8 local_TT_log2TrafoSize;
u8 log2TrafoSize;
u8 local_TT_trafoDepth;
u8 trafoDepth;
u16 cbf_x0;
u16 cbf_y0;
u32 res[1];
u8 local_predMode;
u8 local_INTRA;
u8 local_partMode;
u8 local_PART_NxN;
u8 IntraSplitFlag;
u16 local_sps_id;
u8 tmp_sps_max_transform_hierarchy_depth_inter;
u8 local_INTER;
u8 local_PART_2Nx2N;
u8 InterSplitFlag;
i32 local_DEBUG_CABAC;
i32 local_DEBUG_TRACE1;
u8 local_TT_blkIdx;
u16 tmp_ttStack;
u16 tmp_ttStack0;
u8 tmp_intra_pred_mode;
u8 tmp_intra_pred_mode0;
u8 local_Log2MaxTrafoSize;
u8 local_Log2MinTrafoSize;
u8 local_MaxTrafoDepth;
u32 tmp_res;
u32 tmp_res0;
u32 tmp_res1;
u16 local_cbf_xBase;
u16 local_cbf_yBase;
u8 tmp_cbf_cb;
u32 tmp_res2;
u8 tmp_cbf_cr;
u32 tmp_res3;
u8 tmp_cbf_cb0;
u8 tmp_cbf_cr0;
u8 local_split_transform_flag;
u16 local_TT_x1;
u16 local_TT_y1;
u8 local_TT_idx;
u8 tmp_cbf_cb1;
u8 tmp_cbf_cr1;
u32 tmp_res4;
u16 tmp_ttStack1;
local_ttStack_idx = ttStack_idx;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
x0 = ttStack[local_ttStack_idx][local_TT_x0];
local_ttStack_idx = ttStack_idx;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
y0 = ttStack[local_ttStack_idx][local_TT_y0];
local_ttStack_idx = ttStack_idx;
local_TT_xBase = HevcDecoder_Algo_Parser_TT_xBase;
xBase = ttStack[local_ttStack_idx][local_TT_xBase];
local_ttStack_idx = ttStack_idx;
local_TT_yBase = HevcDecoder_Algo_Parser_TT_yBase;
yBase = ttStack[local_ttStack_idx][local_TT_yBase];
local_ttStack_idx = ttStack_idx;
local_TT_log2TrafoSize = HevcDecoder_Algo_Parser_TT_log2TrafoSize;
log2TrafoSize = ttStack[local_ttStack_idx][local_TT_log2TrafoSize];
local_ttStack_idx = ttStack_idx;
local_TT_trafoDepth = HevcDecoder_Algo_Parser_TT_trafoDepth;
trafoDepth = ttStack[local_ttStack_idx][local_TT_trafoDepth];
cbf_x0 = x0 & (1 << log2TrafoSize) - 1;
cbf_y0 = y0 & (1 << log2TrafoSize) - 1;
res[0] = 0;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
local_partMode = partMode;
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
if (local_predMode == local_INTRA && local_partMode == local_PART_NxN) {
IntraSplitFlag = 1;
} else {
IntraSplitFlag = 0;
}
local_sps_id = sps_id;
tmp_sps_max_transform_hierarchy_depth_inter = sps_max_transform_hierarchy_depth_inter[local_sps_id];
local_predMode = predMode;
local_INTER = HevcDecoder_Algo_Parser_INTER;
local_partMode = partMode;
local_PART_2Nx2N = HevcDecoder_Algo_Parser_PART_2Nx2N;
if (tmp_sps_max_transform_hierarchy_depth_inter == 0 && local_predMode == local_INTER && local_partMode != local_PART_2Nx2N && trafoDepth == 0) {
InterSplitFlag = 1;
} else {
InterSplitFlag = 0;
}
cbf_xBase = xBase & (1 << log2TrafoSize) - 1;
cbf_yBase = yBase & (1 << log2TrafoSize) - 1;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_DEBUG_TRACE1 = HevcDecoder_Algo_Parser_DEBUG_TRACE1;
if (local_DEBUG_CABAC && local_DEBUG_TRACE1) {
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_blkIdx];
printf("read_TransformTree.start(%u, %u, %u, %u, %u, %u, %u)\n", x0, y0, xBase, yBase, log2TrafoSize, trafoDepth, tmp_ttStack);
} else {
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_TransformTree.start\n");
}
}
if (IntraSplitFlag == 1) {
if (trafoDepth == 1) {
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
tmp_ttStack0 = ttStack[local_ttStack_idx][local_TT_blkIdx];
tmp_intra_pred_mode = intra_pred_mode[tmp_ttStack0];
cur_intra_pred_mode = tmp_intra_pred_mode;
}
} else {
tmp_intra_pred_mode0 = intra_pred_mode[0];
cur_intra_pred_mode = tmp_intra_pred_mode0;
}
split_transform_flag = 0;
local_Log2MaxTrafoSize = Log2MaxTrafoSize;
local_Log2MinTrafoSize = Log2MinTrafoSize;
local_MaxTrafoDepth = MaxTrafoDepth;
if (log2TrafoSize <= local_Log2MaxTrafoSize && log2TrafoSize > local_Log2MinTrafoSize && trafoDepth < local_MaxTrafoDepth && !(IntraSplitFlag == 1 && trafoDepth == 0)) {
HevcDecoder_Algo_Parser_get_SPLIT_TRANSFORM_FLAG(codIRange, codIOffset, ctxTable, fifo, res, log2TrafoSize);
tmp_res = res[0];
split_transform_flag = tmp_res;
} else {
local_Log2MaxTrafoSize = Log2MaxTrafoSize;
if (log2TrafoSize > local_Log2MaxTrafoSize || IntraSplitFlag == 1 && trafoDepth == 0 || InterSplitFlag == 1) {
split_transform_flag = 1;
}
}
cbf_cb[cbf_x0][cbf_y0][trafoDepth] = 0;
cbf_cr[cbf_x0][cbf_y0][trafoDepth] = 0;
if (trafoDepth == 0 || log2TrafoSize > 2) {
if (trafoDepth == 0) {
HevcDecoder_Algo_Parser_get_CBF_CB_CR(codIRange, codIOffset, ctxTable, fifo, res, trafoDepth);
tmp_res0 = res[0];
cbf_cb[cbf_x0][cbf_y0][trafoDepth] = tmp_res0;
HevcDecoder_Algo_Parser_get_CBF_CB_CR(codIRange, codIOffset, ctxTable, fifo, res, trafoDepth);
tmp_res1 = res[0];
cbf_cr[cbf_x0][cbf_y0][trafoDepth] = tmp_res1;
} else {
local_cbf_xBase = cbf_xBase;
local_cbf_yBase = cbf_yBase;
tmp_cbf_cb = cbf_cb[local_cbf_xBase][local_cbf_yBase][trafoDepth - 1];
if (tmp_cbf_cb == 1) {
HevcDecoder_Algo_Parser_get_CBF_CB_CR(codIRange, codIOffset, ctxTable, fifo, res, trafoDepth);
tmp_res2 = res[0];
cbf_cb[cbf_x0][cbf_y0][trafoDepth] = tmp_res2;
}
local_cbf_xBase = cbf_xBase;
local_cbf_yBase = cbf_yBase;
tmp_cbf_cr = cbf_cr[local_cbf_xBase][local_cbf_yBase][trafoDepth - 1];
if (tmp_cbf_cr == 1) {
HevcDecoder_Algo_Parser_get_CBF_CB_CR(codIRange, codIOffset, ctxTable, fifo, res, trafoDepth);
tmp_res3 = res[0];
cbf_cr[cbf_x0][cbf_y0][trafoDepth] = tmp_res3;
}
}
}
if (trafoDepth > 0 && log2TrafoSize == 2) {
local_cbf_xBase = cbf_xBase;
local_cbf_yBase = cbf_yBase;
tmp_cbf_cb0 = cbf_cb[local_cbf_xBase][local_cbf_yBase][trafoDepth - 1];
cbf_cb[cbf_x0][cbf_y0][trafoDepth] = tmp_cbf_cb0;
local_cbf_xBase = cbf_xBase;
local_cbf_yBase = cbf_yBase;
tmp_cbf_cr0 = cbf_cr[local_cbf_xBase][local_cbf_yBase][trafoDepth - 1];
cbf_cr[cbf_x0][cbf_y0][trafoDepth] = tmp_cbf_cr0;
}
local_split_transform_flag = split_transform_flag;
if (local_split_transform_flag == 1) {
local_ttStack_idx = ttStack_idx;
local_TT_x1 = HevcDecoder_Algo_Parser_TT_x1;
ttStack[local_ttStack_idx][local_TT_x1] = x0 + ((1 << log2TrafoSize) >> 1);
local_ttStack_idx = ttStack_idx;
local_TT_y1 = HevcDecoder_Algo_Parser_TT_y1;
ttStack[local_ttStack_idx][local_TT_y1] = y0 + ((1 << log2TrafoSize) >> 1);
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
ttStack[local_ttStack_idx][local_TT_idx] = 3;
} else {
cbf_luma = 1;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
tmp_cbf_cb1 = cbf_cb[cbf_x0][cbf_y0][trafoDepth];
tmp_cbf_cr1 = cbf_cr[cbf_x0][cbf_y0][trafoDepth];
if (local_predMode == local_INTRA || trafoDepth != 0 || tmp_cbf_cb1 == 1 || tmp_cbf_cr1 == 1) {
HevcDecoder_Algo_Parser_get_CBF_LUMA(codIRange, codIOffset, ctxTable, fifo, res, trafoDepth);
tmp_res4 = res[0];
cbf_luma = tmp_res4;
}
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
ttStack[local_ttStack_idx][local_TT_idx] = 2;
}
local_partMode = partMode;
local_PART_NxN = HevcDecoder_Algo_Parser_PART_NxN;
local_ttStack_idx = ttStack_idx;
local_TT_trafoDepth = HevcDecoder_Algo_Parser_TT_trafoDepth;
tmp_ttStack1 = ttStack[local_ttStack_idx][local_TT_trafoDepth];
if (!(local_partMode == local_PART_NxN && tmp_ttStack1 == 0)) {
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
ttStack[local_ttStack_idx][local_TT_idx] = 10;
}
// Update ports indexes
}
static i32 isSchedulable_read_TransformTree_start_nonPartNxN() {
i32 result;
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 tmp_ttStack;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
result = tmp_ttStack == 10;
return result;
}
static void read_TransformTree_start_nonPartNxN() {
u8 local_ttStack_idx;
u8 local_TT_idx;
u8 local_split_transform_flag;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
local_split_transform_flag = split_transform_flag;
ttStack[local_ttStack_idx][local_TT_idx] = 2 + local_split_transform_flag;
local_split_transform_flag = split_transform_flag;
tokens_SplitTransform[(index_SplitTransform + (0)) % SIZE_SplitTransform] = local_split_transform_flag != 0;
// Update ports indexes
index_SplitTransform += 1;
}
static i32 isSchedulable_read_TransformTree_gotoTransformUnit() {
i32 result;
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 tmp_ttStack;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
result = tmp_ttStack == 2;
return result;
}
static void read_TransformTree_gotoTransformUnit() {
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 local_TT_x0;
u16 tmp_ttStack;
u16 local_TT_y0;
u16 tmp_ttStack0;
u16 local_TT_xBase;
u16 tmp_ttStack1;
u16 local_TT_yBase;
u16 tmp_ttStack2;
u8 local_TT_log2TrafoSize;
u16 tmp_ttStack3;
u8 local_TT_trafoDepth;
u16 tmp_ttStack4;
u8 local_TT_blkIdx;
u16 tmp_ttStack5;
u8 local_cbf_luma;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
ttStack[local_ttStack_idx][local_TT_idx] = 7;
tu_idx = 1;
local_ttStack_idx = ttStack_idx;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_x0];
tu_x0 = tmp_ttStack;
local_ttStack_idx = ttStack_idx;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
tmp_ttStack0 = ttStack[local_ttStack_idx][local_TT_y0];
tu_y0 = tmp_ttStack0;
local_ttStack_idx = ttStack_idx;
local_TT_xBase = HevcDecoder_Algo_Parser_TT_xBase;
tmp_ttStack1 = ttStack[local_ttStack_idx][local_TT_xBase];
tu_xBase = tmp_ttStack1;
local_ttStack_idx = ttStack_idx;
local_TT_yBase = HevcDecoder_Algo_Parser_TT_yBase;
tmp_ttStack2 = ttStack[local_ttStack_idx][local_TT_yBase];
tu_yBase = tmp_ttStack2;
local_ttStack_idx = ttStack_idx;
local_TT_log2TrafoSize = HevcDecoder_Algo_Parser_TT_log2TrafoSize;
tmp_ttStack3 = ttStack[local_ttStack_idx][local_TT_log2TrafoSize];
tu_log2TrafoSize = tmp_ttStack3;
local_ttStack_idx = ttStack_idx;
local_TT_trafoDepth = HevcDecoder_Algo_Parser_TT_trafoDepth;
tmp_ttStack4 = ttStack[local_ttStack_idx][local_TT_trafoDepth];
tu_trafoDepth = tmp_ttStack4;
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
tmp_ttStack5 = ttStack[local_ttStack_idx][local_TT_blkIdx];
tu_blkIdx = tmp_ttStack5;
local_cbf_luma = cbf_luma;
tokens_Cbf[(index_Cbf + (0)) % SIZE_Cbf] = local_cbf_luma == 1;
// Update ports indexes
index_Cbf += 1;
}
static i32 isSchedulable_read_TransformTree_gotoTransformTree() {
i32 result;
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 tmp_ttStack;
u16 tmp_ttStack0;
u16 tmp_ttStack1;
u16 tmp_ttStack2;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack0 = ttStack[local_ttStack_idx][local_TT_idx];
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack1 = ttStack[local_ttStack_idx][local_TT_idx];
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack2 = ttStack[local_ttStack_idx][local_TT_idx];
result = tmp_ttStack == 3 || tmp_ttStack0 == 4 || tmp_ttStack1 == 5 || tmp_ttStack2 == 6;
return result;
}
static void read_TransformTree_gotoTransformTree() {
u8 local_ttStack_idx;
u8 idx;
u8 local_TT_idx;
u16 tmp_ttStack;
u16 local_TT_x0;
u16 tmp_ttStack0;
u16 local_TT_y0;
u16 tmp_ttStack1;
u16 local_TT_xBase;
u16 tmp_ttStack2;
u16 local_TT_yBase;
u16 tmp_ttStack3;
u8 local_TT_log2TrafoSize;
u16 tmp_ttStack4;
u8 local_TT_trafoDepth;
u16 tmp_ttStack5;
u16 tmp_ttStack6;
u8 local_TT_blkIdx;
u16 tmp_ttStack7;
u16 local_TT_x1;
u16 tmp_ttStack8;
u16 tmp_ttStack9;
u16 local_TT_y1;
u16 tmp_ttStack10;
u16 tmp_ttStack11;
u16 tmp_ttStack12;
local_ttStack_idx = ttStack_idx;
idx = local_ttStack_idx;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
ttStack[local_ttStack_idx][local_TT_idx] = tmp_ttStack + 1;
local_ttStack_idx = ttStack_idx;
ttStack_idx = local_ttStack_idx + 1;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
ttStack[local_ttStack_idx][local_TT_idx] = 1;
local_ttStack_idx = ttStack_idx;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
tmp_ttStack0 = ttStack[idx][local_TT_x0];
ttStack[local_ttStack_idx][local_TT_x0] = tmp_ttStack0;
local_ttStack_idx = ttStack_idx;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
tmp_ttStack1 = ttStack[idx][local_TT_y0];
ttStack[local_ttStack_idx][local_TT_y0] = tmp_ttStack1;
local_ttStack_idx = ttStack_idx;
local_TT_xBase = HevcDecoder_Algo_Parser_TT_xBase;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
tmp_ttStack2 = ttStack[idx][local_TT_x0];
ttStack[local_ttStack_idx][local_TT_xBase] = tmp_ttStack2;
local_ttStack_idx = ttStack_idx;
local_TT_yBase = HevcDecoder_Algo_Parser_TT_yBase;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
tmp_ttStack3 = ttStack[idx][local_TT_y0];
ttStack[local_ttStack_idx][local_TT_yBase] = tmp_ttStack3;
local_ttStack_idx = ttStack_idx;
local_TT_log2TrafoSize = HevcDecoder_Algo_Parser_TT_log2TrafoSize;
local_TT_log2TrafoSize = HevcDecoder_Algo_Parser_TT_log2TrafoSize;
tmp_ttStack4 = ttStack[idx][local_TT_log2TrafoSize];
ttStack[local_ttStack_idx][local_TT_log2TrafoSize] = tmp_ttStack4 - 1;
local_ttStack_idx = ttStack_idx;
local_TT_trafoDepth = HevcDecoder_Algo_Parser_TT_trafoDepth;
local_TT_trafoDepth = HevcDecoder_Algo_Parser_TT_trafoDepth;
tmp_ttStack5 = ttStack[idx][local_TT_trafoDepth];
ttStack[local_ttStack_idx][local_TT_trafoDepth] = tmp_ttStack5 + 1;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack6 = ttStack[idx][local_TT_idx];
if (tmp_ttStack6 == 4) {
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
ttStack[local_ttStack_idx][local_TT_blkIdx] = 0;
} else {
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack7 = ttStack[idx][local_TT_idx];
if (tmp_ttStack7 == 5) {
local_ttStack_idx = ttStack_idx;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
local_TT_x1 = HevcDecoder_Algo_Parser_TT_x1;
tmp_ttStack8 = ttStack[idx][local_TT_x1];
ttStack[local_ttStack_idx][local_TT_x0] = tmp_ttStack8;
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
ttStack[local_ttStack_idx][local_TT_blkIdx] = 1;
} else {
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack9 = ttStack[idx][local_TT_idx];
if (tmp_ttStack9 == 6) {
local_ttStack_idx = ttStack_idx;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
local_TT_y1 = HevcDecoder_Algo_Parser_TT_y1;
tmp_ttStack10 = ttStack[idx][local_TT_y1];
ttStack[local_ttStack_idx][local_TT_y0] = tmp_ttStack10;
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
ttStack[local_ttStack_idx][local_TT_blkIdx] = 2;
} else {
local_ttStack_idx = ttStack_idx;
local_TT_x0 = HevcDecoder_Algo_Parser_TT_x0;
local_TT_x1 = HevcDecoder_Algo_Parser_TT_x1;
tmp_ttStack11 = ttStack[idx][local_TT_x1];
ttStack[local_ttStack_idx][local_TT_x0] = tmp_ttStack11;
local_ttStack_idx = ttStack_idx;
local_TT_y0 = HevcDecoder_Algo_Parser_TT_y0;
local_TT_y1 = HevcDecoder_Algo_Parser_TT_y1;
tmp_ttStack12 = ttStack[idx][local_TT_y1];
ttStack[local_ttStack_idx][local_TT_y0] = tmp_ttStack12;
local_ttStack_idx = ttStack_idx;
local_TT_blkIdx = HevcDecoder_Algo_Parser_TT_blkIdx;
ttStack[local_ttStack_idx][local_TT_blkIdx] = 3;
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_TransformTree_end() {
i32 result;
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 tmp_ttStack;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
local_ttStack_idx = ttStack_idx;
result = tmp_ttStack == 7 && local_ttStack_idx == 0;
return result;
}
static void read_TransformTree_end() {
// Update ports indexes
}
static i32 isSchedulable_read_TransformTree_endCall() {
i32 result;
u8 local_ttStack_idx;
u8 local_TT_idx;
u16 tmp_ttStack;
local_ttStack_idx = ttStack_idx;
local_TT_idx = HevcDecoder_Algo_Parser_TT_idx;
tmp_ttStack = ttStack[local_ttStack_idx][local_TT_idx];
local_ttStack_idx = ttStack_idx;
result = tmp_ttStack == 7 && local_ttStack_idx != 0;
return result;
}
static void read_TransformTree_endCall() {
u8 local_ttStack_idx;
local_ttStack_idx = ttStack_idx;
ttStack_idx = local_ttStack_idx - 1;
// Update ports indexes
}
static i32 isSchedulable_read_TransformUnit_start() {
i32 result;
i32 tmp_isFifoFull;
u8 local_tu_idx;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
local_tu_idx = tu_idx;
result = tmp_isFifoFull && local_tu_idx == 1;
return result;
}
static void read_TransformUnit_start() {
u32 res[1];
u16 local_cu_x0;
u8 local_tu_log2TrafoSize;
u16 cbf_x0;
u16 local_cu_y0;
u16 cbf_y0;
i32 local_DEBUG_CABAC;
i32 local_DEBUG_TRACE1;
u16 local_tu_x0;
u16 local_tu_y0;
u16 local_tu_xBase;
u16 local_tu_yBase;
u8 local_tu_trafoDepth;
u8 local_tu_blkIdx;
u8 local_cbf_luma;
u8 tmp_cbf_cb;
u8 tmp_cbf_cr;
u16 local_pps_id;
u8 tmp_pps_cu_qp_delta_enabled_flag;
u8 local_IsCuQpDeltaCoded;
u32 tmp_res;
i16 local_CuQpDelta;
u32 tmp_res0;
u8 local_predMode;
u8 local_cur_intra_pred_mode;
u8 tmp_getScanIdx;
u8 local_TEXT_LUMA;
res[0] = 0;
local_cu_x0 = cu_x0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_x0 = local_cu_x0 & (1 << local_tu_log2TrafoSize) - 1;
local_cu_y0 = cu_y0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_y0 = local_cu_y0 & (1 << local_tu_log2TrafoSize) - 1;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_DEBUG_TRACE1 = HevcDecoder_Algo_Parser_DEBUG_TRACE1;
if (local_DEBUG_CABAC && local_DEBUG_TRACE1) {
local_tu_x0 = tu_x0;
local_tu_y0 = tu_y0;
local_tu_xBase = tu_xBase;
local_tu_yBase = tu_yBase;
local_tu_log2TrafoSize = tu_log2TrafoSize;
local_tu_log2TrafoSize = tu_log2TrafoSize;
local_tu_trafoDepth = tu_trafoDepth;
local_tu_blkIdx = tu_blkIdx;
printf("read_TransformUnit.start(%u, %u, %u, %u, %u, %u, %u, %u)\n", local_tu_x0, local_tu_y0, local_tu_xBase, local_tu_yBase, local_tu_log2TrafoSize, local_tu_log2TrafoSize, local_tu_trafoDepth, local_tu_blkIdx);
} else {
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_TransformUnit.start\n");
}
}
local_cbf_luma = cbf_luma;
local_tu_trafoDepth = tu_trafoDepth;
tmp_cbf_cb = cbf_cb[cbf_x0][cbf_y0][local_tu_trafoDepth];
local_tu_trafoDepth = tu_trafoDepth;
tmp_cbf_cr = cbf_cr[cbf_x0][cbf_y0][local_tu_trafoDepth];
if (local_cbf_luma != 0 || tmp_cbf_cb != 0 || tmp_cbf_cr != 0) {
local_pps_id = pps_id;
tmp_pps_cu_qp_delta_enabled_flag = pps_cu_qp_delta_enabled_flag[local_pps_id];
local_IsCuQpDeltaCoded = IsCuQpDeltaCoded;
if (tmp_pps_cu_qp_delta_enabled_flag != 0 && local_IsCuQpDeltaCoded == 0) {
HevcDecoder_Algo_Parser_get_CU_QP_DELTA_ABS(codIRange, codIOffset, ctxTable, fifo, res);
tmp_res = res[0];
CuQpDelta = tmp_res;
local_CuQpDelta = CuQpDelta;
if (local_CuQpDelta != 0) {
HevcDecoder_Algo_Parser_get_CU_QP_DELTA_SIGN_FLAG(codIRange, codIOffset, fifo, res);
tmp_res0 = res[0];
if (tmp_res0 == 1) {
local_CuQpDelta = CuQpDelta;
CuQpDelta = -local_CuQpDelta;
}
}
IsCuQpDeltaCoded = 1;
set_qPy();
}
}
tu_idx = 8;
local_tu_x0 = tu_x0;
rc_x0 = local_tu_x0;
local_tu_y0 = tu_y0;
rc_y0 = local_tu_y0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
rc_log2TrafoSize = local_tu_log2TrafoSize;
local_predMode = predMode;
local_tu_log2TrafoSize = tu_log2TrafoSize;
local_cur_intra_pred_mode = cur_intra_pred_mode;
tmp_getScanIdx = HevcDecoder_Algo_Parser_getScanIdx(local_predMode, local_tu_log2TrafoSize, local_cur_intra_pred_mode);
rc_scanIdx = tmp_getScanIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
rc_cIdx = local_TEXT_LUMA;
local_cbf_luma = cbf_luma;
if (local_cbf_luma == 1) {
tu_idx = 2;
}
// Update ports indexes
}
static i32 isSchedulable_read_TransformUnit_retLuma() {
i32 result;
u8 local_tu_idx;
local_tu_idx = tu_idx;
result = local_tu_idx == 3;
return result;
}
static void read_TransformUnit_retLuma() {
u16 local_tu_x0;
u8 local_tu_log2TrafoSize;
u16 cbf_x0;
u16 local_tu_y0;
u16 cbf_y0;
u16 local_tu_xBase;
u16 cbf_xBase;
u16 local_tu_yBase;
u16 cbf_yBase;
u8 local_predMode;
u8 local_rc_log2TrafoSize;
u8 local_intra_pred_mode_c;
u8 tmp_getScanIdx;
u8 local_TEXT_CHROMA_U;
u8 local_tu_trafoDepth;
u8 tmp_cbf_cb;
u8 local_tu_blkIdx;
u8 tmp_cbf_cb0;
local_tu_x0 = tu_x0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_x0 = local_tu_x0 & (1 << local_tu_log2TrafoSize) - 1;
local_tu_y0 = tu_y0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_y0 = local_tu_y0 & (1 << local_tu_log2TrafoSize) - 1;
local_tu_xBase = tu_xBase;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_xBase = local_tu_xBase & (1 << local_tu_log2TrafoSize) - 1;
local_tu_yBase = tu_yBase;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_yBase = local_tu_yBase & (1 << local_tu_log2TrafoSize) - 1;
tu_idx = 5;
local_tu_log2TrafoSize = tu_log2TrafoSize;
rc_log2TrafoSize = local_tu_log2TrafoSize;
local_predMode = predMode;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_intra_pred_mode_c = intra_pred_mode_c;
tmp_getScanIdx = HevcDecoder_Algo_Parser_getScanIdx(local_predMode, local_rc_log2TrafoSize, local_intra_pred_mode_c);
rc_scanIdx = tmp_getScanIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
rc_cIdx = local_TEXT_CHROMA_U;
local_tu_log2TrafoSize = tu_log2TrafoSize;
if (local_tu_log2TrafoSize > 2) {
tu_idx = 10;
local_tu_x0 = tu_x0;
rc_x0 = local_tu_x0;
local_tu_y0 = tu_y0;
rc_y0 = local_tu_y0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
rc_log2TrafoSize = local_tu_log2TrafoSize - 1;
local_tu_trafoDepth = tu_trafoDepth;
tmp_cbf_cb = cbf_cb[cbf_x0][cbf_y0][local_tu_trafoDepth];
if (tmp_cbf_cb == 1) {
tu_idx = 4;
}
} else {
local_tu_blkIdx = tu_blkIdx;
if (local_tu_blkIdx == 3) {
tu_idx = 10;
local_tu_xBase = tu_xBase;
rc_x0 = local_tu_xBase;
local_tu_yBase = tu_yBase;
rc_y0 = local_tu_yBase;
local_tu_trafoDepth = tu_trafoDepth;
tmp_cbf_cb0 = cbf_cb[cbf_xBase][cbf_yBase][local_tu_trafoDepth];
if (tmp_cbf_cb0 == 1) {
tu_idx = 4;
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_TransformUnit_retCb() {
i32 result;
u8 local_tu_idx;
local_tu_idx = tu_idx;
result = local_tu_idx == 5;
return result;
}
static void read_TransformUnit_retCb() {
u16 local_tu_x0;
u8 local_tu_log2TrafoSize;
u16 cbf_x0;
u16 local_tu_y0;
u16 cbf_y0;
u16 local_tu_xBase;
u16 cbf_xBase;
u16 local_tu_yBase;
u16 cbf_yBase;
u8 local_TEXT_CHROMA_V;
u8 local_tu_trafoDepth;
u8 tmp_cbf_cr;
u8 local_tu_blkIdx;
u8 tmp_cbf_cr0;
local_tu_x0 = tu_x0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_x0 = local_tu_x0 & (1 << local_tu_log2TrafoSize) - 1;
local_tu_y0 = tu_y0;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_y0 = local_tu_y0 & (1 << local_tu_log2TrafoSize) - 1;
local_tu_xBase = tu_xBase;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_xBase = local_tu_xBase & (1 << local_tu_log2TrafoSize) - 1;
local_tu_yBase = tu_yBase;
local_tu_log2TrafoSize = tu_log2TrafoSize;
cbf_yBase = local_tu_yBase & (1 << local_tu_log2TrafoSize) - 1;
tu_idx = 7;
local_TEXT_CHROMA_V = HevcDecoder_Algo_Parser_TEXT_CHROMA_V;
rc_cIdx = local_TEXT_CHROMA_V;
local_tu_log2TrafoSize = tu_log2TrafoSize;
if (local_tu_log2TrafoSize > 2) {
tu_idx = 12;
local_tu_log2TrafoSize = tu_log2TrafoSize;
rc_log2TrafoSize = local_tu_log2TrafoSize - 1;
local_tu_trafoDepth = tu_trafoDepth;
tmp_cbf_cr = cbf_cr[cbf_x0][cbf_y0][local_tu_trafoDepth];
if (tmp_cbf_cr == 1) {
tu_idx = 6;
}
} else {
local_tu_blkIdx = tu_blkIdx;
if (local_tu_blkIdx == 3) {
tu_idx = 12;
local_tu_trafoDepth = tu_trafoDepth;
tmp_cbf_cr0 = cbf_cr[cbf_xBase][cbf_yBase][local_tu_trafoDepth];
if (tmp_cbf_cr0 == 1) {
tu_idx = 6;
}
}
}
// Update ports indexes
}
static i32 isSchedulable_read_TransformUnit_gotoResidualCoding() {
i32 result;
u8 local_tu_idx;
local_tu_idx = tu_idx;
local_tu_idx = tu_idx;
local_tu_idx = tu_idx;
result = local_tu_idx == 2 || local_tu_idx == 4 || local_tu_idx == 6;
return result;
}
static void read_TransformUnit_gotoResidualCoding() {
u8 local_tu_idx;
local_tu_idx = tu_idx;
tu_idx = local_tu_idx + 1;
// Update ports indexes
}
static i32 isSchedulable_read_TransformUnit_skipResidualCoding() {
i32 result;
u8 local_tu_idx;
local_tu_idx = tu_idx;
local_tu_idx = tu_idx;
local_tu_idx = tu_idx;
result = local_tu_idx == 8 || local_tu_idx == 10 || local_tu_idx == 12;
return result;
}
static void read_TransformUnit_skipResidualCoding() {
u8 local_tu_idx;
i8 local_qp_y;
u16 local_qp_bd_offset_luma;
u8 local_rc_cIdx;
u8 local_rc_log2TrafoSize;
i8 local_slice_qp;
local_tu_idx = tu_idx;
tu_idx = local_tu_idx - 5;
local_qp_y = qp_y;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp = local_qp_y + local_qp_bd_offset_luma;
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
tokens_TUSize[(index_TUSize + (0)) % SIZE_TUSize] = 1 << local_rc_log2TrafoSize;
tokens_TUSize[(index_TUSize + (1)) % SIZE_TUSize] = 2;
tokens_TUSize[(index_TUSize + (2)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (3)) % SIZE_TUSize] = 0;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize + (4)) % SIZE_TUSize] = local_slice_qp;
local_rc_cIdx = rc_cIdx;
tokens_TUSize[(index_TUSize + (5)) % SIZE_TUSize] = local_rc_cIdx;
tokens_TUSize[(index_TUSize + (6)) % SIZE_TUSize] = 0;
// Update ports indexes
index_TUSize += 7;
write_end_TUSize();
}
static void read_TransformUnit_skipResidualCoding_aligned() {
u8 local_tu_idx;
i8 local_qp_y;
u16 local_qp_bd_offset_luma;
u8 local_rc_cIdx;
u8 local_rc_log2TrafoSize;
i8 local_slice_qp;
local_tu_idx = tu_idx;
tu_idx = local_tu_idx - 5;
local_qp_y = qp_y;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp = local_qp_y + local_qp_bd_offset_luma;
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (0)] = 1 << local_rc_log2TrafoSize;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (1)] = 2;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (2)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (3)] = 0;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (4)] = local_slice_qp;
local_rc_cIdx = rc_cIdx;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (5)] = local_rc_cIdx;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (6)] = 0;
// Update ports indexes
index_TUSize += 7;
write_end_TUSize();
}
static i32 isSchedulable_read_TransformUnit_end() {
i32 result;
u8 local_tu_idx;
local_tu_idx = tu_idx;
result = local_tu_idx == 7;
return result;
}
static void read_TransformUnit_end() {
i32 local_DEBUG_CABAC;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_TransformUnit_end\n");
}
// Update ports indexes
}
static i32 isSchedulable_read_ResidualCoding_start() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_ResidualCoding_start() {
i32 res[1];
u8 local_rc_log2TrafoSize;
i32 sz;
u8 transform_skip_flag;
i32 matrix_id;
i32 qp_offset;
i16 qp_i;
i32 x_cg_last_sig;
i32 y_cg_last_sig;
i32 last_x_c;
i32 last_y_c;
u8 qp_c[15];
u8 levelScale[6];
u8 local_predMode;
u8 local_INTRA;
u8 local_rc_cIdx;
u8 local_TEXT_LUMA;
u8 isDST;
i32 local_DEBUG_CABAC;
i32 local_DEBUG_TRACE1;
char * tmp_if;
u8 local_TEXT_CHROMA_U;
u16 local_rc_x0;
u16 local_rc_y0;
u8 local_rc_scanIdx;
char * tmp_if0;
u8 local_cu_transquant_bypass_flag;
u16 local_sps_id;
i32 tmp_sps_bit_depth_luma_minus8;
i32 tmp_sps_bit_depth_chroma_minus8;
i8 local_qp_y;
u16 local_qp_bd_offset_luma;
u16 local_pps_id;
i8 tmp_pps_cb_qp_offset;
i8 local_slice_cb_qp_offset;
i8 tmp_pps_cr_qp_offset;
i8 local_slice_cr_qp_offset;
u8 tmp_qp_c;
i16 local_qp;
u8 local_shift;
u8 tmp_rem6;
u8 tmp_levelScale;
u8 tmp_div6;
u8 tmp_sps_scaling_list_enabled_flag;
u8 tmp_pps_scaling_list_data_present_flag;
i32 i;
u8 tmp_pps_sl;
u8 tmp_pps_sl_dc;
i32 i0;
u8 tmp_sps_sl;
u8 tmp_sps_sl_dc;
i32 i1;
i32 i2;
i32 j;
u8 tmp_pps_transform_skip_enabled_flag;
i32 tmp_res;
i32 tmp_res0;
u8 local_LastSignificantCoeffX;
i32 tmp_res1;
u8 local_LastSignificantCoeffY;
i32 tmp_res2;
u8 local_SCAN_VER;
i32 tmp_res3;
u8 tmp_diag_scan4x4_inv;
u16 local_num_coeff;
u8 tmp_diag_scan2x2_inv;
u8 tmp_diag_scan4x4_inv0;
u8 tmp_diag_scan8x8_inv;
u8 tmp_horiz_scan8x8_inv;
u8 tmp_horiz_scan8x8_inv0;
i8 local_rc_lastSubBlock;
i8 local_slice_qp;
i8 tmp_pps_cb_qp_offset0;
i8 tmp_pps_cr_qp_offset0;
local_rc_log2TrafoSize = rc_log2TrafoSize;
sz = 1 << local_rc_log2TrafoSize;
qp_c[0] = 29;
qp_c[1] = 30;
qp_c[2] = 31;
qp_c[3] = 32;
qp_c[4] = 33;
qp_c[5] = 33;
qp_c[6] = 34;
qp_c[7] = 34;
qp_c[8] = 35;
qp_c[9] = 35;
qp_c[10] = 36;
qp_c[11] = 36;
qp_c[12] = 37;
qp_c[13] = 37;
levelScale[0] = 40;
levelScale[1] = 45;
levelScale[2] = 51;
levelScale[3] = 57;
levelScale[4] = 64;
levelScale[5] = 72;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
local_rc_cIdx = rc_cIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (local_predMode == local_INTRA && local_rc_cIdx == local_TEXT_LUMA && sz == 4) {
isDST = 1;
} else {
isDST = 0;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_DEBUG_TRACE1 = HevcDecoder_Algo_Parser_DEBUG_TRACE1;
if (local_DEBUG_CABAC && local_DEBUG_TRACE1) {
local_rc_cIdx = rc_cIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (local_rc_cIdx == local_TEXT_LUMA) {
tmp_if = "cbY";
} else {
local_rc_cIdx = rc_cIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
if (local_rc_cIdx == local_TEXT_CHROMA_U) {
tmp_if = "cbU";
} else {
tmp_if = "cbV";
}
}
local_rc_x0 = rc_x0;
local_rc_y0 = rc_y0;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_scanIdx = rc_scanIdx;
local_rc_cIdx = rc_cIdx;
printf("read_ResidualCoding.start %s(%u, %u, %u, %u, %u)\n", tmp_if, local_rc_x0, local_rc_y0, local_rc_log2TrafoSize, local_rc_scanIdx, local_rc_cIdx);
} else {
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
local_rc_cIdx = rc_cIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (local_rc_cIdx == local_TEXT_LUMA) {
tmp_if0 = "cbY";
} else {
local_rc_cIdx = rc_cIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
if (local_rc_cIdx == local_TEXT_CHROMA_U) {
tmp_if0 = "cbU";
} else {
tmp_if0 = "cbV";
}
}
printf("read_ResidualCoding.start %s\n", tmp_if0);
}
}
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
if (local_cu_transquant_bypass_flag == 0) {
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
local_sps_id = sps_id;
tmp_sps_bit_depth_luma_minus8 = sps_bit_depth_luma_minus8[local_sps_id];
local_rc_log2TrafoSize = rc_log2TrafoSize;
shift = tmp_sps_bit_depth_luma_minus8 + 8 + local_rc_log2TrafoSize - 5;
} else {
local_sps_id = sps_id;
tmp_sps_bit_depth_chroma_minus8 = sps_bit_depth_chroma_minus8[local_sps_id];
local_rc_log2TrafoSize = rc_log2TrafoSize;
shift = tmp_sps_bit_depth_chroma_minus8 + 8 + local_rc_log2TrafoSize - 5;
}
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
local_qp_y = qp_y;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp = local_qp_y + local_qp_bd_offset_luma;
} else {
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 1) {
local_pps_id = pps_id;
tmp_pps_cb_qp_offset = pps_cb_qp_offset[local_pps_id];
local_slice_cb_qp_offset = slice_cb_qp_offset;
qp_offset = tmp_pps_cb_qp_offset + local_slice_cb_qp_offset;
} else {
local_pps_id = pps_id;
tmp_pps_cr_qp_offset = pps_cr_qp_offset[local_pps_id];
local_slice_cr_qp_offset = slice_cr_qp_offset;
qp_offset = tmp_pps_cr_qp_offset + local_slice_cr_qp_offset;
}
local_qp_y = qp_y;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp_i = HevcDecoder_Algo_Parser_clip_i32(local_qp_y + qp_offset, -local_qp_bd_offset_luma, 57);
if (qp_i < 30) {
qp = qp_i;
} else {
if (qp_i > 43) {
qp = qp_i - 6;
} else {
tmp_qp_c = qp_c[qp_i - 30];
qp = tmp_qp_c;
}
}
local_qp = qp;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp = local_qp + local_qp_bd_offset_luma;
}
local_shift = shift;
add = 1 << (local_shift - 1);
local_qp = qp;
tmp_rem6 = HevcDecoder_Algo_Parser_rem6[local_qp];
tmp_levelScale = levelScale[tmp_rem6];
local_qp = qp;
tmp_div6 = HevcDecoder_Algo_Parser_div6[local_qp];
scale = tmp_levelScale << tmp_div6;
scale_m = 16;
dc_scale = 16;
local_sps_id = sps_id;
tmp_sps_scaling_list_enabled_flag = sps_scaling_list_enabled_flag[local_sps_id];
if (tmp_sps_scaling_list_enabled_flag == 1) {
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (local_predMode != local_INTRA) {
matrix_id = 1;
} else {
matrix_id = 0;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize != 5) {
local_rc_cIdx = rc_cIdx;
matrix_id = 3 * matrix_id + local_rc_cIdx;
}
local_pps_id = pps_id;
tmp_pps_scaling_list_data_present_flag = pps_scaling_list_data_present_flag[local_pps_id];
if (tmp_pps_scaling_list_data_present_flag == 1) {
i = 0;
while (i <= 63) {
local_pps_id = pps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_pps_sl = pps_sl[local_pps_id][local_rc_log2TrafoSize - 2][matrix_id][i];
scale_matrix[i] = tmp_pps_sl;
i = i + 1;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize >= 4) {
local_pps_id = pps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_pps_sl_dc = pps_sl_dc[local_pps_id][local_rc_log2TrafoSize - 4][matrix_id];
dc_scale = tmp_pps_sl_dc;
}
} else {
i0 = 0;
while (i0 <= 63) {
local_sps_id = sps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_sps_sl = sps_sl[local_sps_id][local_rc_log2TrafoSize - 2][matrix_id][i0];
scale_matrix[i0] = tmp_sps_sl;
i0 = i0 + 1;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize >= 4) {
local_sps_id = sps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_sps_sl_dc = sps_sl_dc[local_sps_id][local_rc_log2TrafoSize - 4][matrix_id];
dc_scale = tmp_sps_sl_dc;
}
}
}
} else {
shift = 0;
add = 0;
scale = 0;
dc_scale = 0;
}
i1 = 0;
while (i1 <= sz * sz - 1) {
tabTransCoeffLevel[i1] = 0;
i1 = i1 + 1;
}
i2 = 0;
while (i2 <= 7) {
j = 0;
while (j <= 7) {
coded_sub_block_flag[i2][j] = 0;
j = j + 1;
}
i2 = i2 + 1;
}
local_pps_id = pps_id;
tmp_pps_transform_skip_enabled_flag = pps_transform_skip_enabled_flag[local_pps_id];
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (tmp_pps_transform_skip_enabled_flag == 1 && local_cu_transquant_bypass_flag == 0 && local_rc_log2TrafoSize == 2) {
local_rc_cIdx = rc_cIdx;
HevcDecoder_Algo_Parser_get_TRANSFORM_SKIP_FLAG(codIRange, codIOffset, ctxTable, fifo, res, local_rc_cIdx);
transform_skip_flag = res[0];
} else {
transform_skip_flag = 0;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_cIdx = rc_cIdx;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_X_PREFIX(codIRange, codIOffset, ctxTable, fifo, res, local_rc_log2TrafoSize, local_rc_cIdx);
tmp_res = res[0];
LastSignificantCoeffX = tmp_res;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_cIdx = rc_cIdx;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_Y_PREFIX(codIRange, codIOffset, ctxTable, fifo, res, local_rc_log2TrafoSize, local_rc_cIdx);
tmp_res0 = res[0];
LastSignificantCoeffY = tmp_res0;
local_LastSignificantCoeffX = LastSignificantCoeffX;
if (local_LastSignificantCoeffX > 3) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_XY_SUFFIX(codIRange, codIOffset, fifo, res, local_LastSignificantCoeffX);
local_LastSignificantCoeffX = LastSignificantCoeffX;
local_LastSignificantCoeffX = LastSignificantCoeffX;
tmp_res1 = res[0];
LastSignificantCoeffX = (1 << ((local_LastSignificantCoeffX >> 1) - 1)) * (2 + (local_LastSignificantCoeffX & 1)) + tmp_res1;
}
local_LastSignificantCoeffY = LastSignificantCoeffY;
if (local_LastSignificantCoeffY > 3) {
local_LastSignificantCoeffY = LastSignificantCoeffY;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_XY_SUFFIX(codIRange, codIOffset, fifo, res, local_LastSignificantCoeffY);
local_LastSignificantCoeffY = LastSignificantCoeffY;
local_LastSignificantCoeffY = LastSignificantCoeffY;
tmp_res2 = res[0];
LastSignificantCoeffY = (1 << ((local_LastSignificantCoeffY >> 1) - 1)) * (2 + (local_LastSignificantCoeffY & 1)) + tmp_res2;
}
local_rc_scanIdx = rc_scanIdx;
local_SCAN_VER = HevcDecoder_Algo_Parser_SCAN_VER;
if (local_rc_scanIdx == local_SCAN_VER) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
res[0] = local_LastSignificantCoeffX;
local_LastSignificantCoeffY = LastSignificantCoeffY;
LastSignificantCoeffX = local_LastSignificantCoeffY;
tmp_res3 = res[0];
LastSignificantCoeffY = tmp_res3;
}
local_LastSignificantCoeffX = LastSignificantCoeffX;
x_cg_last_sig = local_LastSignificantCoeffX >> 2;
local_LastSignificantCoeffY = LastSignificantCoeffY;
y_cg_last_sig = local_LastSignificantCoeffY >> 2;
local_rc_scanIdx = rc_scanIdx;
if (local_rc_scanIdx == 0) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
last_x_c = local_LastSignificantCoeffX & 3;
local_LastSignificantCoeffY = LastSignificantCoeffY;
last_y_c = local_LastSignificantCoeffY & 3;
tmp_diag_scan4x4_inv = HevcDecoder_Algo_Parser_diag_scan4x4_inv[last_y_c][last_x_c];
num_coeff = tmp_diag_scan4x4_inv;
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 3) {
local_num_coeff = num_coeff;
tmp_diag_scan2x2_inv = HevcDecoder_Algo_Parser_diag_scan2x2_inv[y_cg_last_sig][x_cg_last_sig];
num_coeff = local_num_coeff + (tmp_diag_scan2x2_inv << 4);
} else {
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 4) {
local_num_coeff = num_coeff;
tmp_diag_scan4x4_inv0 = HevcDecoder_Algo_Parser_diag_scan4x4_inv[y_cg_last_sig][x_cg_last_sig];
num_coeff = local_num_coeff + (tmp_diag_scan4x4_inv0 << 4);
} else {
local_num_coeff = num_coeff;
tmp_diag_scan8x8_inv = HevcDecoder_Algo_Parser_diag_scan8x8_inv[y_cg_last_sig][x_cg_last_sig];
num_coeff = local_num_coeff + (tmp_diag_scan8x8_inv << 4);
}
}
} else {
local_rc_scanIdx = rc_scanIdx;
if (local_rc_scanIdx == 1) {
local_LastSignificantCoeffY = LastSignificantCoeffY;
local_LastSignificantCoeffX = LastSignificantCoeffX;
tmp_horiz_scan8x8_inv = HevcDecoder_Algo_Parser_horiz_scan8x8_inv[local_LastSignificantCoeffY][local_LastSignificantCoeffX];
num_coeff = tmp_horiz_scan8x8_inv;
} else {
local_rc_scanIdx = rc_scanIdx;
if (local_rc_scanIdx == 2) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
local_LastSignificantCoeffY = LastSignificantCoeffY;
tmp_horiz_scan8x8_inv0 = HevcDecoder_Algo_Parser_horiz_scan8x8_inv[local_LastSignificantCoeffX][local_LastSignificantCoeffY];
num_coeff = tmp_horiz_scan8x8_inv0;
}
}
}
local_num_coeff = num_coeff;
num_coeff = local_num_coeff + 1;
local_num_coeff = num_coeff;
rc_lastSubBlock = (local_num_coeff - 1) >> 4;
local_num_coeff = num_coeff;
local_rc_lastSubBlock = rc_lastSubBlock;
rc_lastScanPos = local_num_coeff - (local_rc_lastSubBlock << 4) - 1;
local_rc_lastSubBlock = rc_lastSubBlock;
rc_i = local_rc_lastSubBlock;
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
}
tokens_TUSize[(index_TUSize + (0)) % SIZE_TUSize] = sz;
tokens_TUSize[(index_TUSize + (1)) % SIZE_TUSize] = 0;
tokens_TUSize[(index_TUSize + (2)) % SIZE_TUSize] = isDST;
tokens_TUSize[(index_TUSize + (3)) % SIZE_TUSize] = transform_skip_flag;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize + (4)) % SIZE_TUSize] = local_slice_qp;
local_rc_cIdx = rc_cIdx;
tokens_TUSize[(index_TUSize + (5)) % SIZE_TUSize] = local_rc_cIdx;
local_rc_cIdx = rc_cIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
if (local_rc_cIdx == local_TEXT_CHROMA_U) {
local_pps_id = pps_id;
tmp_pps_cb_qp_offset0 = pps_cb_qp_offset[local_pps_id];
local_slice_cb_qp_offset = slice_cb_qp_offset;
tokens_TUSize[(index_TUSize + (6)) % SIZE_TUSize] = tmp_pps_cb_qp_offset0 + local_slice_cb_qp_offset;
} else {
local_pps_id = pps_id;
tmp_pps_cr_qp_offset0 = pps_cr_qp_offset[local_pps_id];
local_slice_cr_qp_offset = slice_cr_qp_offset;
tokens_TUSize[(index_TUSize + (6)) % SIZE_TUSize] = tmp_pps_cr_qp_offset0 + local_slice_cr_qp_offset;
}
// Update ports indexes
index_TUSize += 7;
write_end_TUSize();
}
static void read_ResidualCoding_start_aligned() {
i32 res[1];
u8 local_rc_log2TrafoSize;
i32 sz;
u8 transform_skip_flag;
i32 matrix_id;
i32 qp_offset;
i16 qp_i;
i32 x_cg_last_sig;
i32 y_cg_last_sig;
i32 last_x_c;
i32 last_y_c;
u8 qp_c[15];
u8 levelScale[6];
u8 local_predMode;
u8 local_INTRA;
u8 local_rc_cIdx;
u8 local_TEXT_LUMA;
u8 isDST;
i32 local_DEBUG_CABAC;
i32 local_DEBUG_TRACE1;
char * tmp_if;
u8 local_TEXT_CHROMA_U;
u16 local_rc_x0;
u16 local_rc_y0;
u8 local_rc_scanIdx;
char * tmp_if0;
u8 local_cu_transquant_bypass_flag;
u16 local_sps_id;
i32 tmp_sps_bit_depth_luma_minus8;
i32 tmp_sps_bit_depth_chroma_minus8;
i8 local_qp_y;
u16 local_qp_bd_offset_luma;
u16 local_pps_id;
i8 tmp_pps_cb_qp_offset;
i8 local_slice_cb_qp_offset;
i8 tmp_pps_cr_qp_offset;
i8 local_slice_cr_qp_offset;
u8 tmp_qp_c;
i16 local_qp;
u8 local_shift;
u8 tmp_rem6;
u8 tmp_levelScale;
u8 tmp_div6;
u8 tmp_sps_scaling_list_enabled_flag;
u8 tmp_pps_scaling_list_data_present_flag;
i32 i;
u8 tmp_pps_sl;
u8 tmp_pps_sl_dc;
i32 i0;
u8 tmp_sps_sl;
u8 tmp_sps_sl_dc;
i32 i1;
i32 i2;
i32 j;
u8 tmp_pps_transform_skip_enabled_flag;
i32 tmp_res;
i32 tmp_res0;
u8 local_LastSignificantCoeffX;
i32 tmp_res1;
u8 local_LastSignificantCoeffY;
i32 tmp_res2;
u8 local_SCAN_VER;
i32 tmp_res3;
u8 tmp_diag_scan4x4_inv;
u16 local_num_coeff;
u8 tmp_diag_scan2x2_inv;
u8 tmp_diag_scan4x4_inv0;
u8 tmp_diag_scan8x8_inv;
u8 tmp_horiz_scan8x8_inv;
u8 tmp_horiz_scan8x8_inv0;
i8 local_rc_lastSubBlock;
i8 local_slice_qp;
i8 tmp_pps_cb_qp_offset0;
i8 tmp_pps_cr_qp_offset0;
local_rc_log2TrafoSize = rc_log2TrafoSize;
sz = 1 << local_rc_log2TrafoSize;
qp_c[0] = 29;
qp_c[1] = 30;
qp_c[2] = 31;
qp_c[3] = 32;
qp_c[4] = 33;
qp_c[5] = 33;
qp_c[6] = 34;
qp_c[7] = 34;
qp_c[8] = 35;
qp_c[9] = 35;
qp_c[10] = 36;
qp_c[11] = 36;
qp_c[12] = 37;
qp_c[13] = 37;
levelScale[0] = 40;
levelScale[1] = 45;
levelScale[2] = 51;
levelScale[3] = 57;
levelScale[4] = 64;
levelScale[5] = 72;
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
local_rc_cIdx = rc_cIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (local_predMode == local_INTRA && local_rc_cIdx == local_TEXT_LUMA && sz == 4) {
isDST = 1;
} else {
isDST = 0;
}
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
local_DEBUG_TRACE1 = HevcDecoder_Algo_Parser_DEBUG_TRACE1;
if (local_DEBUG_CABAC && local_DEBUG_TRACE1) {
local_rc_cIdx = rc_cIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (local_rc_cIdx == local_TEXT_LUMA) {
tmp_if = "cbY";
} else {
local_rc_cIdx = rc_cIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
if (local_rc_cIdx == local_TEXT_CHROMA_U) {
tmp_if = "cbU";
} else {
tmp_if = "cbV";
}
}
local_rc_x0 = rc_x0;
local_rc_y0 = rc_y0;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_scanIdx = rc_scanIdx;
local_rc_cIdx = rc_cIdx;
printf("read_ResidualCoding.start %s(%u, %u, %u, %u, %u)\n", tmp_if, local_rc_x0, local_rc_y0, local_rc_log2TrafoSize, local_rc_scanIdx, local_rc_cIdx);
} else {
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
local_rc_cIdx = rc_cIdx;
local_TEXT_LUMA = HevcDecoder_Algo_Parser_TEXT_LUMA;
if (local_rc_cIdx == local_TEXT_LUMA) {
tmp_if0 = "cbY";
} else {
local_rc_cIdx = rc_cIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
if (local_rc_cIdx == local_TEXT_CHROMA_U) {
tmp_if0 = "cbU";
} else {
tmp_if0 = "cbV";
}
}
printf("read_ResidualCoding.start %s\n", tmp_if0);
}
}
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
if (local_cu_transquant_bypass_flag == 0) {
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
local_sps_id = sps_id;
tmp_sps_bit_depth_luma_minus8 = sps_bit_depth_luma_minus8[local_sps_id];
local_rc_log2TrafoSize = rc_log2TrafoSize;
shift = tmp_sps_bit_depth_luma_minus8 + 8 + local_rc_log2TrafoSize - 5;
} else {
local_sps_id = sps_id;
tmp_sps_bit_depth_chroma_minus8 = sps_bit_depth_chroma_minus8[local_sps_id];
local_rc_log2TrafoSize = rc_log2TrafoSize;
shift = tmp_sps_bit_depth_chroma_minus8 + 8 + local_rc_log2TrafoSize - 5;
}
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
local_qp_y = qp_y;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp = local_qp_y + local_qp_bd_offset_luma;
} else {
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 1) {
local_pps_id = pps_id;
tmp_pps_cb_qp_offset = pps_cb_qp_offset[local_pps_id];
local_slice_cb_qp_offset = slice_cb_qp_offset;
qp_offset = tmp_pps_cb_qp_offset + local_slice_cb_qp_offset;
} else {
local_pps_id = pps_id;
tmp_pps_cr_qp_offset = pps_cr_qp_offset[local_pps_id];
local_slice_cr_qp_offset = slice_cr_qp_offset;
qp_offset = tmp_pps_cr_qp_offset + local_slice_cr_qp_offset;
}
local_qp_y = qp_y;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp_i = HevcDecoder_Algo_Parser_clip_i32(local_qp_y + qp_offset, -local_qp_bd_offset_luma, 57);
if (qp_i < 30) {
qp = qp_i;
} else {
if (qp_i > 43) {
qp = qp_i - 6;
} else {
tmp_qp_c = qp_c[qp_i - 30];
qp = tmp_qp_c;
}
}
local_qp = qp;
local_qp_bd_offset_luma = qp_bd_offset_luma;
qp = local_qp + local_qp_bd_offset_luma;
}
local_shift = shift;
add = 1 << (local_shift - 1);
local_qp = qp;
tmp_rem6 = HevcDecoder_Algo_Parser_rem6[local_qp];
tmp_levelScale = levelScale[tmp_rem6];
local_qp = qp;
tmp_div6 = HevcDecoder_Algo_Parser_div6[local_qp];
scale = tmp_levelScale << tmp_div6;
scale_m = 16;
dc_scale = 16;
local_sps_id = sps_id;
tmp_sps_scaling_list_enabled_flag = sps_scaling_list_enabled_flag[local_sps_id];
if (tmp_sps_scaling_list_enabled_flag == 1) {
local_predMode = predMode;
local_INTRA = HevcDecoder_Algo_Parser_INTRA;
if (local_predMode != local_INTRA) {
matrix_id = 1;
} else {
matrix_id = 0;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize != 5) {
local_rc_cIdx = rc_cIdx;
matrix_id = 3 * matrix_id + local_rc_cIdx;
}
local_pps_id = pps_id;
tmp_pps_scaling_list_data_present_flag = pps_scaling_list_data_present_flag[local_pps_id];
if (tmp_pps_scaling_list_data_present_flag == 1) {
i = 0;
while (i <= 63) {
local_pps_id = pps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_pps_sl = pps_sl[local_pps_id][local_rc_log2TrafoSize - 2][matrix_id][i];
scale_matrix[i] = tmp_pps_sl;
i = i + 1;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize >= 4) {
local_pps_id = pps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_pps_sl_dc = pps_sl_dc[local_pps_id][local_rc_log2TrafoSize - 4][matrix_id];
dc_scale = tmp_pps_sl_dc;
}
} else {
i0 = 0;
while (i0 <= 63) {
local_sps_id = sps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_sps_sl = sps_sl[local_sps_id][local_rc_log2TrafoSize - 2][matrix_id][i0];
scale_matrix[i0] = tmp_sps_sl;
i0 = i0 + 1;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize >= 4) {
local_sps_id = sps_id;
local_rc_log2TrafoSize = rc_log2TrafoSize;
tmp_sps_sl_dc = sps_sl_dc[local_sps_id][local_rc_log2TrafoSize - 4][matrix_id];
dc_scale = tmp_sps_sl_dc;
}
}
}
} else {
shift = 0;
add = 0;
scale = 0;
dc_scale = 0;
}
i1 = 0;
while (i1 <= sz * sz - 1) {
tabTransCoeffLevel[i1] = 0;
i1 = i1 + 1;
}
i2 = 0;
while (i2 <= 7) {
j = 0;
while (j <= 7) {
coded_sub_block_flag[i2][j] = 0;
j = j + 1;
}
i2 = i2 + 1;
}
local_pps_id = pps_id;
tmp_pps_transform_skip_enabled_flag = pps_transform_skip_enabled_flag[local_pps_id];
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (tmp_pps_transform_skip_enabled_flag == 1 && local_cu_transquant_bypass_flag == 0 && local_rc_log2TrafoSize == 2) {
local_rc_cIdx = rc_cIdx;
HevcDecoder_Algo_Parser_get_TRANSFORM_SKIP_FLAG(codIRange, codIOffset, ctxTable, fifo, res, local_rc_cIdx);
transform_skip_flag = res[0];
} else {
transform_skip_flag = 0;
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_cIdx = rc_cIdx;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_X_PREFIX(codIRange, codIOffset, ctxTable, fifo, res, local_rc_log2TrafoSize, local_rc_cIdx);
tmp_res = res[0];
LastSignificantCoeffX = tmp_res;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_cIdx = rc_cIdx;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_Y_PREFIX(codIRange, codIOffset, ctxTable, fifo, res, local_rc_log2TrafoSize, local_rc_cIdx);
tmp_res0 = res[0];
LastSignificantCoeffY = tmp_res0;
local_LastSignificantCoeffX = LastSignificantCoeffX;
if (local_LastSignificantCoeffX > 3) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_XY_SUFFIX(codIRange, codIOffset, fifo, res, local_LastSignificantCoeffX);
local_LastSignificantCoeffX = LastSignificantCoeffX;
local_LastSignificantCoeffX = LastSignificantCoeffX;
tmp_res1 = res[0];
LastSignificantCoeffX = (1 << ((local_LastSignificantCoeffX >> 1) - 1)) * (2 + (local_LastSignificantCoeffX & 1)) + tmp_res1;
}
local_LastSignificantCoeffY = LastSignificantCoeffY;
if (local_LastSignificantCoeffY > 3) {
local_LastSignificantCoeffY = LastSignificantCoeffY;
HevcDecoder_Algo_Parser_get_LAST_SIGNIFICANT_COEFF_XY_SUFFIX(codIRange, codIOffset, fifo, res, local_LastSignificantCoeffY);
local_LastSignificantCoeffY = LastSignificantCoeffY;
local_LastSignificantCoeffY = LastSignificantCoeffY;
tmp_res2 = res[0];
LastSignificantCoeffY = (1 << ((local_LastSignificantCoeffY >> 1) - 1)) * (2 + (local_LastSignificantCoeffY & 1)) + tmp_res2;
}
local_rc_scanIdx = rc_scanIdx;
local_SCAN_VER = HevcDecoder_Algo_Parser_SCAN_VER;
if (local_rc_scanIdx == local_SCAN_VER) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
res[0] = local_LastSignificantCoeffX;
local_LastSignificantCoeffY = LastSignificantCoeffY;
LastSignificantCoeffX = local_LastSignificantCoeffY;
tmp_res3 = res[0];
LastSignificantCoeffY = tmp_res3;
}
local_LastSignificantCoeffX = LastSignificantCoeffX;
x_cg_last_sig = local_LastSignificantCoeffX >> 2;
local_LastSignificantCoeffY = LastSignificantCoeffY;
y_cg_last_sig = local_LastSignificantCoeffY >> 2;
local_rc_scanIdx = rc_scanIdx;
if (local_rc_scanIdx == 0) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
last_x_c = local_LastSignificantCoeffX & 3;
local_LastSignificantCoeffY = LastSignificantCoeffY;
last_y_c = local_LastSignificantCoeffY & 3;
tmp_diag_scan4x4_inv = HevcDecoder_Algo_Parser_diag_scan4x4_inv[last_y_c][last_x_c];
num_coeff = tmp_diag_scan4x4_inv;
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 3) {
local_num_coeff = num_coeff;
tmp_diag_scan2x2_inv = HevcDecoder_Algo_Parser_diag_scan2x2_inv[y_cg_last_sig][x_cg_last_sig];
num_coeff = local_num_coeff + (tmp_diag_scan2x2_inv << 4);
} else {
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 4) {
local_num_coeff = num_coeff;
tmp_diag_scan4x4_inv0 = HevcDecoder_Algo_Parser_diag_scan4x4_inv[y_cg_last_sig][x_cg_last_sig];
num_coeff = local_num_coeff + (tmp_diag_scan4x4_inv0 << 4);
} else {
local_num_coeff = num_coeff;
tmp_diag_scan8x8_inv = HevcDecoder_Algo_Parser_diag_scan8x8_inv[y_cg_last_sig][x_cg_last_sig];
num_coeff = local_num_coeff + (tmp_diag_scan8x8_inv << 4);
}
}
} else {
local_rc_scanIdx = rc_scanIdx;
if (local_rc_scanIdx == 1) {
local_LastSignificantCoeffY = LastSignificantCoeffY;
local_LastSignificantCoeffX = LastSignificantCoeffX;
tmp_horiz_scan8x8_inv = HevcDecoder_Algo_Parser_horiz_scan8x8_inv[local_LastSignificantCoeffY][local_LastSignificantCoeffX];
num_coeff = tmp_horiz_scan8x8_inv;
} else {
local_rc_scanIdx = rc_scanIdx;
if (local_rc_scanIdx == 2) {
local_LastSignificantCoeffX = LastSignificantCoeffX;
local_LastSignificantCoeffY = LastSignificantCoeffY;
tmp_horiz_scan8x8_inv0 = HevcDecoder_Algo_Parser_horiz_scan8x8_inv[local_LastSignificantCoeffX][local_LastSignificantCoeffY];
num_coeff = tmp_horiz_scan8x8_inv0;
}
}
}
local_num_coeff = num_coeff;
num_coeff = local_num_coeff + 1;
local_num_coeff = num_coeff;
rc_lastSubBlock = (local_num_coeff - 1) >> 4;
local_num_coeff = num_coeff;
local_rc_lastSubBlock = rc_lastSubBlock;
rc_lastScanPos = local_num_coeff - (local_rc_lastSubBlock << 4) - 1;
local_rc_lastSubBlock = rc_lastSubBlock;
rc_i = local_rc_lastSubBlock;
local_rc_cIdx = rc_cIdx;
if (local_rc_cIdx == 0) {
}
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (0)] = sz;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (1)] = 0;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (2)] = isDST;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (3)] = transform_skip_flag;
local_slice_qp = slice_qp;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (4)] = local_slice_qp;
local_rc_cIdx = rc_cIdx;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (5)] = local_rc_cIdx;
local_rc_cIdx = rc_cIdx;
local_TEXT_CHROMA_U = HevcDecoder_Algo_Parser_TEXT_CHROMA_U;
if (local_rc_cIdx == local_TEXT_CHROMA_U) {
local_pps_id = pps_id;
tmp_pps_cb_qp_offset0 = pps_cb_qp_offset[local_pps_id];
local_slice_cb_qp_offset = slice_cb_qp_offset;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (6)] = tmp_pps_cb_qp_offset0 + local_slice_cb_qp_offset;
} else {
local_pps_id = pps_id;
tmp_pps_cr_qp_offset0 = pps_cr_qp_offset[local_pps_id];
local_slice_cr_qp_offset = slice_cr_qp_offset;
tokens_TUSize[(index_TUSize % SIZE_TUSize) + (6)] = tmp_pps_cr_qp_offset0 + local_slice_cr_qp_offset;
}
// Update ports indexes
index_TUSize += 7;
write_end_TUSize();
}
static i32 isSchedulable_read_ResidualCoding_for_numLastSubset_start() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_ResidualCoding_for_numLastSubset_start() {
i32 res[1];
u8 n;
u16 xC;
u16 yC;
u8 inferSigCoeffFlag;
u8 local_rc_log2TrafoSize;
u8 local_rc_scanIdx;
i8 local_rc_i;
u8 tmp_ScanOrder;
u8 tmp_ScanOrder0;
i8 local_rc_lastSubBlock;
u16 local_rc_xS;
u16 local_rc_yS;
u8 local_rc_cIdx;
i32 tmp_res;
u8 local_LastSignificantCoeffX;
u8 local_LastSignificantCoeffY;
u8 local_rc_lastScanPos;
i32 m;
i8 local_m_end;
u8 tmp_ScanOrder1;
u8 tmp_ScanOrder2;
u8 tmp_coded_sub_block_flag;
i32 tmp_res0;
u8 local_nb_significant_coeff_flag;
u8 tmp_coded_sub_block_flag0;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_scanIdx = rc_scanIdx;
local_rc_i = rc_i;
tmp_ScanOrder = ScanOrder[local_rc_log2TrafoSize - 2][local_rc_scanIdx][local_rc_i][0];
rc_xS = tmp_ScanOrder;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_scanIdx = rc_scanIdx;
local_rc_i = rc_i;
tmp_ScanOrder0 = ScanOrder[local_rc_log2TrafoSize - 2][local_rc_scanIdx][local_rc_i][1];
rc_yS = tmp_ScanOrder0;
inferSigCoeffFlag = 0;
local_rc_i = rc_i;
local_rc_lastSubBlock = rc_lastSubBlock;
local_rc_i = rc_i;
if (local_rc_i < local_rc_lastSubBlock && local_rc_i > 0) {
local_rc_xS = rc_xS;
local_rc_yS = rc_yS;
local_rc_cIdx = rc_cIdx;
local_rc_log2TrafoSize = rc_log2TrafoSize;
HevcDecoder_Algo_Parser_get_CODED_SUB_BLOCK_FLAG(codIRange, codIOffset, ctxTable, fifo, res, coded_sub_block_flag, local_rc_xS, local_rc_yS, local_rc_cIdx, local_rc_log2TrafoSize);
local_rc_xS = rc_xS;
local_rc_yS = rc_yS;
tmp_res = res[0];
coded_sub_block_flag[local_rc_xS][local_rc_yS] = tmp_res;
inferSigCoeffFlag = 1;
} else {
local_rc_xS = rc_xS;
local_LastSignificantCoeffX = LastSignificantCoeffX;
local_rc_yS = rc_yS;
local_LastSignificantCoeffY = LastSignificantCoeffY;
local_rc_xS = rc_xS;
local_rc_yS = rc_yS;
if (local_rc_xS == local_LastSignificantCoeffX >> 2 && local_rc_yS == local_LastSignificantCoeffY >> 2 || local_rc_xS == 0 && local_rc_yS == 0) {
local_rc_xS = rc_xS;
local_rc_yS = rc_yS;
coded_sub_block_flag[local_rc_xS][local_rc_yS] = 1;
}
}
m_end = 15;
nb_significant_coeff_flag = 0;
local_rc_i = rc_i;
local_rc_lastSubBlock = rc_lastSubBlock;
if (local_rc_i == local_rc_lastSubBlock) {
local_rc_lastScanPos = rc_lastScanPos;
m_end = local_rc_lastScanPos - 1;
local_rc_lastScanPos = rc_lastScanPos;
significant_coeff_flag_idx[0] = local_rc_lastScanPos;
nb_significant_coeff_flag = 1;
}
m = 0;
local_m_end = m_end;
while (m <= local_m_end) {
local_m_end = m_end;
n = local_m_end - m;
local_rc_xS = rc_xS;
local_rc_scanIdx = rc_scanIdx;
tmp_ScanOrder1 = ScanOrder[2][local_rc_scanIdx][n][0];
xC = (local_rc_xS << 2) + tmp_ScanOrder1;
local_rc_yS = rc_yS;
local_rc_scanIdx = rc_scanIdx;
tmp_ScanOrder2 = ScanOrder[2][local_rc_scanIdx][n][1];
yC = (local_rc_yS << 2) + tmp_ScanOrder2;
local_rc_xS = rc_xS;
local_rc_yS = rc_yS;
tmp_coded_sub_block_flag = coded_sub_block_flag[local_rc_xS][local_rc_yS];
if (tmp_coded_sub_block_flag == 1 && (n > 0 || inferSigCoeffFlag == 0)) {
local_rc_cIdx = rc_cIdx;
local_rc_log2TrafoSize = rc_log2TrafoSize;
local_rc_scanIdx = rc_scanIdx;
HevcDecoder_Algo_Parser_get_SIGNIFICANT_COEFF_FLAG(codIRange, codIOffset, ctxTable, fifo, res, coded_sub_block_flag, xC, yC, local_rc_cIdx, local_rc_log2TrafoSize, local_rc_scanIdx);
tmp_res0 = res[0];
if (tmp_res0 == 1) {
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
significant_coeff_flag_idx[local_nb_significant_coeff_flag] = n;
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
nb_significant_coeff_flag = local_nb_significant_coeff_flag + 1;
inferSigCoeffFlag = 0;
}
} else {
local_LastSignificantCoeffX = LastSignificantCoeffX;
local_LastSignificantCoeffY = LastSignificantCoeffY;
local_rc_xS = rc_xS;
local_rc_yS = rc_yS;
tmp_coded_sub_block_flag0 = coded_sub_block_flag[local_rc_xS][local_rc_yS];
if (xC == local_LastSignificantCoeffX && yC == local_LastSignificantCoeffY || (xC & 3) == 0 && (yC & 3) == 0 && inferSigCoeffFlag == 1 && tmp_coded_sub_block_flag0 == 1) {
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
significant_coeff_flag_idx[local_nb_significant_coeff_flag] = n;
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
nb_significant_coeff_flag = local_nb_significant_coeff_flag + 1;
}
}
m = m + 1;
}
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
m_end = local_nb_significant_coeff_flag - 1;
// Update ports indexes
}
static i32 isSchedulable_read_ResidualCoding_end_xIT4() {
i32 result;
i8 local_rc_i;
u8 local_rc_log2TrafoSize;
local_rc_i = rc_i;
local_rc_log2TrafoSize = rc_log2TrafoSize;
result = local_rc_i < 0 && local_rc_log2TrafoSize == 2;
return result;
}
static void read_ResidualCoding_end_xIT4() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 4 * 4 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff + (i)) % SIZE_Coeff] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 16;
write_end_Coeff();
}
static void read_ResidualCoding_end_xIT4_aligned() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 4 * 4 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff % SIZE_Coeff) + (i)] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 16;
write_end_Coeff();
}
static i32 isSchedulable_read_ResidualCoding_end_xIT8() {
i32 result;
i8 local_rc_i;
u8 local_rc_log2TrafoSize;
local_rc_i = rc_i;
local_rc_log2TrafoSize = rc_log2TrafoSize;
result = local_rc_i < 0 && local_rc_log2TrafoSize == 3;
return result;
}
static void read_ResidualCoding_end_xIT8() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 8 * 8 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff + (i)) % SIZE_Coeff] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 64;
write_end_Coeff();
}
static void read_ResidualCoding_end_xIT8_aligned() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 8 * 8 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff % SIZE_Coeff) + (i)] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 64;
write_end_Coeff();
}
static i32 isSchedulable_read_ResidualCoding_end_xIT16() {
i32 result;
i8 local_rc_i;
u8 local_rc_log2TrafoSize;
local_rc_i = rc_i;
local_rc_log2TrafoSize = rc_log2TrafoSize;
result = local_rc_i < 0 && local_rc_log2TrafoSize == 4;
return result;
}
static void read_ResidualCoding_end_xIT16() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 16 * 16 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff + (i)) % SIZE_Coeff] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 256;
write_end_Coeff();
}
static void read_ResidualCoding_end_xIT16_aligned() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 16 * 16 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff % SIZE_Coeff) + (i)] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 256;
write_end_Coeff();
}
static i32 isSchedulable_read_ResidualCoding_end_xIT32() {
i32 result;
i8 local_rc_i;
u8 local_rc_log2TrafoSize;
local_rc_i = rc_i;
local_rc_log2TrafoSize = rc_log2TrafoSize;
result = local_rc_i < 0 && local_rc_log2TrafoSize == 5;
return result;
}
static void read_ResidualCoding_end_xIT32() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 32 * 32 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff + (i)) % SIZE_Coeff] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 1024;
write_end_Coeff();
}
static void read_ResidualCoding_end_xIT32_aligned() {
i32 local_DEBUG_CABAC;
i32 i;
i16 tmp_tabTransCoeffLevel;
local_DEBUG_CABAC = HevcDecoder_Algo_Parser_DEBUG_CABAC;
if (local_DEBUG_CABAC) {
printf("read_ResidualCoding_end\n");
}
i = 0;
while (i <= 32 * 32 - 1) {
tmp_tabTransCoeffLevel = tabTransCoeffLevel[i];
tokens_Coeff[(index_Coeff % SIZE_Coeff) + (i)] = tmp_tabTransCoeffLevel;
i = i + 1;
}
// Update ports indexes
index_Coeff += 1024;
write_end_Coeff();
}
static i32 isSchedulable_read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_GREATER1_FLAG() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_GREATER1_FLAG() {
i32 res[1];
i32 n;
i8 lastSigScanPos;
u8 numGreater1Flag;
u16 ctxIdxInc[1];
i32 i;
i32 m;
i8 local_m_end;
u8 local_rc_cIdx;
i8 local_rc_i;
i8 local_rc_lastSubBlock;
u16 tmp_ctxIdxInc;
i32 tmp_res;
u8 tmp_rc_greater1Ctx;
u8 tmp_rc_greater1Ctx0;
u8 tmp_rc_greater1Ctx1;
i32 tmp_res0;
u8 tmp_coeff_abs_level_greater1_flag;
i8 local_rc_firstGreater1ScanPos;
u8 local_rc_firstSigScanPos;
u8 local_cu_transquant_bypass_flag;
u8 tmp_rc_ctxSet;
i32 tmp_res1;
u16 local_pps_id;
u8 tmp_pps_sign_data_hiding_flag;
u8 local_rc_signHidden;
u8 local_nb_significant_coeff_flag;
i32 tmp_res2;
i32 tmp_res3;
res[0] = 0;
lastSigScanPos = -1;
numGreater1Flag = 0;
rc_firstSigScanPos = 16;
rc_firstGreater1ScanPos = -1;
i = 0;
while (i <= 15) {
coeff_abs_level_greater1_flag[i] = 0;
i = i + 1;
}
m = 0;
local_m_end = m_end;
while (m <= local_m_end) {
n = significant_coeff_flag_idx[m];
if (numGreater1Flag < 8) {
local_rc_cIdx = rc_cIdx;
local_rc_i = rc_i;
local_rc_i = rc_i;
local_rc_lastSubBlock = rc_lastSubBlock;
HevcDecoder_Algo_Parser_context_93315(local_rc_cIdx, local_rc_i, numGreater1Flag == 0, local_rc_i == local_rc_lastSubBlock, rc_ctxSet, rc_greater1Ctx, ctxIdxInc);
tmp_ctxIdxInc = ctxIdxInc[0];
HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL_GREATER1_FLAG(codIRange, codIOffset, ctxTable, fifo, res, tmp_ctxIdxInc);
tmp_res = res[0];
if (tmp_res == 1) {
rc_greater1Ctx[0] = 0;
} else {
tmp_rc_greater1Ctx = rc_greater1Ctx[0];
tmp_rc_greater1Ctx0 = rc_greater1Ctx[0];
if (tmp_rc_greater1Ctx > 0 && tmp_rc_greater1Ctx0 < 3) {
tmp_rc_greater1Ctx1 = rc_greater1Ctx[0];
rc_greater1Ctx[0] = tmp_rc_greater1Ctx1 + 1;
}
}
tmp_res0 = res[0];
coeff_abs_level_greater1_flag[n] = tmp_res0;
numGreater1Flag = numGreater1Flag + 1;
tmp_coeff_abs_level_greater1_flag = coeff_abs_level_greater1_flag[n];
local_rc_firstGreater1ScanPos = rc_firstGreater1ScanPos;
if (tmp_coeff_abs_level_greater1_flag == 1 && local_rc_firstGreater1ScanPos == -1) {
rc_firstGreater1ScanPos = n;
}
}
if (lastSigScanPos == -1) {
lastSigScanPos = n;
}
rc_firstSigScanPos = n;
m = m + 1;
}
local_rc_firstSigScanPos = rc_firstSigScanPos;
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
if (lastSigScanPos - local_rc_firstSigScanPos > 3 && local_cu_transquant_bypass_flag == 0) {
rc_signHidden = 1;
} else {
rc_signHidden = 0;
}
local_rc_firstGreater1ScanPos = rc_firstGreater1ScanPos;
if (local_rc_firstGreater1ScanPos != -1) {
local_rc_cIdx = rc_cIdx;
tmp_rc_ctxSet = rc_ctxSet[0];
HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL_GREATER2_FLAG(codIRange, codIOffset, ctxTable, fifo, res, local_rc_cIdx, tmp_rc_ctxSet);
tmp_res1 = res[0];
coeff_abs_level_greater2_flag = tmp_res1;
}
local_pps_id = pps_id;
tmp_pps_sign_data_hiding_flag = pps_sign_data_hiding_flag[local_pps_id];
local_rc_signHidden = rc_signHidden;
if (tmp_pps_sign_data_hiding_flag == 0 || local_rc_signHidden == 0) {
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
HevcDecoder_Algo_Parser_get_COEFF_SIGN_FLAG(codIRange, codIOffset, fifo, res, local_nb_significant_coeff_flag);
tmp_res2 = res[0];
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
coeff_sign_flag = tmp_res2 << (16 - local_nb_significant_coeff_flag);
} else {
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
HevcDecoder_Algo_Parser_get_COEFF_SIGN_FLAG(codIRange, codIOffset, fifo, res, local_nb_significant_coeff_flag - 1);
tmp_res3 = res[0];
local_nb_significant_coeff_flag = nb_significant_coeff_flag;
coeff_sign_flag = tmp_res3 << (16 - (local_nb_significant_coeff_flag - 1));
}
rc_numSigCoeff = 0;
rc_sumAbsLevel = 0;
rc_cLastRiceParam = 0;
rc_m = 0;
// Update ports indexes
}
static i32 isSchedulable_read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL() {
i32 result;
i32 tmp_isFifoFull;
tmp_isFifoFull = HevcDecoder_Algo_Parser_isFifoFull(fifo);
result = tmp_isFifoFull;
return result;
}
static void read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL() {
i32 res[1];
i8 local_rc_m;
i32 n;
i16 transCoeffLevel;
i32 pos;
u16 xC;
u16 yC;
u16 local_rc_xS;
u8 local_rc_scanIdx;
u8 tmp_ScanOrder;
u16 local_rc_yS;
u8 tmp_ScanOrder0;
u8 tmp_coeff_abs_level_greater1_flag;
i8 local_rc_firstGreater1ScanPos;
u8 tmp_if;
u8 local_coeff_abs_level_greater2_flag;
u8 local_rc_numSigCoeff;
u8 tmp_if0;
u8 local_rc_cLastRiceParam;
i32 tmp_res;
u16 tmp_if1;
i32 tmp_min;
u16 local_pps_id;
u8 tmp_pps_sign_data_hiding_flag;
u8 local_rc_signHidden;
u8 local_rc_sumAbsLevel;
u8 local_rc_firstSigScanPos;
u16 local_coeff_sign_flag;
u8 local_cu_transquant_bypass_flag;
u16 local_sps_id;
u8 tmp_sps_scaling_list_enabled_flag;
u8 local_rc_log2TrafoSize;
u8 tmp_scale_matrix;
i32 local_dc_scale;
i32 local_scale_m;
i32 local_scale;
i32 local_add;
u8 local_shift;
res[0] = 0;
local_rc_m = rc_m;
n = significant_coeff_flag_idx[local_rc_m];
transCoeffLevel = 0;
local_rc_xS = rc_xS;
local_rc_scanIdx = rc_scanIdx;
tmp_ScanOrder = ScanOrder[2][local_rc_scanIdx][n][0];
xC = (local_rc_xS << 2) + tmp_ScanOrder;
local_rc_yS = rc_yS;
local_rc_scanIdx = rc_scanIdx;
tmp_ScanOrder0 = ScanOrder[2][local_rc_scanIdx][n][1];
yC = (local_rc_yS << 2) + tmp_ScanOrder0;
tmp_coeff_abs_level_greater1_flag = coeff_abs_level_greater1_flag[n];
local_rc_firstGreater1ScanPos = rc_firstGreater1ScanPos;
if (n == local_rc_firstGreater1ScanPos) {
local_coeff_abs_level_greater2_flag = coeff_abs_level_greater2_flag;
tmp_if = local_coeff_abs_level_greater2_flag;
} else {
tmp_if = 0;
}
transCoeffLevel = 1 + tmp_coeff_abs_level_greater1_flag + tmp_if;
local_rc_numSigCoeff = rc_numSigCoeff;
if (local_rc_numSigCoeff < 8) {
local_rc_firstGreater1ScanPos = rc_firstGreater1ScanPos;
if (n == local_rc_firstGreater1ScanPos) {
tmp_if0 = 3;
} else {
tmp_if0 = 2;
}
} else {
tmp_if0 = 1;
}
if (transCoeffLevel == tmp_if0) {
local_rc_cLastRiceParam = rc_cLastRiceParam;
HevcDecoder_Algo_Parser_get_COEFF_ABS_LEVEL(codIRange, codIOffset, fifo, res, local_rc_cLastRiceParam);
tmp_res = res[0];
transCoeffLevel = transCoeffLevel + tmp_res;
local_rc_cLastRiceParam = rc_cLastRiceParam;
if (transCoeffLevel > 3 * (1 << local_rc_cLastRiceParam)) {
local_rc_cLastRiceParam = rc_cLastRiceParam;
tmp_if1 = local_rc_cLastRiceParam + 1;
} else {
local_rc_cLastRiceParam = rc_cLastRiceParam;
tmp_if1 = local_rc_cLastRiceParam;
}
tmp_min = HevcDecoder_Algo_Parser_min(tmp_if1, 4);
rc_cLastRiceParam = tmp_min;
}
local_pps_id = pps_id;
tmp_pps_sign_data_hiding_flag = pps_sign_data_hiding_flag[local_pps_id];
local_rc_signHidden = rc_signHidden;
if (tmp_pps_sign_data_hiding_flag == 1 && local_rc_signHidden == 1) {
local_rc_sumAbsLevel = rc_sumAbsLevel;
rc_sumAbsLevel = local_rc_sumAbsLevel + transCoeffLevel;
local_rc_firstSigScanPos = rc_firstSigScanPos;
local_rc_sumAbsLevel = rc_sumAbsLevel;
if (n == local_rc_firstSigScanPos && (local_rc_sumAbsLevel & 1) == 1) {
transCoeffLevel = -transCoeffLevel;
}
}
local_coeff_sign_flag = coeff_sign_flag;
if (local_coeff_sign_flag >> 15 == 1) {
transCoeffLevel = -transCoeffLevel;
}
local_coeff_sign_flag = coeff_sign_flag;
coeff_sign_flag = local_coeff_sign_flag << 1;
local_cu_transquant_bypass_flag = cu_transquant_bypass_flag;
if (local_cu_transquant_bypass_flag == 0) {
local_sps_id = sps_id;
tmp_sps_scaling_list_enabled_flag = sps_scaling_list_enabled_flag[local_sps_id];
if (tmp_sps_scaling_list_enabled_flag == 1) {
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (yC != 0 || xC != 0 || local_rc_log2TrafoSize < 4) {
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 3) {
pos = (yC << 3) + xC;
} else {
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 4) {
pos = ((yC >> 1) << 3) + (xC >> 1);
} else {
local_rc_log2TrafoSize = rc_log2TrafoSize;
if (local_rc_log2TrafoSize == 5) {
pos = ((yC >> 2) << 3) + (xC >> 2);
} else {
pos = (yC << 2) + xC;
}
}
}
tmp_scale_matrix = scale_matrix[pos];
scale_m = tmp_scale_matrix;
} else {
local_dc_scale = dc_scale;
scale_m = local_dc_scale;
}
}
local_scale_m = scale_m;
local_scale = scale;
local_add = add;
local_shift = shift;
transCoeffLevel = HevcDecoder_Algo_Parser_clip_i32((transCoeffLevel * local_scale_m * local_scale + local_add) >> local_shift, -32768, 32767);
}
local_rc_log2TrafoSize = rc_log2TrafoSize;
tabTransCoeffLevel[xC + (1 << local_rc_log2TrafoSize) * yC] = transCoeffLevel;
local_rc_numSigCoeff = rc_numSigCoeff;
rc_numSigCoeff = local_rc_numSigCoeff + 1;
local_rc_m = rc_m;
rc_m = local_rc_m + 1;
// Update ports indexes
}
static i32 isSchedulable_read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_end() {
i32 result;
i8 local_rc_m;
i8 local_m_end;
local_rc_m = rc_m;
local_m_end = m_end;
result = local_rc_m > local_m_end;
return result;
}
static void read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_end() {
i8 local_rc_i;
local_rc_i = rc_i;
rc_i = local_rc_i - 1;
// Update ports indexes
}
////////////////////////////////////////////////////////////////////////////////
// Initializes
void HevcDecoder_Algo_Parser_initialize(schedinfo_t *si) {
int i = 0;
write_CUInfo();
write_IntraPredMode();
write_SliceAddr();
write_TilesCoord();
write_LcuSizeMax();
write_PartMode();
write_IsPicSlcLcu();
write_IsPicSlc();
write_LFAcrossSlcTile();
write_PictSize();
write_Poc();
write_SaoSe();
write_SEI_MD5();
write_SliceType();
write_SplitTransform();
write_TUSize();
write_Coeff();
write_StrongIntraSmoothing();
write_DispCoord();
write_PicSizeInMb();
write_NumRefIdxLxActive();
write_RefPicListModif();
write_RefPoc();
write_MvPredSyntaxElem();
write_Cbf();
write_DBFDisable();
write_DbfSe();
write_ReorderPics();
write_WeightedPred();
write_Qp();
/* Set initial state to current FSM state */
_FSM_state = my_state_start_code;
finished:
write_end_CUInfo();
write_end_IntraPredMode();
write_end_SliceAddr();
write_end_TilesCoord();
write_end_LcuSizeMax();
write_end_PartMode();
write_end_IsPicSlcLcu();
write_end_IsPicSlc();
write_end_LFAcrossSlcTile();
write_end_PictSize();
write_end_Poc();
write_end_SaoSe();
write_end_SEI_MD5();
write_end_SliceType();
write_end_SplitTransform();
write_end_TUSize();
write_end_Coeff();
write_end_StrongIntraSmoothing();
write_end_DispCoord();
write_end_PicSizeInMb();
write_end_NumRefIdxLxActive();
write_end_RefPicListModif();
write_end_RefPoc();
write_end_MvPredSyntaxElem();
write_end_Cbf();
write_end_DBFDisable();
write_end_DbfSe();
write_end_ReorderPics();
write_end_WeightedPred();
write_end_Qp();
return;
}
////////////////////////////////////////////////////////////////////////////////
// Action scheduler
void HevcDecoder_Algo_Parser_outside_FSM_scheduler(schedinfo_t *si) {
int i = 0;
while (1) {
if (numTokens_byte - index_byte >= 1 && isSchedulable_untagged_0()) {
untagged_0();
i++;
} else {
si->num_firings = i;
si->reason = starved;
goto finished;
}
}
finished:
// no read_end/write_end here!
return;
}
void HevcDecoder_Algo_Parser_scheduler(schedinfo_t *si) {
int i = 0;
read_byte();
write_CUInfo();
write_IntraPredMode();
write_SliceAddr();
write_TilesCoord();
write_LcuSizeMax();
write_PartMode();
write_IsPicSlcLcu();
write_IsPicSlc();
write_LFAcrossSlcTile();
write_PictSize();
write_Poc();
write_SaoSe();
write_SEI_MD5();
write_SliceType();
write_SplitTransform();
write_TUSize();
write_Coeff();
write_StrongIntraSmoothing();
write_DispCoord();
write_PicSizeInMb();
write_NumRefIdxLxActive();
write_RefPicListModif();
write_RefPoc();
write_MvPredSyntaxElem();
write_Cbf();
write_DBFDisable();
write_DbfSe();
write_ReorderPics();
write_WeightedPred();
write_Qp();
// jump to FSM state
switch (_FSM_state) {
case my_state_byte_align:
goto l_byte_align;
case my_state_find_header:
goto l_find_header;
case my_state_read_CodingQuadTree:
goto l_read_CodingQuadTree;
case my_state_read_CodingTree:
goto l_read_CodingTree;
case my_state_read_CodingUnit:
goto l_read_CodingUnit;
case my_state_read_MVDCoding:
goto l_read_MVDCoding;
case my_state_read_MVDCoding_end:
goto l_read_MVDCoding_end;
case my_state_read_Nal_unit_header:
goto l_read_Nal_unit_header;
case my_state_read_PCMSample:
goto l_read_PCMSample;
case my_state_read_PCMSampleLoop:
goto l_read_PCMSampleLoop;
case my_state_read_PPS_Header:
goto l_read_PPS_Header;
case my_state_read_PredictionUnit:
goto l_read_PredictionUnit;
case my_state_read_ResidualCoding:
goto l_read_ResidualCoding;
case my_state_read_ResidualCodingGetCoeff:
goto l_read_ResidualCodingGetCoeff;
case my_state_read_ResidualCodingGreater1:
goto l_read_ResidualCodingGreater1;
case my_state_read_ResidualCodingStart:
goto l_read_ResidualCodingStart;
case my_state_read_SEI_Header:
goto l_read_SEI_Header;
case my_state_read_SPS_Header:
goto l_read_SPS_Header;
case my_state_read_SaoParam:
goto l_read_SaoParam;
case my_state_read_SliceData:
goto l_read_SliceData;
case my_state_read_SliceHeader:
goto l_read_SliceHeader;
case my_state_read_TransformTree:
goto l_read_TransformTree;
case my_state_read_TransformUnit:
goto l_read_TransformUnit;
case my_state_read_VPS_Header:
goto l_read_VPS_Header;
case my_state_sendQp:
goto l_sendQp;
case my_state_send_IntraPredMode:
goto l_send_IntraPredMode;
case my_state_start_code:
goto l_start_code;
case my_state_weightedChroma0:
goto l_weightedChroma0;
case my_state_weightedChroma0Offset:
goto l_weightedChroma0Offset;
case my_state_weightedChroma1:
goto l_weightedChroma1;
case my_state_weightedChroma1Offset:
goto l_weightedChroma1Offset;
case my_state_weightedDeltaChroma0:
goto l_weightedDeltaChroma0;
case my_state_weightedDeltaChroma1:
goto l_weightedDeltaChroma1;
case my_state_weightedDeltaLuma0:
goto l_weightedDeltaLuma0;
case my_state_weightedDeltaLuma1:
goto l_weightedDeltaLuma1;
case my_state_weightedLuma0:
goto l_weightedLuma0;
case my_state_weightedLuma1:
goto l_weightedLuma1;
default:
printf("unknown state in HevcDecoder_Algo_Parser.c : %s\n", stateNames[_FSM_state]);
exit(1);
}
// FSM transitions
l_byte_align:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_byte_align_a()) {
byte_align_a();
i++;
goto l_start_code;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_byte_align;
goto finished;
}
l_find_header:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_look_for_VPS_header()) {
look_for_VPS_header();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_look_for_SEI_header()) {
look_for_SEI_header();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_look_for_SPS_header()) {
look_for_SPS_header();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_look_for_PPS_header()) {
look_for_PPS_header();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_look_for_Slice_header()) {
look_for_Slice_header();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_look_for_other_header()) {
look_for_other_header();
i++;
goto l_byte_align;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_find_header;
goto finished;
}
l_read_CodingQuadTree:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_CodingQuadTree_start()) {
read_CodingQuadTree_start();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_case1()) {
read_CodingQuadTree_case1();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_case2()) {
read_CodingQuadTree_case2();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_noCase2()) {
int stop = 0;
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingQuadTree;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 5) % SIZE_CUInfo));
if (isAligned) {
read_CodingQuadTree_noCase2_aligned();
} else {
read_CodingQuadTree_noCase2();
}
}
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_case3()) {
read_CodingQuadTree_case3();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_noCase3()) {
int stop = 0;
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingQuadTree;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 5) % SIZE_CUInfo));
if (isAligned) {
read_CodingQuadTree_noCase3_aligned();
} else {
read_CodingQuadTree_noCase3();
}
}
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_case4()) {
read_CodingQuadTree_case4();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_noCase4()) {
int stop = 0;
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingQuadTree;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 5) % SIZE_CUInfo));
if (isAligned) {
read_CodingQuadTree_noCase4_aligned();
} else {
read_CodingQuadTree_noCase4();
}
}
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_gotoCodingUnit()) {
read_CodingQuadTree_gotoCodingUnit();
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_read_CodingQuadTree_noEnd()) {
read_CodingQuadTree_noEnd();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingQuadTree_end()) {
read_CodingQuadTree_end();
i++;
goto l_read_CodingTree;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_CodingQuadTree;
goto finished;
}
l_read_CodingTree:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_CodingTree_byPassBeforeTileLoop()) {
read_CodingTree_byPassBeforeTileLoop();
i++;
goto l_read_CodingTree;
} else if (isSchedulable_read_CodingTree_byPassBeforeTileEnd()) {
read_CodingTree_byPassBeforeTileEnd();
i++;
goto l_read_CodingTree;
} else if (isSchedulable_read_CodingTree_start()) {
read_CodingTree_start();
i++;
goto l_read_CodingTree;
} else if (isSchedulable_read_CodingTree_gotoSaoParam()) {
read_CodingTree_gotoSaoParam();
i++;
goto l_read_SaoParam;
} else if (isSchedulable_read_CodingTree_noGotoSaoParam()) {
read_CodingTree_noGotoSaoParam();
i++;
goto l_read_CodingTree;
} else if (isSchedulable_read_CodingTree_gotoCodingQuadTree()) {
int stop = 0;
if (1 > SIZE_IsPicSlcLcu - index_IsPicSlcLcu + HevcDecoder_Algo_Parser_IsPicSlcLcu->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_IsPicSlcLcu - index_IsPicSlcLcu + HevcDecoder_Algo_Parser_IsPicSlcLcu->read_inds[1]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingTree;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_CodingTree_gotoCodingQuadTree();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingTree_end()) {
read_CodingTree_end();
i++;
goto l_read_SliceData;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_CodingTree;
goto finished;
}
l_read_CodingUnit:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_CodingUnit_start()) {
read_CodingUnit_start();
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_read_CodingUnit_gotoPredictionUnit_goto1()) {
int stop = 0;
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_Cbf - index_Cbf + HevcDecoder_Algo_Parser_Cbf->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_SplitTransform - index_SplitTransform + HevcDecoder_Algo_Parser_SplitTransform->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_SplitTransform - index_SplitTransform + HevcDecoder_Algo_Parser_SplitTransform->read_inds[1]) {
stop = 1;
}
if (21 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[0]) {
stop = 1;
}
if (21 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[1]) {
stop = 1;
}
if (21 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[2]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 5) % SIZE_CUInfo));
isAligned &= ((index_TUSize % SIZE_TUSize) < ((index_TUSize + 21) % SIZE_TUSize));
if (isAligned) {
read_CodingUnit_gotoPredictionUnit_goto1_aligned();
} else {
read_CodingUnit_gotoPredictionUnit_goto1();
}
}
i++;
goto l_read_PredictionUnit;
} else if (isSchedulable_read_CodingUnit_noGoto1()) {
int stop = 0;
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_CodingUnit_noGoto1();
i++;
goto l_send_IntraPredMode;
} else if (isSchedulable_read_CodingUnit_gotoPCMSample()) {
read_CodingUnit_gotoPCMSample();
i++;
goto l_read_PCMSample;
} else if (isSchedulable_read_CodingUnit_gotoPredictionUnit_goto2()) {
int stop = 0;
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 5) % SIZE_CUInfo));
if (isAligned) {
read_CodingUnit_gotoPredictionUnit_goto2_aligned();
} else {
read_CodingUnit_gotoPredictionUnit_goto2();
}
}
i++;
goto l_read_PredictionUnit;
} else if (isSchedulable_read_CodingUnit_endFunction()) {
read_CodingUnit_endFunction();
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_read_CodingUnit_endFunctionSend()) {
int stop = 0;
if (1 > SIZE_SplitTransform - index_SplitTransform + HevcDecoder_Algo_Parser_SplitTransform->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_SplitTransform - index_SplitTransform + HevcDecoder_Algo_Parser_SplitTransform->read_inds[1]) {
stop = 1;
}
if (21 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[0]) {
stop = 1;
}
if (21 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[1]) {
stop = 1;
}
if (21 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_Cbf - index_Cbf + HevcDecoder_Algo_Parser_Cbf->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_CodingUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_TUSize % SIZE_TUSize) < ((index_TUSize + 21) % SIZE_TUSize));
if (isAligned) {
read_CodingUnit_endFunctionSend_aligned();
} else {
read_CodingUnit_endFunctionSend();
}
}
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_read_CodingUnit_gotoTransformTree()) {
read_CodingUnit_gotoTransformTree();
i++;
goto l_read_TransformTree;
} else if (isSchedulable_read_CodingUnit_end()) {
read_CodingUnit_end();
i++;
goto l_sendQp;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_CodingUnit;
goto finished;
}
l_read_MVDCoding:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_MVDCoding_start()) {
read_MVDCoding_start();
i++;
goto l_read_MVDCoding_end;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_MVDCoding;
goto finished;
}
l_read_MVDCoding_end:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_MVDCoding_ended()) {
read_MVDCoding_ended();
i++;
goto l_read_PredictionUnit;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_MVDCoding_end;
goto finished;
}
l_read_Nal_unit_header:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_nal_unit_header()) {
read_nal_unit_header();
i++;
goto l_find_header;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_Nal_unit_header;
goto finished;
}
l_read_PCMSample:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_PCMSample_start()) {
read_PCMSample_start();
i++;
goto l_read_PCMSampleLoop;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_PCMSample;
goto finished;
}
l_read_PCMSampleLoop:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_PCMSample_skipLoop()) {
read_PCMSample_skipLoop();
i++;
goto l_read_PCMSampleLoop;
} else if (isSchedulable_read_PCMSample_skipLoop_end()) {
read_PCMSample_skipLoop_end();
i++;
goto l_read_CodingUnit;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_PCMSampleLoop;
goto finished;
}
l_read_PPS_Header:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_PPS_Header_se_idx_1()) {
read_PPS_Header_se_idx_1();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_2()) {
read_PPS_Header_se_idx_2();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_3_loop()) {
read_PPS_Header_se_idx_3_loop();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_3_loopEnd()) {
read_PPS_Header_se_idx_3_loopEnd();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_3_noLoop()) {
read_PPS_Header_se_idx_3_noLoop();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_4_loop()) {
read_PPS_Header_se_idx_4_loop();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_4_loopEnd()) {
read_PPS_Header_se_idx_4_loopEnd();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_5()) {
read_PPS_Header_se_idx_5();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_51()) {
read_PPS_Header_se_idx_51();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_50()) {
read_PPS_Header_se_idx_50();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_51_loopSize_id()) {
read_PPS_Header_se_idx_51_loopSize_id();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_53_loopMatrix_id()) {
read_PPS_Header_se_idx_53_loopMatrix_id();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_54_loopNumCoef()) {
read_PPS_Header_se_idx_54_loopNumCoef();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_54_loopNumCoefEnd()) {
read_PPS_Header_se_idx_54_loopNumCoefEnd();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_53_loopMatrix_id_End()) {
read_PPS_Header_se_idx_53_loopMatrix_id_End();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_se_idx_51_loopSize_id_End()) {
read_PPS_Header_se_idx_51_loopSize_id_End();
i++;
goto l_read_PPS_Header;
} else if (isSchedulable_read_PPS_Header_done()) {
read_PPS_Header_done();
i++;
goto l_byte_align;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_PPS_Header;
goto finished;
}
l_read_PredictionUnit:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_PredictionUnit_start()) {
read_PredictionUnit_start();
i++;
goto l_read_PredictionUnit;
} else if (isSchedulable_read_PredictionUnit_retMVDcoding_goto1()) {
read_PredictionUnit_retMVDcoding_goto1();
i++;
goto l_read_PredictionUnit;
} else if (isSchedulable_read_PredictionUnit_gotoMVDCoding()) {
read_PredictionUnit_gotoMVDCoding();
i++;
goto l_read_MVDCoding;
} else if (isSchedulable_read_PredictionUnit_retMVDcoding_goto2()) {
read_PredictionUnit_retMVDcoding_goto2();
i++;
goto l_read_PredictionUnit;
} else if (isSchedulable_read_PredictionUnit_end_mergeIdx_Eq_min1()) {
int stop = 0;
if (9 > SIZE_MvPredSyntaxElem - index_MvPredSyntaxElem + HevcDecoder_Algo_Parser_MvPredSyntaxElem->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_PredictionUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) < ((index_MvPredSyntaxElem + 9) % SIZE_MvPredSyntaxElem));
if (isAligned) {
read_PredictionUnit_end_mergeIdx_Eq_min1_aligned();
} else {
read_PredictionUnit_end_mergeIdx_Eq_min1();
}
}
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_read_PredictionUnit_end_mergeIdx_notEq_min1()) {
int stop = 0;
if (5 > SIZE_MvPredSyntaxElem - index_MvPredSyntaxElem + HevcDecoder_Algo_Parser_MvPredSyntaxElem->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_PredictionUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) < ((index_MvPredSyntaxElem + 5) % SIZE_MvPredSyntaxElem));
if (isAligned) {
read_PredictionUnit_end_mergeIdx_notEq_min1_aligned();
} else {
read_PredictionUnit_end_mergeIdx_notEq_min1();
}
}
i++;
goto l_read_CodingUnit;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_PredictionUnit;
goto finished;
}
l_read_ResidualCoding:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_ResidualCoding_start()) {
int stop = 0;
if (7 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[0]) {
stop = 1;
}
if (7 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[1]) {
stop = 1;
}
if (7 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[2]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_ResidualCoding;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_TUSize % SIZE_TUSize) < ((index_TUSize + 7) % SIZE_TUSize));
if (isAligned) {
read_ResidualCoding_start_aligned();
} else {
read_ResidualCoding_start();
}
}
i++;
goto l_read_ResidualCodingStart;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_ResidualCoding;
goto finished;
}
l_read_ResidualCodingGetCoeff:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_end()) {
read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_end();
i++;
goto l_read_ResidualCodingStart;
} else if (isSchedulable_read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL()) {
read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL();
i++;
goto l_read_ResidualCodingGetCoeff;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_ResidualCodingGetCoeff;
goto finished;
}
l_read_ResidualCodingGreater1:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_GREATER1_FLAG()) {
read_ResidualCoding_for_numLastSubset_get_COEFF_ABS_LEVEL_GREATER1_FLAG();
i++;
goto l_read_ResidualCodingGetCoeff;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_ResidualCodingGreater1;
goto finished;
}
l_read_ResidualCodingStart:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_ResidualCoding_end_xIT4()) {
int stop = 0;
if (16 > SIZE_Coeff - index_Coeff + HevcDecoder_Algo_Parser_Coeff->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_ResidualCodingStart;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Coeff % SIZE_Coeff) < ((index_Coeff + 16) % SIZE_Coeff));
if (isAligned) {
read_ResidualCoding_end_xIT4_aligned();
} else {
read_ResidualCoding_end_xIT4();
}
}
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_ResidualCoding_end_xIT8()) {
int stop = 0;
if (64 > SIZE_Coeff - index_Coeff + HevcDecoder_Algo_Parser_Coeff->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_ResidualCodingStart;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Coeff % SIZE_Coeff) < ((index_Coeff + 64) % SIZE_Coeff));
if (isAligned) {
read_ResidualCoding_end_xIT8_aligned();
} else {
read_ResidualCoding_end_xIT8();
}
}
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_ResidualCoding_end_xIT16()) {
int stop = 0;
if (256 > SIZE_Coeff - index_Coeff + HevcDecoder_Algo_Parser_Coeff->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_ResidualCodingStart;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Coeff % SIZE_Coeff) < ((index_Coeff + 256) % SIZE_Coeff));
if (isAligned) {
read_ResidualCoding_end_xIT16_aligned();
} else {
read_ResidualCoding_end_xIT16();
}
}
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_ResidualCoding_end_xIT32()) {
int stop = 0;
if (1024 > SIZE_Coeff - index_Coeff + HevcDecoder_Algo_Parser_Coeff->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_ResidualCodingStart;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Coeff % SIZE_Coeff) < ((index_Coeff + 1024) % SIZE_Coeff));
if (isAligned) {
read_ResidualCoding_end_xIT32_aligned();
} else {
read_ResidualCoding_end_xIT32();
}
}
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_ResidualCoding_for_numLastSubset_start()) {
read_ResidualCoding_for_numLastSubset_start();
i++;
goto l_read_ResidualCodingGreater1;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_ResidualCodingStart;
goto finished;
}
l_read_SEI_Header:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_SEI_Header_init()) {
read_SEI_Header_init();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_payload_type()) {
read_SEI_Header_payload_type();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_payload_size()) {
read_SEI_Header_payload_size();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_skipSEI()) {
read_SEI_Header_skipSEI();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_decoded_picture_hash_init()) {
read_SEI_Header_decoded_picture_hash_init();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_decoded_picture_hash_loop()) {
int stop = 0;
if (1 > SIZE_SEI_MD5 - index_SEI_MD5 + HevcDecoder_Algo_Parser_SEI_MD5->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SEI_Header;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SEI_Header_decoded_picture_hash_loop();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_decoded_picture_hash_skip()) {
read_SEI_Header_decoded_picture_hash_skip();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_sei_payload_end()) {
read_SEI_Header_sei_payload_end();
i++;
goto l_read_SEI_Header;
} else if (isSchedulable_read_SEI_Header_done()) {
read_SEI_Header_done();
i++;
goto l_byte_align;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_SEI_Header;
goto finished;
}
l_read_SPS_Header:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_SPS_Header_se_idx_1()) {
read_SPS_Header_se_idx_1();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_20()) {
read_SPS_Header_se_idx_20();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_21()) {
read_SPS_Header_se_idx_21();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_22_loop1()) {
read_SPS_Header_se_idx_22_loop1();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_22_loopEnd1()) {
read_SPS_Header_se_idx_22_loopEnd1();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_22_indertedCond()) {
read_SPS_Header_se_idx_22_indertedCond();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_22_loop2()) {
read_SPS_Header_se_idx_22_loop2();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_22_loopEnd()) {
read_SPS_Header_se_idx_22_loopEnd();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_1_1()) {
read_SPS_Header_se_idx_1_1();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_2()) {
read_SPS_Header_se_idx_2();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_3_loop()) {
read_SPS_Header_se_idx_3_loop();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_3_loopEnd()) {
read_SPS_Header_se_idx_3_loopEnd();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_4()) {
read_SPS_Header_se_idx_4();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_5()) {
read_SPS_Header_se_idx_5();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_60()) {
read_SPS_Header_se_idx_60();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_61_loopSize_id()) {
read_SPS_Header_se_idx_61_loopSize_id();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_61_loopMatrix_id()) {
read_SPS_Header_se_idx_61_loopMatrix_id();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_63_loopNumCoef()) {
read_SPS_Header_se_idx_63_loopNumCoef();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_63_loopNumCoefEnd()) {
read_SPS_Header_se_idx_63_loopNumCoefEnd();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_62_loopMatrix_id_End()) {
read_SPS_Header_se_idx_62_loopMatrix_id_End();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_61_size_id_loopEnd()) {
read_SPS_Header_se_idx_61_size_id_loopEnd();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_6()) {
read_SPS_Header_se_idx_6();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_7_loop()) {
read_SPS_Header_se_idx_7_loop();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_7_loopEnd()) {
read_SPS_Header_se_idx_7_loopEnd();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_se_idx_8()) {
read_SPS_Header_se_idx_8();
i++;
goto l_read_SPS_Header;
} else if (isSchedulable_read_SPS_Header_done()) {
read_SPS_Header_done();
i++;
goto l_byte_align;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_SPS_Header;
goto finished;
}
l_read_SaoParam:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_SaoParam_start()) {
int stop = 0;
if (1 > SIZE_SaoSe - index_SaoSe + HevcDecoder_Algo_Parser_SaoSe->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SaoParam;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SaoParam_start();
i++;
goto l_read_SaoParam;
} else if (isSchedulable_read_SaoParam_loop1()) {
int stop = 0;
if (1 > SIZE_SaoSe - index_SaoSe + HevcDecoder_Algo_Parser_SaoSe->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SaoParam;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SaoParam_loop1();
i++;
goto l_read_SaoParam;
} else if (isSchedulable_read_SaoParam_loop2()) {
int stop = 0;
if (5 > SIZE_SaoSe - index_SaoSe + HevcDecoder_Algo_Parser_SaoSe->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SaoParam;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_SaoSe % SIZE_SaoSe) < ((index_SaoSe + 5) % SIZE_SaoSe));
if (isAligned) {
read_SaoParam_loop2_aligned();
} else {
read_SaoParam_loop2();
}
}
i++;
goto l_read_SaoParam;
} else if (isSchedulable_read_SaoParam_nextLoop()) {
read_SaoParam_nextLoop();
i++;
goto l_read_SaoParam;
} else if (isSchedulable_read_SaoParam_endLoop()) {
read_SaoParam_endLoop();
i++;
goto l_read_CodingTree;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_SaoParam;
goto finished;
}
l_read_SliceData:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_SliceData_init()) {
int stop = 0;
if (1 > SIZE_IsPicSlcLcu - index_IsPicSlcLcu + HevcDecoder_Algo_Parser_IsPicSlcLcu->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_IsPicSlcLcu - index_IsPicSlcLcu + HevcDecoder_Algo_Parser_IsPicSlcLcu->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_IsPicSlc - index_IsPicSlc + HevcDecoder_Algo_Parser_IsPicSlc->read_inds[0]) {
stop = 1;
}
if (4 > SIZE_MvPredSyntaxElem - index_MvPredSyntaxElem + HevcDecoder_Algo_Parser_MvPredSyntaxElem->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_SaoSe - index_SaoSe + HevcDecoder_Algo_Parser_SaoSe->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[4]) {
stop = 1;
}
if (2 > SIZE_PicSizeInMb - index_PicSizeInMb + HevcDecoder_Algo_Parser_PicSizeInMb->read_inds[0]) {
stop = 1;
}
if (2 > SIZE_PicSizeInMb - index_PicSizeInMb + HevcDecoder_Algo_Parser_PicSizeInMb->read_inds[1]) {
stop = 1;
}
if (4 > SIZE_DispCoord - index_DispCoord + HevcDecoder_Algo_Parser_DispCoord->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_LFAcrossSlcTile - index_LFAcrossSlcTile + HevcDecoder_Algo_Parser_LFAcrossSlcTile->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_LFAcrossSlcTile - index_LFAcrossSlcTile + HevcDecoder_Algo_Parser_LFAcrossSlcTile->read_inds[1]) {
stop = 1;
}
if (4 > SIZE_ReorderPics - index_ReorderPics + HevcDecoder_Algo_Parser_ReorderPics->read_inds[0]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[0]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[1]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[2]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[3]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceData;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) < ((index_MvPredSyntaxElem + 4) % SIZE_MvPredSyntaxElem));
isAligned &= ((index_PictSize % SIZE_PictSize) < ((index_PictSize + 2) % SIZE_PictSize));
if (isAligned) {
read_SliceData_init_aligned();
} else {
read_SliceData_init();
}
}
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_sendInfoSlice()) {
int stop = 0;
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[0]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[1]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[2]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[3]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceData;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_TilesCoord % SIZE_TilesCoord) < ((index_TilesCoord + 4) % SIZE_TilesCoord));
if (isAligned) {
read_SliceData_sendInfoSlice_aligned();
} else {
read_SliceData_sendInfoSlice();
}
}
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_sendInfoTilesLoop()) {
int stop = 0;
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[0]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[1]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[2]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[3]) {
stop = 1;
}
if (4 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceData;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_TilesCoord % SIZE_TilesCoord) < ((index_TilesCoord + 4) % SIZE_TilesCoord));
if (isAligned) {
read_SliceData_sendInfoTilesLoop_aligned();
} else {
read_SliceData_sendInfoTilesLoop();
}
}
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_sendRealInfoTilesLoop()) {
read_SliceData_sendRealInfoTilesLoop();
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_senInfoTilesEnd()) {
read_SliceData_senInfoTilesEnd();
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_senRealInfoTilesEnd()) {
read_SliceData_senRealInfoTilesEnd();
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_noInit()) {
int stop = 0;
if (2 > SIZE_MvPredSyntaxElem - index_MvPredSyntaxElem + HevcDecoder_Algo_Parser_MvPredSyntaxElem->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceData;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) < ((index_MvPredSyntaxElem + 2) % SIZE_MvPredSyntaxElem));
if (isAligned) {
read_SliceData_noInit_aligned();
} else {
read_SliceData_noInit();
}
}
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_noInit_isSlc()) {
int stop = 0;
if (4 > SIZE_MvPredSyntaxElem - index_MvPredSyntaxElem + HevcDecoder_Algo_Parser_MvPredSyntaxElem->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_IsPicSlcLcu - index_IsPicSlcLcu + HevcDecoder_Algo_Parser_IsPicSlcLcu->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_IsPicSlcLcu - index_IsPicSlcLcu + HevcDecoder_Algo_Parser_IsPicSlcLcu->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_TilesCoord - index_TilesCoord + HevcDecoder_Algo_Parser_TilesCoord->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_LFAcrossSlcTile - index_LFAcrossSlcTile + HevcDecoder_Algo_Parser_LFAcrossSlcTile->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_LFAcrossSlcTile - index_LFAcrossSlcTile + HevcDecoder_Algo_Parser_LFAcrossSlcTile->read_inds[1]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[0]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[1]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[2]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[3]) {
stop = 1;
}
if (2 > SIZE_PictSize - index_PictSize + HevcDecoder_Algo_Parser_PictSize->read_inds[4]) {
stop = 1;
}
if (1 > SIZE_IsPicSlc - index_IsPicSlc + HevcDecoder_Algo_Parser_IsPicSlc->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceData;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_MvPredSyntaxElem % SIZE_MvPredSyntaxElem) < ((index_MvPredSyntaxElem + 4) % SIZE_MvPredSyntaxElem));
isAligned &= ((index_PictSize % SIZE_PictSize) < ((index_PictSize + 2) % SIZE_PictSize));
if (isAligned) {
read_SliceData_noInit_isSlc_aligned();
} else {
read_SliceData_noInit_isSlc();
}
}
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_start()) {
int stop = 0;
if (2 > SIZE_SliceAddr - index_SliceAddr + HevcDecoder_Algo_Parser_SliceAddr->read_inds[0]) {
stop = 1;
}
if (2 > SIZE_SliceAddr - index_SliceAddr + HevcDecoder_Algo_Parser_SliceAddr->read_inds[1]) {
stop = 1;
}
if (2 > SIZE_SliceAddr - index_SliceAddr + HevcDecoder_Algo_Parser_SliceAddr->read_inds[2]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceData;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceData_start_aligned();
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_gotoCodingTree_start()) {
read_SliceData_gotoCodingTree_start();
i++;
goto l_read_CodingTree;
} else if (isSchedulable_read_SliceData_gotoCodingTree_byPass()) {
read_SliceData_gotoCodingTree_byPass();
i++;
goto l_read_CodingTree;
} else if (isSchedulable_read_SliceData_retCodingTree()) {
read_SliceData_retCodingTree();
i++;
goto l_read_SliceData;
} else if (isSchedulable_read_SliceData_end()) {
read_SliceData_end();
i++;
goto l_byte_align;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_SliceData;
goto finished;
}
l_read_SliceHeader:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_SliceHeader_se_idx_1()) {
int stop = 0;
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_PartMode - index_PartMode + HevcDecoder_Algo_Parser_PartMode->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_se_idx_1();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_11()) {
int stop = 0;
if (1 > SIZE_Poc - index_Poc + HevcDecoder_Algo_Parser_Poc->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_Poc - index_Poc + HevcDecoder_Algo_Parser_Poc->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_Poc - index_Poc + HevcDecoder_Algo_Parser_Poc->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_SliceType - index_SliceType + HevcDecoder_Algo_Parser_SliceType->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_SliceType - index_SliceType + HevcDecoder_Algo_Parser_SliceType->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_LcuSizeMax - index_LcuSizeMax + HevcDecoder_Algo_Parser_LcuSizeMax->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_LcuSizeMax - index_LcuSizeMax + HevcDecoder_Algo_Parser_LcuSizeMax->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_LcuSizeMax - index_LcuSizeMax + HevcDecoder_Algo_Parser_LcuSizeMax->read_inds[2]) {
stop = 1;
}
if (1 > SIZE_LcuSizeMax - index_LcuSizeMax + HevcDecoder_Algo_Parser_LcuSizeMax->read_inds[3]) {
stop = 1;
}
if (1 > SIZE_LcuSizeMax - index_LcuSizeMax + HevcDecoder_Algo_Parser_LcuSizeMax->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_se_idx_11();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_12()) {
read_SliceHeader_se_idx_12();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_12_loop1()) {
read_SliceHeader_se_idx_12_loop1();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_12_end_loop1()) {
read_SliceHeader_se_idx_12_end_loop1();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_12_loop2()) {
read_SliceHeader_se_idx_12_loop2();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_12_end_loop2()) {
read_SliceHeader_se_idx_12_end_loop2();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_13()) {
read_SliceHeader_se_idx_13();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_14()) {
read_SliceHeader_se_idx_14();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_2()) {
read_SliceHeader_se_idx_2();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendRefPOC_init()) {
int stop = 0;
if (2 > SIZE_NumRefIdxLxActive - index_NumRefIdxLxActive + HevcDecoder_Algo_Parser_NumRefIdxLxActive->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendRefPOC_init_aligned();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendListEntryL0Flag()) {
int stop = 0;
if (1 > SIZE_RefPicListModif - index_RefPicListModif + HevcDecoder_Algo_Parser_RefPicListModif->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendListEntryL0Flag();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendListEntryL0Loop()) {
int stop = 0;
if (1 > SIZE_RefPicListModif - index_RefPicListModif + HevcDecoder_Algo_Parser_RefPicListModif->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendListEntryL0Loop();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendListEntryL0End()) {
read_SliceHeader_sendListEntryL0End();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendListEntryL1Flag()) {
int stop = 0;
if (1 > SIZE_RefPicListModif - index_RefPicListModif + HevcDecoder_Algo_Parser_RefPicListModif->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendListEntryL1Flag();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendListEntryL1Loop()) {
int stop = 0;
if (1 > SIZE_RefPicListModif - index_RefPicListModif + HevcDecoder_Algo_Parser_RefPicListModif->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendListEntryL1Loop();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendListEntryL1End()) {
read_SliceHeader_sendListEntryL1End();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendRefPOC_sendSize()) {
int stop = 0;
if (1 > SIZE_RefPoc - index_RefPoc + HevcDecoder_Algo_Parser_RefPoc->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_RefPoc - index_RefPoc + HevcDecoder_Algo_Parser_RefPoc->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_RefPoc - index_RefPoc + HevcDecoder_Algo_Parser_RefPoc->read_inds[2]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendRefPOC_sendSize();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_sendRefPOC_sendRefPoc()) {
int stop = 0;
if (1 > SIZE_RefPoc - index_RefPoc + HevcDecoder_Algo_Parser_RefPoc->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_RefPoc - index_RefPoc + HevcDecoder_Algo_Parser_RefPoc->read_inds[1]) {
stop = 1;
}
if (1 > SIZE_RefPoc - index_RefPoc + HevcDecoder_Algo_Parser_RefPoc->read_inds[2]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_sendRefPOC_sendRefPoc();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_3()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_se_idx_3();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_weighted_start()) {
int stop = 0;
if (2 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_WeightedPred % SIZE_WeightedPred) < ((index_WeightedPred + 2) % SIZE_WeightedPred));
if (isAligned) {
weighted_start_aligned();
} else {
weighted_start();
}
}
i++;
goto l_weightedLuma0;
} else if (isSchedulable_read_SliceHeader_se_idx_5()) {
int stop = 0;
if (1 > SIZE_DBFDisable - index_DBFDisable + HevcDecoder_Algo_Parser_DBFDisable->read_inds[0]) {
stop = 1;
}
if (4 > SIZE_DbfSe - index_DbfSe + HevcDecoder_Algo_Parser_DbfSe->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
if (isAligned) {
read_SliceHeader_se_idx_5_aligned();
} else {
read_SliceHeader_se_idx_5();
}
}
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_6()) {
read_SliceHeader_se_idx_6();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_7_loop()) {
read_SliceHeader_se_idx_7_loop();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_7_endLoop()) {
read_SliceHeader_se_idx_7_endLoop();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_8()) {
read_SliceHeader_se_idx_8();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_9_loop()) {
read_SliceHeader_se_idx_9_loop();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_se_idx_9_endLoop()) {
read_SliceHeader_se_idx_9_endLoop();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_read_SliceHeader_done()) {
int stop = 0;
if (2 > SIZE_StrongIntraSmoothing - index_StrongIntraSmoothing + HevcDecoder_Algo_Parser_StrongIntraSmoothing->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_SliceHeader;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_SliceHeader_done_aligned();
i++;
goto l_read_SliceData;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_SliceHeader;
goto finished;
}
l_read_TransformTree:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_TransformTree_start()) {
read_TransformTree_start();
i++;
goto l_read_TransformTree;
} else if (isSchedulable_read_TransformTree_start_nonPartNxN()) {
int stop = 0;
if (1 > SIZE_SplitTransform - index_SplitTransform + HevcDecoder_Algo_Parser_SplitTransform->read_inds[0]) {
stop = 1;
}
if (1 > SIZE_SplitTransform - index_SplitTransform + HevcDecoder_Algo_Parser_SplitTransform->read_inds[1]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_TransformTree;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_TransformTree_start_nonPartNxN();
i++;
goto l_read_TransformTree;
} else if (isSchedulable_read_TransformTree_gotoTransformUnit()) {
int stop = 0;
if (1 > SIZE_Cbf - index_Cbf + HevcDecoder_Algo_Parser_Cbf->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_TransformTree;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_TransformTree_gotoTransformUnit();
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_TransformTree_gotoTransformTree()) {
read_TransformTree_gotoTransformTree();
i++;
goto l_read_TransformTree;
} else if (isSchedulable_read_TransformTree_end()) {
read_TransformTree_end();
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_read_TransformTree_endCall()) {
read_TransformTree_endCall();
i++;
goto l_read_TransformTree;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_TransformTree;
goto finished;
}
l_read_TransformUnit:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_TransformUnit_start()) {
read_TransformUnit_start();
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_TransformUnit_retLuma()) {
read_TransformUnit_retLuma();
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_TransformUnit_retCb()) {
read_TransformUnit_retCb();
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_TransformUnit_gotoResidualCoding()) {
read_TransformUnit_gotoResidualCoding();
i++;
goto l_read_ResidualCoding;
} else if (isSchedulable_read_TransformUnit_skipResidualCoding()) {
int stop = 0;
if (7 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[0]) {
stop = 1;
}
if (7 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[1]) {
stop = 1;
}
if (7 > SIZE_TUSize - index_TUSize + HevcDecoder_Algo_Parser_TUSize->read_inds[2]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_read_TransformUnit;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_TUSize % SIZE_TUSize) < ((index_TUSize + 7) % SIZE_TUSize));
if (isAligned) {
read_TransformUnit_skipResidualCoding_aligned();
} else {
read_TransformUnit_skipResidualCoding();
}
}
i++;
goto l_read_TransformUnit;
} else if (isSchedulable_read_TransformUnit_end()) {
read_TransformUnit_end();
i++;
goto l_read_TransformTree;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_TransformUnit;
goto finished;
}
l_read_VPS_Header:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_VPS_Header_se_idx_1()) {
read_VPS_Header_se_idx_1();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_2()) {
read_VPS_Header_se_idx_2();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_3()) {
read_VPS_Header_se_idx_3();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_4_loop1()) {
read_VPS_Header_se_idx_4_loop1();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_4_insertedCond()) {
read_VPS_Header_se_idx_4_insertedCond();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_4_loop2()) {
read_VPS_Header_se_idx_4_loop2();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_4_loop1End()) {
read_VPS_Header_se_idx_4_loop1End();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_4_loop2End()) {
read_VPS_Header_se_idx_4_loop2End();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_4_decodeInfoPresentFlag()) {
read_VPS_Header_se_idx_4_decodeInfoPresentFlag();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_5_loop11()) {
read_VPS_Header_se_idx_5_loop11();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_5_loopEnd()) {
read_VPS_Header_se_idx_5_loopEnd();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_6_loop()) {
read_VPS_Header_se_idx_6_loop();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_6_loopEnd()) {
read_VPS_Header_se_idx_6_loopEnd();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_7()) {
read_VPS_Header_se_idx_7();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_8()) {
read_VPS_Header_se_idx_8();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_9_loop()) {
read_VPS_Header_se_idx_9_loop();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_se_idx_9_loopEnd()) {
read_VPS_Header_se_idx_9_loopEnd();
i++;
goto l_read_VPS_Header;
} else if (isSchedulable_read_VPS_Header_done()) {
read_VPS_Header_done();
i++;
goto l_byte_align;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_read_VPS_Header;
goto finished;
}
l_sendQp:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_read_CodingUnit_end_sendQp_blk4x4()) {
int stop = 0;
if (1 > SIZE_Qp - index_Qp + HevcDecoder_Algo_Parser_Qp->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_sendQp;
si->num_firings = i;
si->reason = full;
goto finished;
}
read_CodingUnit_end_sendQp_blk4x4();
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingUnit_end_sendQp_blk8x8()) {
int stop = 0;
if (4 > SIZE_Qp - index_Qp + HevcDecoder_Algo_Parser_Qp->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_sendQp;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Qp % SIZE_Qp) < ((index_Qp + 4) % SIZE_Qp));
if (isAligned) {
read_CodingUnit_end_sendQp_blk8x8_aligned();
} else {
read_CodingUnit_end_sendQp_blk8x8();
}
}
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingUnit_end_sendQp_blk16x16()) {
int stop = 0;
if (16 > SIZE_Qp - index_Qp + HevcDecoder_Algo_Parser_Qp->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_sendQp;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Qp % SIZE_Qp) < ((index_Qp + 16) % SIZE_Qp));
if (isAligned) {
read_CodingUnit_end_sendQp_blk16x16_aligned();
} else {
read_CodingUnit_end_sendQp_blk16x16();
}
}
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingUnit_end_sendQp_blk32x32()) {
int stop = 0;
if (64 > SIZE_Qp - index_Qp + HevcDecoder_Algo_Parser_Qp->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_sendQp;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Qp % SIZE_Qp) < ((index_Qp + 64) % SIZE_Qp));
if (isAligned) {
read_CodingUnit_end_sendQp_blk32x32_aligned();
} else {
read_CodingUnit_end_sendQp_blk32x32();
}
}
i++;
goto l_read_CodingQuadTree;
} else if (isSchedulable_read_CodingUnit_end_sendQp_blk64x64()) {
int stop = 0;
if (256 > SIZE_Qp - index_Qp + HevcDecoder_Algo_Parser_Qp->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_sendQp;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_Qp % SIZE_Qp) < ((index_Qp + 256) % SIZE_Qp));
if (isAligned) {
read_CodingUnit_end_sendQp_blk64x64_aligned();
} else {
read_CodingUnit_end_sendQp_blk64x64();
}
}
i++;
goto l_read_CodingQuadTree;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_sendQp;
goto finished;
}
l_send_IntraPredMode:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_sendIntraPredMode_skip()) {
sendIntraPredMode_skip();
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_sendIntraPredMode_part2Nx2N()) {
int stop = 0;
if (2 > SIZE_IntraPredMode - index_IntraPredMode + HevcDecoder_Algo_Parser_IntraPredMode->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (5 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_send_IntraPredMode;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_IntraPredMode % SIZE_IntraPredMode) < ((index_IntraPredMode + 2) % SIZE_IntraPredMode));
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 5) % SIZE_CUInfo));
if (isAligned) {
sendIntraPredMode_part2Nx2N_aligned();
} else {
sendIntraPredMode_part2Nx2N();
}
}
i++;
goto l_read_CodingUnit;
} else if (isSchedulable_sendIntraPredMode_partNxN()) {
int stop = 0;
if (8 > SIZE_IntraPredMode - index_IntraPredMode + HevcDecoder_Algo_Parser_IntraPredMode->read_inds[0]) {
stop = 1;
}
if (20 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[0]) {
stop = 1;
}
if (20 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[1]) {
stop = 1;
}
if (20 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[2]) {
stop = 1;
}
if (20 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[3]) {
stop = 1;
}
if (20 > SIZE_CUInfo - index_CUInfo + HevcDecoder_Algo_Parser_CUInfo->read_inds[4]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_send_IntraPredMode;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_IntraPredMode % SIZE_IntraPredMode) < ((index_IntraPredMode + 8) % SIZE_IntraPredMode));
isAligned &= ((index_CUInfo % SIZE_CUInfo) < ((index_CUInfo + 20) % SIZE_CUInfo));
if (isAligned) {
sendIntraPredMode_partNxN_aligned();
} else {
sendIntraPredMode_partNxN();
}
}
i++;
goto l_read_CodingUnit;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_send_IntraPredMode;
goto finished;
}
l_start_code:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_start_code_search()) {
start_code_search();
i++;
goto l_start_code;
} else if (isSchedulable_start_code_done()) {
start_code_done();
i++;
goto l_read_Nal_unit_header;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_start_code;
goto finished;
}
l_weightedChroma0:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_end_chroma_l0()) {
weighted_end_chroma_l0();
i++;
goto l_weightedDeltaLuma0;
} else if (isSchedulable_weighted_chroma_l0()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedChroma0;
si->num_firings = i;
si->reason = full;
goto finished;
}
weighted_chroma_l0();
i++;
goto l_weightedChroma0;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedChroma0;
goto finished;
}
l_weightedChroma0Offset:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_deltaChroma_offset_l0_send()) {
int stop = 0;
if (3 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedChroma0Offset;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_WeightedPred % SIZE_WeightedPred) < ((index_WeightedPred + 3) % SIZE_WeightedPred));
if (isAligned) {
weighted_deltaChroma_offset_l0_send_aligned();
} else {
weighted_deltaChroma_offset_l0_send();
}
}
i++;
goto l_weightedDeltaLuma0;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedChroma0Offset;
goto finished;
}
l_weightedChroma1:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_chroma_l1_skip()) {
weighted_chroma_l1_skip();
i++;
goto l_weightedDeltaLuma1;
} else if (isSchedulable_weighted_end_chroma_l1()) {
weighted_end_chroma_l1();
i++;
goto l_weightedDeltaLuma1;
} else if (isSchedulable_weighted_chroma_l1()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedChroma1;
si->num_firings = i;
si->reason = full;
goto finished;
}
weighted_chroma_l1();
i++;
goto l_weightedChroma1;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedChroma1;
goto finished;
}
l_weightedChroma1Offset:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_deltaChroma_offset_l1_send()) {
int stop = 0;
if (3 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedChroma1Offset;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_WeightedPred % SIZE_WeightedPred) < ((index_WeightedPred + 3) % SIZE_WeightedPred));
if (isAligned) {
weighted_deltaChroma_offset_l1_send_aligned();
} else {
weighted_deltaChroma_offset_l1_send();
}
}
i++;
goto l_weightedDeltaLuma1;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedChroma1Offset;
goto finished;
}
l_weightedDeltaChroma0:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_deltaChroma_l0_skip()) {
weighted_deltaChroma_l0_skip();
i++;
goto l_weightedDeltaLuma0;
} else if (isSchedulable_weighted_deltaChroma_l0_send()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedDeltaChroma0;
si->num_firings = i;
si->reason = full;
goto finished;
}
weighted_deltaChroma_l0_send();
i++;
goto l_weightedChroma0Offset;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedDeltaChroma0;
goto finished;
}
l_weightedDeltaChroma1:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_deltaChroma_l1_skip()) {
weighted_deltaChroma_l1_skip();
i++;
goto l_weightedDeltaLuma1;
} else if (isSchedulable_weighted_deltaChroma_l1_send()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedDeltaChroma1;
si->num_firings = i;
si->reason = full;
goto finished;
}
weighted_deltaChroma_l1_send();
i++;
goto l_weightedChroma1Offset;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedDeltaChroma1;
goto finished;
}
l_weightedDeltaLuma0:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_deltaLuma_l0_skip_loop_done()) {
weighted_deltaLuma_l0_skip_loop_done();
i++;
goto l_weightedLuma1;
} else if (isSchedulable_weighted_deltaLuma_l0__skip_all()) {
weighted_deltaLuma_l0__skip_all();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_weighted_deltaLuma_l0_send()) {
int stop = 0;
if (2 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedDeltaLuma0;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_WeightedPred % SIZE_WeightedPred) < ((index_WeightedPred + 2) % SIZE_WeightedPred));
if (isAligned) {
weighted_deltaLuma_l0_send_aligned();
} else {
weighted_deltaLuma_l0_send();
}
}
i++;
goto l_weightedDeltaChroma0;
} else if (isSchedulable_weighted_deltaLuma_l0_skip()) {
weighted_deltaLuma_l0_skip();
i++;
goto l_weightedDeltaChroma0;
} else if (isSchedulable_weighted_deltaLuma_l0_skip_loop()) {
weighted_deltaLuma_l0_skip_loop();
i++;
goto l_weightedDeltaLuma0;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedDeltaLuma0;
goto finished;
}
l_weightedDeltaLuma1:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_deltaLuma_l1_skip_loop_done()) {
weighted_deltaLuma_l1_skip_loop_done();
i++;
goto l_read_SliceHeader;
} else if (isSchedulable_weighted_deltaLuma_l1_send()) {
int stop = 0;
if (2 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedDeltaLuma1;
si->num_firings = i;
si->reason = full;
goto finished;
}
{
int isAligned = 1;
isAligned &= ((index_WeightedPred % SIZE_WeightedPred) < ((index_WeightedPred + 2) % SIZE_WeightedPred));
if (isAligned) {
weighted_deltaLuma_l1_send_aligned();
} else {
weighted_deltaLuma_l1_send();
}
}
i++;
goto l_weightedDeltaChroma1;
} else if (isSchedulable_weighted_deltaLuma_l1_skip()) {
weighted_deltaLuma_l1_skip();
i++;
goto l_weightedDeltaChroma1;
} else if (isSchedulable_weighted_deltaLuma_l1_skip_loop()) {
weighted_deltaLuma_l1_skip_loop();
i++;
goto l_weightedDeltaLuma1;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedDeltaLuma1;
goto finished;
}
l_weightedLuma0:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_end_luma_l0()) {
weighted_end_luma_l0();
i++;
goto l_weightedChroma0;
} else if (isSchedulable_weighted_luma_l0()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedLuma0;
si->num_firings = i;
si->reason = full;
goto finished;
}
weighted_luma_l0();
i++;
goto l_weightedLuma0;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedLuma0;
goto finished;
}
l_weightedLuma1:
HevcDecoder_Algo_Parser_outside_FSM_scheduler(si);
i += si->num_firings;
if (isSchedulable_weighted_end_luma_l1()) {
weighted_end_luma_l1();
i++;
goto l_weightedChroma1;
} else if (isSchedulable_weighted_luma_l1()) {
int stop = 0;
if (1 > SIZE_WeightedPred - index_WeightedPred + HevcDecoder_Algo_Parser_WeightedPred->read_inds[0]) {
stop = 1;
}
if (stop != 0) {
_FSM_state = my_state_weightedLuma1;
si->num_firings = i;
si->reason = full;
goto finished;
}
weighted_luma_l1();
i++;
goto l_weightedLuma1;
} else {
si->num_firings = i;
si->reason = starved;
_FSM_state = my_state_weightedLuma1;
goto finished;
}
finished:
read_end_byte();
write_end_CUInfo();
write_end_IntraPredMode();
write_end_SliceAddr();
write_end_TilesCoord();
write_end_LcuSizeMax();
write_end_PartMode();
write_end_IsPicSlcLcu();
write_end_IsPicSlc();
write_end_LFAcrossSlcTile();
write_end_PictSize();
write_end_Poc();
write_end_SaoSe();
write_end_SEI_MD5();
write_end_SliceType();
write_end_SplitTransform();
write_end_TUSize();
write_end_Coeff();
write_end_StrongIntraSmoothing();
write_end_DispCoord();
write_end_PicSizeInMb();
write_end_NumRefIdxLxActive();
write_end_RefPicListModif();
write_end_RefPoc();
write_end_MvPredSyntaxElem();
write_end_Cbf();
write_end_DBFDisable();
write_end_DbfSe();
write_end_ReorderPics();
write_end_WeightedPred();
write_end_Qp();
}
| [
"alejoar@gmail.com"
] | alejoar@gmail.com |
e35e13cb240006a64c96e8aaa637c9cb79733f59 | e4215c48c60ddb959fd045dbd5f51644b527355c | /mongoose/challenge/src/controller/lib/mymath.h | 1fe14af553f8683dddc28a82eaacc5f40a5d1166 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | brytemorio/hackasat-qualifier-2021 | 698215582a77b144b1af34feb19fc929014eb404 | 12458737767263a7d605e47e445c745e4d758dfd | refs/heads/main | 2023-06-14T20:43:07.591213 | 2021-07-08T17:07:14 | 2021-07-08T17:11:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,283 | h | /*
Author: Jason Williams <jdw@cromulence.com>
Copyright (c) 2014 Cromulence LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef __MYMATH_H__
#define __MYMATH_H__
double floor( double );
double round( double, double n );
int is_nan(double value);
int is_inf(double value);
#endif // __MYMATH_H__
| [
"bk@cromulence.com"
] | bk@cromulence.com |
63b35b971721603543839786e8640c38251131ef | d0c44dd3da2ef8c0ff835982a437946cbf4d2940 | /cmake-build-debug/programs_tiling/function14055/function14055_schedule_6/function14055_schedule_6_wrapper.h | ac78535d26e3466ce7daaaee360bcd5392692c66 | [] | no_license | IsraMekki/tiramisu_code_generator | 8b3f1d63cff62ba9f5242c019058d5a3119184a3 | 5a259d8e244af452e5301126683fa4320c2047a3 | refs/heads/master | 2020-04-29T17:27:57.987172 | 2019-04-23T16:50:32 | 2019-04-23T16:50:32 | 176,297,755 | 1 | 2 | null | null | null | null | UTF-8 | C | false | false | 447 | h | #ifndef HALIDE__generated_function14055_schedule_6_h
#define HALIDE__generated_function14055_schedule_6_h
#include <tiramisu/utils.h>
#ifdef __cplusplus
extern "C" {
#endif
int function14055_schedule_6(halide_buffer_t *buf00, halide_buffer_t *buf01, halide_buffer_t *buf02, halide_buffer_t *buf03, halide_buffer_t *buf04, halide_buffer_t *buf05, halide_buffer_t *buf06, halide_buffer_t *buf0);
#ifdef __cplusplus
} // extern "C"
#endif
#endif | [
"ei_mekki@esi.dz"
] | ei_mekki@esi.dz |
fe087c07d237a919d2026ac666c95a39cbae5a9c | e140b2cf73d378a0c89b84d59e0fb33e1baec9e4 | /Project3/password.c | b66cd5fc702c2dc49a30e9b36c940fb269800939 | [] | no_license | Mark-Arias/C-Programming-Projects | 76a3a1ac3eaeb3f53e1bc5faad7e946f1d5c4dd4 | 2d2f45b3739f7d52ab36b32a806c7328961c7310 | refs/heads/master | 2021-05-02T13:48:48.857769 | 2018-02-08T20:54:02 | 2018-02-08T20:54:02 | 120,707,071 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,226 | c | // Arias, Mark Steven CS50 Dehkhoda tth
// Program Purpose
// Check if a user generated password works according to specified criteria
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
// main //////////////////////////////////
int main()
{
char word;
int numChar=0;
int numNumber=0;
int count;
printf ("Enter a string for password:");
while((word = getchar())!= '\n')
{
if ((word >='a'&& word <= 'z') || (word >='A' && word <= 'Z'))
{
numChar += 1;
}
else if (isdigit(word))
{
numNumber += 1;
}
else
{
printf ("Your password can only contain digits and letters: \n");
break;
}
}
count = numNumber + numChar;
if (count<8)
{
printf ("Your password must contain at least 8 charecters: \n");
}
else if (numNumber<2)
{
printf ("Your password must contain at least 2 digits: \n");
}
else
{
printf ("Your password is valid\n");
}
system("pause");
return 0;
}
| [
"noreply@github.com"
] | Mark-Arias.noreply@github.com |
c1a3d1c525175ef5718fc80236264c76c30072f2 | ed2320b0775b4773da2a6a6c1edfa911f462892e | /Operating Systems/Series 0/someDemoCode.c | 30a12d2e26c0419deb82a43d0c7ab48964b21188 | [] | no_license | Smoenybfan/OperatingSystems | 92bd7c6b6a42ad2adaea9023a30f4d595556d1aa | 5b9d128315ead09950677e068df9208edfa7a57a | refs/heads/master | 2021-01-16T23:18:26.663184 | 2017-05-30T06:04:40 | 2017-05-30T06:04:40 | 82,860,082 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 75 | c | #include <stdio.h>
void printstupidstuff(){
printf("Stupid stuff");
}
| [
"simon.kafader@students.unibe.ch"
] | simon.kafader@students.unibe.ch |
e8c2ea61b0cd005af031bdb5b6a2a0c1c0a628b3 | 68dfc747d9fdfe7b9c083f74bd084e86d5b16802 | /old_DISCOVERY_STemWIN_MH_Z19/string.c | 0a0c14ff3203760226a33f5db623f19f7019c0c2 | [] | no_license | EvgenyDD/DISCOVERY_STemWIN_Prj | 82a526fd2aba5e75bfd07b255abc2cfe585d8376 | 515b391baa34fc9bbf540e8b9ba3ad8b94e2d003 | refs/heads/master | 2021-01-26T07:14:54.756820 | 2020-05-30T12:17:12 | 2020-05-30T12:17:12 | 243,360,378 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,301 | c | /* Includes ------------------------------------------------------------------*/
#include "string.h"
#include "stm32f4xx.h"
//#include "math_.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : strlen
* Description : calculating length of the string
* Input : pointer to text string
* Return : string length
*******************************************************************************/
int strlen(char *pText)
{
int len = 0;
for(; *pText != '\0'; pText++, len++)
;
return len;
}
/*******************************************************************************
* Function Name : strlenNum
* Description : calculating length of the string
* Input : pointer to text string
* Return : string length
*******************************************************************************/
int strlenNum(char *pText, int begin)
{
int len = 0;
pText += begin;
for(; *pText != '\0'; pText++, len++)
;
return len;
}
/*******************************************************************************
* Function Name : itoa
* Description : Convert int to char
* Input : int number (signed/unsigned)
* Return : pointer to text string
*******************************************************************************/
void itoa_(int n, char s[])
{
int sign;
if((sign = n) < 0)
n = -n;
int i = 0;
do
{
s[i++] = n % 10 + '0';
} while((n /= 10) > 0);
if(sign < 0) s[i++] = '-';
s[i] = '\0';
reverse(s);
}
/*******************************************************************************
* Function Name : itoa
* Description : Convert int to char
* Input : int number (signed/unsigned)
* Return : pointer to text string
*******************************************************************************/
void dtoa_(uint32_t n, char s[])
{
int sign;
if((sign = n) < 0)
n = -n;
int i = 0;
do
{
s[i++] = n % 10 + '0';
} while((n /= 10) > 0);
if(sign < 0) s[i++] = '-';
s[i] = '\0';
reverse(s);
}
/*******************************************************************************
* Function Name : ftoa_
* Description : Convert float to char
* Input : float number, char, output precision
* Return : pointer to text string
*******************************************************************************/
void ftoa_(float num, char str[], char precision)
{
unsigned char zeroFlag = 0;
int digit = 0, reminder = 0;
long wt = 0;
if(num < 0)
{
num = -num;
zeroFlag = 1;
}
int whole_part = num;
int log_value = log10_(num), index = log_value;
if(zeroFlag) str[0] = '-';
//Extract the whole part from float num
for(int i = 1; i < log_value + 2; i++)
{
wt = pow_(10.0, i);
reminder = whole_part % wt;
digit = (reminder - digit) / (wt / 10);
//Store digit in string
str[index-- + zeroFlag] = digit + 48; // ASCII value of digit = digit + 48
if(index == -1)
break;
}
index = log_value + 1;
str[index + zeroFlag] = '.';
float fraction_part = num - whole_part;
float tmp1 = fraction_part, tmp = 0;
//Extract the fraction part from number
for(int i = 1; i <= precision; i++)
{
wt = 10;
tmp = tmp1 * wt;
digit = tmp;
//Store digit in string
str[++index + zeroFlag] = digit + 48; // ASCII value of digit = digit + 48
tmp1 = tmp - digit;
}
str[++index + zeroFlag] = '\0';
}
/*******************************************************************************
* Function Name : reverse
* Description : Reverses string
* Input : pointer to string
*******************************************************************************/
void reverse(char s[])
{
int c, i, j;
for(i = 0, j = strlen(s) - 1; i < j; i++, j--)
{
c = s[i];
s[i] = s[j];
s[j] = c;
}
}
/*******************************************************************************
* Function Name : strcat
* Description : add
* Input : pointer to string
*******************************************************************************/
void strcat_(char first[], char second[])
{
int i = 0, j = 0;
while(first[i] != '\0')
i++;
while((first[i++] = second[j++]) != '\0')
;
}
/*******************************************************************************
* Function Name : strcat
* Description : add
* Input : pointer to string
*******************************************************************************/
void strcatNum(char first[], char second[], int begin, int end)
{
if(begin >= end) return;
int i = 0, j = begin;
while(j != end)
{
first[i++] = second[j++];
}
first[i] = '\0';
}
/*******************************************************************************
* Function Name : pow_
* Description : Power x in y
*******************************************************************************/
float pow_(float x, float y)
{
double result = 1;
for(int i = 0; i < y; i++)
result *= x;
return result;
}
/*******************************************************************************
* Function Name : log10_
*******************************************************************************/
float log10_(int v)
{
return (v >= 1000000000u) ? 9 : (v >= 100000000u) ? 8 : (v >= 10000000u) ? 7 : (v >= 1000000u) ? 6 : (v >= 100000u) ? 5 : (v >= 10000u) ? 4 : (v >= 1000u) ? 3 : (v >= 100u) ? 2 : (v >= 10u) ? 1u : 0u;
}
| [
"evgeny.dolgalev@rozum.com"
] | evgeny.dolgalev@rozum.com |
db920e5fa228e664d93d38b90576ef9932a9de65 | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/linux/tools/testing/selftests/x86/extr_ioperm.c_clearhandler.c | a9c5eadd3386092167bb12ba0db67722d501f2b3 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 998 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct sigaction {int /*<<< orphan*/ sa_mask; int /*<<< orphan*/ sa_handler; } ;
typedef int /*<<< orphan*/ sa ;
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL ;
int /*<<< orphan*/ err (int,char*) ;
int /*<<< orphan*/ memset (struct sigaction*,int /*<<< orphan*/ ,int) ;
scalar_t__ sigaction (int,struct sigaction*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sigemptyset (int /*<<< orphan*/ *) ;
__attribute__((used)) static void clearhandler(int sig)
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
sigemptyset(&sa.sa_mask);
if (sigaction(sig, &sa, 0))
err(1, "sigaction");
} | [
"brenocfg@gmail.com"
] | brenocfg@gmail.com |
a3974e79ea1dabccf62d347497066eb45294c367 | 73fe36e0b939f134b79cb1d45a0b359781f303e0 | /srcs/libft/ft_putnbr.c | ae7863f7b7f98918ec2135e87a41e878033b7853 | [] | no_license | l-geoffroy/42-ft-printf | 8ba947aae830b989d20b1b0f250d30f0d57b95d8 | 693b76a2c5307f54738c3dfa415ed5529e94a001 | refs/heads/main | 2023-07-01T00:06:19.547849 | 2021-08-05T14:24:25 | 2021-08-05T14:24:25 | 387,072,963 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,155 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgeoffro <lgeoffro@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/06/29 10:12:17 by lgeoffro #+# #+# */
/* Updated: 2021/08/04 11:18:52 by lgeoffro ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_putnbr(int n)
{
long long int nb;
if (n == -2147483648)
{
ft_putstr("-2147483648");
return ;
}
nb = n;
if (nb < 0)
{
nb = nb * -1;
ft_putchar('-');
}
if (nb >= 10)
ft_putnbr(nb / 10);
ft_putchar((nb % 10) + 48);
}
| [
"81981148+l-geoffroy@users.noreply.github.com"
] | 81981148+l-geoffroy@users.noreply.github.com |
26b466d72cd5b1477ca41c48623c8b9db0a5bc5b | 77846e4faaed872e6698f05e449aa829b8a6dc5e | /aeo/aeo_control2/control_final/control_q4/isim/Nexys3v6_isim_beh.exe.sim/work/a_0544875587_3212880686.c | 7500f41aa8d3c55d64363504fa6e7d52e2ceb32d | [] | no_license | shaqianqian/M1S1 | eb6456471bd987ba4865fe549075859e8116727c | 852be84d37cac83774fab194d1e018bbc6aaeea4 | refs/heads/master | 2021-05-13T17:13:33.666777 | 2018-02-21T14:05:40 | 2018-02-21T14:05:40 | 116,809,639 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 10,841 | c | /**********************************************************************/
/* ____ ____ */
/* / /\/ / */
/* /___/ \ / */
/* \ \ \/ */
/* \ \ Copyright (c) 2003-2009 Xilinx, Inc. */
/* / / All Right Reserved. */
/* /---/ /\ */
/* \ \ / \ */
/* \___\/\___\ */
/***********************************************************************/
/* This file is designed for use with ISim build 0x9ca8bed6 */
#define XSI_HIDE_SYMBOL_SPEC true
#include "xsi.h"
#include <memory.h>
#ifdef __GNUC__
#include <stdlib.h>
#else
#include <malloc.h>
#define alloca _alloca
#endif
static const char *ng0 = "/home/parallels/Desktop/control_final/control_q4/IP_FLITER.vhd";
extern char *IEEE_P_3620187407;
extern char *IEEE_P_2592010699;
static void work_a_0544875587_3212880686_p_0(char *t0)
{
char *t1;
char *t2;
unsigned char t3;
char *t4;
char *t5;
char *t6;
char *t7;
char *t8;
unsigned char t9;
char *t10;
char *t11;
char *t12;
char *t13;
char *t14;
static char *nl0[] = {&&LAB3, &&LAB4, &&LAB5, &&LAB6, &&LAB7, &&LAB8};
LAB0: xsi_set_current_line(26, ng0);
t1 = (t0 + 1992U);
t2 = *((char **)t1);
t3 = *((unsigned char *)t2);
t1 = (t0 + 4672);
t4 = (t1 + 56U);
t5 = *((char **)t4);
t6 = (t5 + 56U);
t7 = *((char **)t6);
*((unsigned char *)t7) = t3;
xsi_driver_first_trans_fast(t1);
xsi_set_current_line(27, ng0);
t1 = (t0 + 1992U);
t2 = *((char **)t1);
t3 = *((unsigned char *)t2);
t1 = (char *)((nl0) + t3);
goto **((char **)t1);
LAB2: t1 = (t0 + 4560);
*((int *)t1) = 1;
LAB1: return;
LAB3: xsi_set_current_line(29, ng0);
t4 = (t0 + 1192U);
t5 = *((char **)t4);
t4 = (t0 + 7648U);
t6 = (t0 + 7771);
t8 = (t0 + 7616U);
t9 = ieee_std_logic_unsigned_equal_stdv_stdv(IEEE_P_3620187407, t5, t4, t6, t8);
if (t9 != 0)
goto LAB10;
LAB12:
LAB11: goto LAB2;
LAB4: xsi_set_current_line(33, ng0);
t1 = (t0 + 4672);
t2 = (t1 + 56U);
t4 = *((char **)t2);
t5 = (t4 + 56U);
t6 = *((char **)t5);
*((unsigned char *)t6) = (unsigned char)2;
xsi_driver_first_trans_fast(t1);
goto LAB2;
LAB5: xsi_set_current_line(35, ng0);
t1 = (t0 + 4672);
t2 = (t1 + 56U);
t4 = *((char **)t2);
t5 = (t4 + 56U);
t6 = *((char **)t5);
*((unsigned char *)t6) = (unsigned char)3;
xsi_driver_first_trans_fast(t1);
goto LAB2;
LAB6: xsi_set_current_line(37, ng0);
t1 = (t0 + 4672);
t2 = (t1 + 56U);
t4 = *((char **)t2);
t5 = (t4 + 56U);
t6 = *((char **)t5);
*((unsigned char *)t6) = (unsigned char)4;
xsi_driver_first_trans_fast(t1);
goto LAB2;
LAB7: xsi_set_current_line(39, ng0);
t1 = (t0 + 4672);
t2 = (t1 + 56U);
t4 = *((char **)t2);
t5 = (t4 + 56U);
t6 = *((char **)t5);
*((unsigned char *)t6) = (unsigned char)5;
xsi_driver_first_trans_fast(t1);
goto LAB2;
LAB8: xsi_set_current_line(41, ng0);
t1 = (t0 + 4672);
t2 = (t1 + 56U);
t4 = *((char **)t2);
t5 = (t4 + 56U);
t6 = *((char **)t5);
*((unsigned char *)t6) = (unsigned char)0;
xsi_driver_first_trans_fast(t1);
goto LAB2;
LAB9: xsi_set_current_line(43, ng0);
t1 = (t0 + 4672);
t2 = (t1 + 56U);
t4 = *((char **)t2);
t5 = (t4 + 56U);
t6 = *((char **)t5);
*((unsigned char *)t6) = (unsigned char)0;
xsi_driver_first_trans_fast(t1);
goto LAB2;
LAB10: xsi_set_current_line(30, ng0);
t10 = (t0 + 4672);
t11 = (t10 + 56U);
t12 = *((char **)t11);
t13 = (t12 + 56U);
t14 = *((char **)t13);
*((unsigned char *)t14) = (unsigned char)1;
xsi_driver_first_trans_fast(t10);
goto LAB11;
}
static void work_a_0544875587_3212880686_p_1(char *t0)
{
char *t1;
char *t2;
char *t3;
char *t4;
char *t5;
unsigned char t6;
unsigned int t7;
unsigned int t8;
unsigned int t9;
char *t10;
char *t11;
char *t12;
char *t13;
static char *nl0[] = {&&LAB3, &&LAB8, &&LAB4, &&LAB5, &&LAB6, &&LAB7};
LAB0: xsi_set_current_line(49, ng0);
t1 = (t0 + 4736);
t2 = (t1 + 56U);
t3 = *((char **)t2);
t4 = (t3 + 56U);
t5 = *((char **)t4);
*((unsigned char *)t5) = (unsigned char)2;
xsi_driver_first_trans_fast(t1);
xsi_set_current_line(50, ng0);
t1 = (t0 + 1992U);
t2 = *((char **)t1);
t6 = *((unsigned char *)t2);
t1 = (char *)((nl0) + t6);
goto **((char **)t1);
LAB2: t1 = (t0 + 4576);
*((int *)t1) = 1;
LAB1: return;
LAB3: goto LAB2;
LAB4: xsi_set_current_line(53, ng0);
t3 = (t0 + 1032U);
t4 = *((char **)t3);
t7 = (31 - 7);
t8 = (t7 * 1U);
t9 = (0 + t8);
t3 = (t4 + t9);
t5 = (t0 + 4800);
t10 = (t5 + 56U);
t11 = *((char **)t10);
t12 = (t11 + 56U);
t13 = *((char **)t12);
memcpy(t13, t3, 8U);
xsi_driver_first_trans_fast(t5);
goto LAB2;
LAB5: xsi_set_current_line(55, ng0);
t1 = (t0 + 1032U);
t2 = *((char **)t1);
t7 = (31 - 15);
t8 = (t7 * 1U);
t9 = (0 + t8);
t1 = (t2 + t9);
t3 = (t0 + 4800);
t4 = (t3 + 56U);
t5 = *((char **)t4);
t10 = (t5 + 56U);
t11 = *((char **)t10);
memcpy(t11, t1, 8U);
xsi_driver_first_trans_fast(t3);
goto LAB2;
LAB6: xsi_set_current_line(57, ng0);
t1 = (t0 + 1032U);
t2 = *((char **)t1);
t7 = (31 - 23);
t8 = (t7 * 1U);
t9 = (0 + t8);
t1 = (t2 + t9);
t3 = (t0 + 4800);
t4 = (t3 + 56U);
t5 = *((char **)t4);
t10 = (t5 + 56U);
t11 = *((char **)t10);
memcpy(t11, t1, 8U);
xsi_driver_first_trans_fast(t3);
goto LAB2;
LAB7: xsi_set_current_line(59, ng0);
t1 = (t0 + 4736);
t2 = (t1 + 56U);
t3 = *((char **)t2);
t4 = (t3 + 56U);
t5 = *((char **)t4);
*((unsigned char *)t5) = (unsigned char)3;
xsi_driver_first_trans_fast(t1);
xsi_set_current_line(60, ng0);
t1 = (t0 + 1032U);
t2 = *((char **)t1);
t7 = (31 - 31);
t8 = (t7 * 1U);
t9 = (0 + t8);
t1 = (t2 + t9);
t3 = (t0 + 4800);
t4 = (t3 + 56U);
t5 = *((char **)t4);
t10 = (t5 + 56U);
t11 = *((char **)t10);
memcpy(t11, t1, 8U);
xsi_driver_first_trans_fast(t3);
goto LAB2;
LAB8: goto LAB2;
}
static void work_a_0544875587_3212880686_p_2(char *t0)
{
char t15[16];
char t16[16];
unsigned char t1;
char *t2;
unsigned char t3;
char *t4;
char *t5;
unsigned char t6;
unsigned char t7;
char *t8;
unsigned char t9;
unsigned char t10;
char *t11;
char *t12;
char *t13;
char *t14;
int t17;
unsigned int t18;
char *t19;
char *t20;
char *t21;
char *t22;
LAB0: xsi_set_current_line(67, ng0);
t2 = (t0 + 1312U);
t3 = xsi_signal_has_event(t2);
if (t3 == 1)
goto LAB5;
LAB6: t1 = (unsigned char)0;
LAB7: if (t1 != 0)
goto LAB2;
LAB4:
LAB3: t2 = (t0 + 4592);
*((int *)t2) = 1;
LAB1: return;
LAB2: xsi_set_current_line(68, ng0);
t4 = (t0 + 1512U);
t8 = *((char **)t4);
t9 = *((unsigned char *)t8);
t10 = (t9 == (unsigned char)3);
if (t10 != 0)
goto LAB8;
LAB10: xsi_set_current_line(73, ng0);
t2 = (t0 + 2152U);
t4 = *((char **)t2);
t1 = *((unsigned char *)t4);
t2 = (t0 + 4864);
t5 = (t2 + 56U);
t8 = *((char **)t5);
t11 = (t8 + 56U);
t12 = *((char **)t11);
*((unsigned char *)t12) = t1;
xsi_driver_first_trans_fast(t2);
xsi_set_current_line(74, ng0);
t2 = (t0 + 2312U);
t4 = *((char **)t2);
t1 = *((unsigned char *)t4);
t2 = (t0 + 4928);
t5 = (t2 + 56U);
t8 = *((char **)t5);
t11 = (t8 + 56U);
t12 = *((char **)t11);
*((unsigned char *)t12) = t1;
xsi_driver_first_trans_fast_port(t2);
xsi_set_current_line(76, ng0);
t2 = (t0 + 2312U);
t4 = *((char **)t2);
t1 = *((unsigned char *)t4);
t3 = (t1 == (unsigned char)3);
if (t3 != 0)
goto LAB11;
LAB13: xsi_set_current_line(79, ng0);
t2 = (t0 + 7814);
t5 = (t0 + 2472U);
t8 = *((char **)t5);
t11 = ((IEEE_P_2592010699) + 4000);
t12 = (t16 + 0U);
t13 = (t12 + 0U);
*((int *)t13) = 0;
t13 = (t12 + 4U);
*((int *)t13) = 23;
t13 = (t12 + 8U);
*((int *)t13) = 1;
t17 = (23 - 0);
t18 = (t17 * 1);
t18 = (t18 + 1);
t13 = (t12 + 12U);
*((unsigned int *)t13) = t18;
t13 = (t0 + 7680U);
t5 = xsi_base_array_concat(t5, t15, t11, (char)97, t2, t16, (char)97, t8, t13, (char)101);
t14 = (t0 + 4992);
t19 = (t14 + 56U);
t20 = *((char **)t19);
t21 = (t20 + 56U);
t22 = *((char **)t21);
memcpy(t22, t5, 32U);
xsi_driver_first_trans_fast_port(t14);
LAB12:
LAB9: goto LAB3;
LAB5: t4 = (t0 + 1352U);
t5 = *((char **)t4);
t6 = *((unsigned char *)t5);
t7 = (t6 == (unsigned char)3);
t1 = t7;
goto LAB7;
LAB8: xsi_set_current_line(69, ng0);
t4 = (t0 + 4864);
t11 = (t4 + 56U);
t12 = *((char **)t11);
t13 = (t12 + 56U);
t14 = *((char **)t13);
*((unsigned char *)t14) = (unsigned char)0;
xsi_driver_first_trans_fast(t4);
xsi_set_current_line(70, ng0);
t2 = (t0 + 4928);
t4 = (t2 + 56U);
t5 = *((char **)t4);
t8 = (t5 + 56U);
t11 = *((char **)t8);
*((unsigned char *)t11) = (unsigned char)2;
xsi_driver_first_trans_fast_port(t2);
xsi_set_current_line(71, ng0);
t2 = xsi_get_transient_memory(32U);
memset(t2, 0, 32U);
t4 = t2;
memset(t4, (unsigned char)4, 32U);
t5 = (t0 + 4992);
t8 = (t5 + 56U);
t11 = *((char **)t8);
t12 = (t11 + 56U);
t13 = *((char **)t12);
memcpy(t13, t2, 32U);
xsi_driver_first_trans_fast_port(t5);
goto LAB9;
LAB11: xsi_set_current_line(77, ng0);
t2 = (t0 + 7782);
t8 = (t0 + 4992);
t11 = (t8 + 56U);
t12 = *((char **)t11);
t13 = (t12 + 56U);
t14 = *((char **)t13);
memcpy(t14, t2, 32U);
xsi_driver_first_trans_fast_port(t8);
goto LAB12;
}
extern void work_a_0544875587_3212880686_init()
{
static char *pe[] = {(void *)work_a_0544875587_3212880686_p_0,(void *)work_a_0544875587_3212880686_p_1,(void *)work_a_0544875587_3212880686_p_2};
xsi_register_didat("work_a_0544875587_3212880686", "isim/Nexys3v6_isim_beh.exe.sim/work/a_0544875587_3212880686.didat");
xsi_register_executes(pe);
}
| [
"qianqian.sha@univ-lille1.fr"
] | qianqian.sha@univ-lille1.fr |
9750ee690ee945772bf4e916add998edf0407b02 | 245b4afee9ed74af713a8e45d370bcfcedbb3ead | /sumOfNnaturalNumberUsingPointerVariable.c | 5b281d654547fb36e694f07a275cf4c4a06f65b0 | [] | no_license | prasoonsoni/C-Language-Concepts | 5cb9a0823c178359cf88e66bd82a6bf19b2893a3 | 5638611fe98229bec95c9e0e7b54fe4f0a51b315 | refs/heads/master | 2023-05-03T03:24:32.843207 | 2021-05-10T16:56:01 | 2021-05-10T16:56:01 | 366,114,340 | 2 | 0 | null | null | null | null | UTF-8 | C | false | false | 302 | c | #include <stdio.h>
void main(){
int n;
int sum = 0;
printf("Enter number of elements ? ");
scanf("%d", &n);
int arr[n];
int *p = arr;
for(int i=0;i<n;i++){
printf("Enter elements ? ");
scanf("%d", p+i);
sum += (*(p+i));
}
printf("%d",sum);
} | [
"prasoonsoni03@gmail.com"
] | prasoonsoni03@gmail.com |
69122378fbed2c6ca7e7770d99312a876502c276 | 6978d2f7f81e726ccaa2aeec28e3ff030d49016f | /code_1/static/test2.c | 33263b0379f4ffe2fc5044f4060dc152bd52ef1d | [] | no_license | fenriliuguang/031902217_psy | 46ddb0b1fdb073aba9480547d457f9abc3c01b58 | 1ae644e011476f0e00ed66a7292767d40c9ef39e | refs/heads/master | 2023-08-18T16:15:08.395167 | 2021-09-21T03:28:13 | 2021-09-21T03:28:13 | 407,096,342 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 65 | c | #include<stdio.h>
int main () {
printf(":");
return 0;
} | [
"1415854799@qq.com"
] | 1415854799@qq.com |
91c837411b33a88b7054445948b6470d401111b8 | b820532413ce8e1e7281a37ba7b9dbb6ebce0200 | /max30102_fifo/app/main.c | 1d3293d2b865b7496e7f3e8042d2d4f3dd85951d | [] | no_license | cornrn/i2c_max30102 | 8d9447b48074bb21fa098c98e32d7c0d0aa1991c | 4b5fa8b1a44223e8ef97c6520ec37d3392e02ea4 | refs/heads/main | 2023-09-02T11:24:19.429497 | 2021-11-19T09:11:36 | 2021-11-19T09:11:36 | null | 0 | 0 | null | null | null | null | GB18030 | C | false | false | 3,573 | c | #include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"
#include "app_uart.h"
//Log需要引用的头文件
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#if defined (UART_PRESENT)
#include "nrf_uart.h"
#endif
#if defined (UARTE_PRESENT)
#include "nrf_uarte.h"
#endif
#include "nrf_drv_twi.h"
#include "max30102.h"
#define UART_TX_BUF_SIZE 256 //串口发送缓存大小(字节数)
#define UART_RX_BUF_SIZE 256 //串口接收缓存大小(字节数)
//串口事件回调函数,该函数中判断事件类型并进行处理
void uart_error_handle(app_uart_evt_t * p_event)
{
//通讯错误事件
if (p_event->evt_type == APP_UART_COMMUNICATION_ERROR)
{
APP_ERROR_HANDLER(p_event->data.error_communication);
}
//FIFO错误事件
else if (p_event->evt_type == APP_UART_FIFO_ERROR)
{
APP_ERROR_HANDLER(p_event->data.error_code);
}
}
//串口配置
void uart_config(void)
{
uint32_t err_code;
//定义串口通讯参数配置结构体并初始化
const app_uart_comm_params_t comm_params =
{
RX_PIN_NUMBER,//定义uart接收引脚
TX_PIN_NUMBER,//定义uart发送引脚
RTS_PIN_NUMBER,//定义uart RTS引脚,流控关闭后虽然定义了RTS和CTS引脚,但是驱动程序会忽略,不会配置这两个引脚,两个引脚仍可作为IO使用
CTS_PIN_NUMBER,//定义uart CTS引脚
APP_UART_FLOW_CONTROL_DISABLED,//关闭uart硬件流控
false,//禁止奇偶检验
NRF_UART_BAUDRATE_115200//uart波特率设置为115200bps
};
//初始化串口,注册串口事件回调函数
APP_UART_FIFO_INIT(&comm_params,
UART_RX_BUF_SIZE,
UART_TX_BUF_SIZE,
uart_error_handle,
APP_IRQ_PRIORITY_LOWEST,
err_code);
APP_ERROR_CHECK(err_code);
}
static void log_init(void)
{
//初始化log程序模块
ret_code_t err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);
//设置log输出终端(根据sdk_config.h中的配置设置输出终端为UART或者RTT)
NRF_LOG_DEFAULT_BACKENDS_INIT();
}
/***************************************************************************
* 描 述 : main函数
* 入 参 : 无
* 返回值 : int 类型
**************************************************************************/
int main(void)
{
uint32_t reddat,irdat;
//初始化log程序模块,本例中使用RTT作为输出终端打印信息
log_init();
//配置用于驱动LED指示灯D1 D2 D3 D4的引脚脚,即配置P0.13~P0.16为输出,并将LED的初始状态设置为熄灭
//配置用于检测4个按键的IO位输入,并开启上拉电阻
bsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);
//初始化串口
uart_config();
nrf_gpio_cfg_input(MAX30102_INTPIN,NRF_GPIO_PIN_PULLUP);
//初始化I2C总线
twi_master_init();
//复位MAX30102
max30102_reset();
//read and clear status register
(void)max30102_read_reg(0,1);
//初始化MAX30102
MAX30102_Init();
nrf_delay_ms(1000);
//LOG打印启动信息
NRF_LOG_INFO("max30102 example started");
NRF_LOG_FLUSH();
while (true)
{
while(nrf_gpio_pin_read(MAX30102_INTPIN) == 1){} //wait until the interrupt pin asserts
max30102_read_fifo(&reddat, &irdat); //read from MAX30102 FIFO
printf("red= %d ir= %d\r\n",reddat,irdat);
nrf_delay_ms(50);
nrf_gpio_pin_toggle(LED_1); //指示灯D1状态翻转,指示程序运行
}
}
| [
"1531377833@qq.com"
] | 1531377833@qq.com |
db1d107306302ea81bae68e6f5ed023cbccb6ff9 | e7ac6f3a71026dc1e2420b2b1b65989f57c9fa7a | /avriot.X/mcc_generated_files/CryptoAuthenticationLibrary/basic/atca_basic.c | 11704324349467c743884534f49c911a3f4dac3b | [] | no_license | ttymrz/avr-iot-wg-weather-mplab | b6a1a963dac14b52d5c57a99f4b0606e7f34bd2c | 9420197da3e4a4abee801e4de1e606bb20683f3c | refs/heads/main | 2023-02-19T13:13:45.987431 | 2021-01-23T08:12:48 | 2021-01-23T08:12:48 | 312,593,376 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 12,659 | c | /**
* \file
* \brief CryptoAuthLib Basic API methods. These methods provide a simpler way
* to access the core crypto methods.
*
* \copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
*
* \page License
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to comply with third party license terms applicable to your
* use of third party software (including open source software) that may
* accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
* EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
* WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT,
* SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE
* OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
* MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
* FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
* LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
* THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR
* THIS SOFTWARE.
*/
#include "atca_basic.h"
#include "atca_version.h"
#include "host/atca_host.h"
#if defined(ATCA_USE_CONSTANT_HOST_NONCE)
#if defined(_MSC_VER)
#pragma message("Warning : Using a constant host nonce with atcab_read_enc, atcab_write_enc, etcc., can allow spoofing of a device by replaying previously recorded messages")
#else
#warning "Using a constant host nonce with atcab_read_enc, atcab_write_enc, etcc., can allow spoofing of a device by replaying previously recorded messages"
#endif
#endif
const char atca_version[] = ATCA_LIBRARY_VERSION;
ATCADevice _gDevice = NULL;
#ifdef ATCA_NO_HEAP
struct atca_command g_atcab_command;
struct atca_iface g_atcab_iface;
struct atca_device g_atcab_device;
#endif
#define MAX_BUSES 4
/** \brief basic API methods are all prefixed with atcab_ (CryptoAuthLib Basic)
* the fundamental premise of the basic API is it is based on a single interface
* instance and that instance is global, so all basic API commands assume that
* one global device is the one to operate on.
*/
/** \brief returns a version string for the CryptoAuthLib release.
* The format of the version string returned is "yyyymmdd"
* \param[out] ver_str ptr to space to receive version string
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_version(char *ver_str)
{
strcpy(ver_str, atca_version);
return ATCA_SUCCESS;
}
/** \brief Creates a global ATCADevice object used by Basic API.
* \param[in] cfg Logical interface configuration. Some predefined
* configurations can be found in atca_cfgs.h
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_init(ATCAIfaceCfg *cfg)
{
ATCA_STATUS status = ATCA_GEN_FAIL;
// If a device has already been initialized, release it
if (_gDevice)
{
atcab_release();
}
#ifdef ATCA_NO_HEAP
g_atcab_device.mCommands = &g_atcab_command;
g_atcab_device.mIface = &g_atcab_iface;
status = initATCADevice(cfg, &g_atcab_device);
if (status != ATCA_SUCCESS)
{
return status;
}
_gDevice = &g_atcab_device;
#else
_gDevice = newATCADevice(cfg);
if (_gDevice == NULL)
{
return ATCA_GEN_FAIL;
}
#endif
if (cfg->devtype == ATECC608A)
{
if ((status = atcab_read_bytes_zone(ATCA_ZONE_CONFIG, 0, ATCA_CHIPMODE_OFFSET, &_gDevice->mCommands->clock_divider, 1)) != ATCA_SUCCESS)
{
return status;
}
_gDevice->mCommands->clock_divider &= ATCA_CHIPMODE_CLOCK_DIV_MASK;
}
return ATCA_SUCCESS;
}
/** \brief Initialize the global ATCADevice object to point to one of your
* choosing for use with all the atcab_ basic API.
* \param[in] ca_device ATCADevice instance to use as the global Basic API
* crypto device instance
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_init_device(ATCADevice ca_device)
{
if (ca_device == NULL)
{
return ATCA_BAD_PARAM;
}
if (atGetCommands(ca_device) == NULL || atGetIFace(ca_device) == NULL)
{
return ATCA_GEN_FAIL;
}
// if there's already a device created, release it
if (_gDevice)
{
atcab_release();
}
_gDevice = ca_device;
return ATCA_SUCCESS;
}
/** \brief release (free) the global ATCADevice instance.
* This must be called in order to release or free up the interface.
* \return Returns ATCA_SUCCESS .
*/
ATCA_STATUS atcab_release(void)
{
#ifdef ATCA_NO_HEAP
ATCA_STATUS status = releaseATCADevice(_gDevice);
if (status != ATCA_SUCCESS)
{
return status;
}
_gDevice = NULL;
#else
deleteATCADevice(&_gDevice);
#endif
return ATCA_SUCCESS;
}
/** \brief Get the global device object.
* \return instance of global ATCADevice
*/
ATCADevice atcab_get_device(void)
{
return _gDevice;
}
/** \brief Get the current device type.
* \return Device type if basic api is initialized or ATCA_DEV_UNKNOWN.
*/
ATCADeviceType atcab_get_device_type(void)
{
if (_gDevice)
{
return _gDevice->mIface->mIfaceCFG->devtype;
}
else
{
return ATCA_DEV_UNKNOWN;
}
}
/** \brief wakeup the CryptoAuth device
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_wakeup(void)
{
if (_gDevice == NULL)
{
return ATCA_GEN_FAIL;
}
return atwake(_gDevice->mIface);
}
/** \brief idle the CryptoAuth device
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_idle(void)
{
if (_gDevice == NULL)
{
return ATCA_GEN_FAIL;
}
return atidle(_gDevice->mIface);
}
/** \brief invoke sleep on the CryptoAuth device
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_sleep(void)
{
if (_gDevice == NULL)
{
return ATCA_GEN_FAIL;
}
return atsleep(_gDevice->mIface);
}
/** \brief auto discovery of crypto auth devices
*
* Calls interface discovery functions and fills in cfg_array up to the maximum
* number of configurations either found or the size of the array. The cfg_array
* can have a mixture of interface types (ie: some I2C, some SWI or UART) depending upon
* which interfaces you've enabled
*
* \param[out] cfg_array ptr to an array of interface configs
* \param[in] max_ifaces maximum size of cfg_array
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_cfg_discover(ATCAIfaceCfg cfg_array[], int max_ifaces)
{
int iface_num = 0;
int found = 0;
int i = 0;
// this cumulatively gathers all the interfaces enabled by #defines
#ifdef ATCA_HAL_I2C
int i2c_buses[MAX_BUSES];
memset(i2c_buses, -1, sizeof(i2c_buses));
hal_i2c_discover_buses(i2c_buses, MAX_BUSES);
for (i = 0; i < MAX_BUSES && iface_num < max_ifaces; i++)
{
if (i2c_buses[i] != -1)
{
hal_i2c_discover_devices(i2c_buses[i], &cfg_array[iface_num], &found);
iface_num += found;
}
}
#endif
#ifdef ATCA_HAL_SWI
int swi_buses[MAX_BUSES];
memset(swi_buses, -1, sizeof(swi_buses));
hal_swi_discover_buses(swi_buses, MAX_BUSES);
for (i = 0; i < MAX_BUSES && iface_num < max_ifaces; i++)
{
if (swi_buses[i] != -1)
{
hal_swi_discover_devices(swi_buses[i], &cfg_array[iface_num], &found);
iface_num += found;
}
}
#endif
#ifdef ATCA_HAL_UART
int uart_buses[MAX_BUSES];
memset(uart_buses, -1, sizeof(uart_buses));
hal_uart_discover_buses(uart_buses, MAX_BUSES);
for (i = 0; i < MAX_BUSES && iface_num < max_ifaces; i++)
{
if (uart_buses[i] != -1)
{
hal_uart_discover_devices(uart_buses[i], &cfg_array[iface_num], &found);
iface_num += found;
}
}
#endif
#ifdef ATCA_HAL_KIT_CDC
int cdc_buses[MAX_BUSES];
memset(cdc_buses, -1, sizeof(cdc_buses));
hal_kit_cdc_discover_buses(cdc_buses, MAX_BUSES);
for (i = 0; i < MAX_BUSES && iface_num < max_ifaces; i++)
{
if (cdc_buses[i] != -1)
{
hal_kit_cdc_discover_devices(cdc_buses[i], &cfg_array[iface_num++], &found);
iface_num += found;
}
}
#endif
#ifdef ATCA_HAL_KIT_HID
int hid_buses[MAX_BUSES];
memset(hid_buses, -1, sizeof(hid_buses));
hal_kit_hid_discover_buses(hid_buses, MAX_BUSES);
for (i = 0; i < MAX_BUSES && iface_num < max_ifaces; i++)
{
if (hid_buses[i] != -1)
{
hal_kit_hid_discover_devices(hid_buses[i], &cfg_array[iface_num++], &found);
iface_num += found;
}
}
#endif
return ATCA_SUCCESS;
}
/** \brief common cleanup code which idles the device after any operation
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS _atcab_exit(void)
{
return atcab_idle();
}
/** \brief Compute the address given the zone, slot, block, and offset
* \param[in] zone Zone to get address from. Config(0), OTP(1), or
* Data(2) which requires a slot.
* \param[in] slot Slot Id number for data zone and zero for other zones.
* \param[in] block Block number within the data or configuration or OTP zone .
* \param[in] offset Offset Number within the block of data or configuration or OTP zone.
* \param[out] addr Pointer to the address of data or configuration or OTP zone.
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_get_addr(uint8_t zone, uint16_t slot, uint8_t block, uint8_t offset, uint16_t* addr)
{
ATCA_STATUS status = ATCA_SUCCESS;
uint8_t mem_zone = zone & 0x03;
if (addr == NULL)
{
return ATCA_BAD_PARAM;
}
if ((mem_zone != ATCA_ZONE_CONFIG) && (mem_zone != ATCA_ZONE_DATA) && (mem_zone != ATCA_ZONE_OTP))
{
return ATCA_BAD_PARAM;
}
do
{
// Initialize the addr to 00
*addr = 0;
// Mask the offset
offset = offset & (uint8_t)0x07;
if ((mem_zone == ATCA_ZONE_CONFIG) || (mem_zone == ATCA_ZONE_OTP))
{
*addr = block << 3;
*addr |= offset;
}
else // ATCA_ZONE_DATA
{
*addr = slot << 3;
*addr |= offset;
*addr |= block << 8;
}
}
while (0);
return status;
}
/** \brief Gets the size of the specified zone in bytes.
*
* \param[in] zone Zone to get size information from. Config(0), OTP(1), or
* Data(2) which requires a slot.
* \param[in] slot If zone is Data(2), the slot to query for size.
* \param[out] size Zone size is returned here.
*
* \return ATCA_SUCCESS on success, otherwise an error code.
*/
ATCA_STATUS atcab_get_zone_size(uint8_t zone, uint16_t slot, size_t* size)
{
ATCA_STATUS status = ATCA_SUCCESS;
if (size == NULL)
{
return ATCA_BAD_PARAM;
}
if (_gDevice->mIface->mIfaceCFG->devtype == ATSHA204A)
{
switch (zone)
{
case ATCA_ZONE_CONFIG: *size = 88; break;
case ATCA_ZONE_OTP: *size = 64; break;
case ATCA_ZONE_DATA: *size = 32; break;
default: status = ATCA_BAD_PARAM; break;
}
}
else
{
switch (zone)
{
case ATCA_ZONE_CONFIG: *size = 128; break;
case ATCA_ZONE_OTP: *size = 64; break;
case ATCA_ZONE_DATA:
if (slot < 8)
{
*size = 36;
}
else if (slot == 8)
{
*size = 416;
}
else if (slot < 16)
{
*size = 72;
}
else
{
status = ATCA_BAD_PARAM;
}
break;
default: status = ATCA_BAD_PARAM; break;
}
}
return status;
}
| [
"tetsuya.morizumi@gmail.com"
] | tetsuya.morizumi@gmail.com |
5d1c9abf4caf3854ef0f27ed8d487d504f434b28 | 3973a5708e3330302d1fb0d54baaa5391872f20e | /include/slices.h | c7f9a1f3f18f378fed0435a360c1c04f52c80285 | [] | no_license | smealum/ludum34 | 0fc2bc8060e1045588f091fc40a29806bcd0e76b | fdd11699e9bef4fa981908d2ce305a92ee594fc8 | refs/heads/master | 2021-01-15T08:57:41.927636 | 2015-12-15T20:41:06 | 2015-12-15T20:41:06 | 47,804,124 | 24 | 2 | null | 2015-12-14T03:35:21 | 2015-12-11T04:01:53 | C++ | UTF-8 | C | false | false | 290 | h | #ifndef SLICES_H
#define SLICES_H
#define LEVEL_WIDTH (9)
#define LEVEL_NUMLAYERS (3)
typedef unsigned int cubeProperties_t;
typedef struct
{
unsigned char data[LEVEL_WIDTH][LEVEL_WIDTH];
}slice_s;
void rotateSlice(slice_s* dst, slice_s* src, int orientation);
#endif
| [
"smealum@gmail.com"
] | smealum@gmail.com |
4bb5d0d307199b5c0fd6a6accb70da0660c2f1d0 | 09c98119a5fbaf5b89891e6ca009d2258028b724 | /Projects/STM324xG_EVAL/Examples/CRYP/CRYP_AESModes/Inc/stm32f4xx_hal_conf.h | 32c73dd2a1491f88e25af11d6fc15f7e21d4f585 | [
"BSD-2-Clause"
] | permissive | koson/STM32Cube_FW_F4 | bf20f632625181189ea0b47e96653117a8946cd9 | 58e9769a397768882632079863e2453803951a82 | refs/heads/master | 2020-12-05T02:03:49.120409 | 2019-09-21T06:45:53 | 2019-09-21T06:45:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 16,308 | h | /**
******************************************************************************
* @file CRYP/CRYP_AESModes/Inc/stm32f4xx_hal_conf.h
* @author MCD Application Team
* @version V1.2.5
* @date 29-January-2016
* @brief HAL configuration file.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_HAL_CONF_H
#define __STM32F4xx_HAL_CONF_H
#ifdef __cplusplus
extern "C" {
#endif
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
*/
#define HAL_MODULE_ENABLED
/* #define HAL_ADC_MODULE_ENABLED */
/* #define HAL_CAN_MODULE_ENABLED */
/* #define HAL_CRC_MODULE_ENABLED */
#define HAL_CRYP_MODULE_ENABLED
/* #define HAL_DAC_MODULE_ENABLED */
/* #define HAL_DCMI_MODULE_ENABLED */
#define HAL_DMA_MODULE_ENABLED
/* #define HAL_DMA2D_MODULE_ENABLED */
/* #define HAL_ETH_MODULE_ENABLED */
#define HAL_FLASH_MODULE_ENABLED
/* #define HAL_NAND_MODULE_ENABLED */
/* #define HAL_NOR_MODULE_ENABLED */
/* #define HAL_PCCARD_MODULE_ENABLED */
#define HAL_SRAM_MODULE_ENABLED
/* #define HAL_SDRAM_MODULE_ENABLED */
/* #define HAL_HASH_MODULE_ENABLED */
#define HAL_GPIO_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
/* #define HAL_I2S_MODULE_ENABLED */
/* #define HAL_IWDG_MODULE_ENABLED */
/* #define HAL_LTDC_MODULE_ENABLED */
#define HAL_PWR_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
/* #define HAL_RNG_MODULE_ENABLED */
/* #define HAL_RTC_MODULE_ENABLED */
/* #define HAL_SAI_MODULE_ENABLED */
/* #define HAL_SD_MODULE_ENABLED */
/* #define HAL_SPI_MODULE_ENABLED */
/* #define HAL_TIM_MODULE_ENABLED */
#define HAL_UART_MODULE_ENABLED
/* #define HAL_USART_MODULE_ENABLED */
/* #define HAL_IRDA_MODULE_ENABLED */
/* #define HAL_SMARTCARD_MODULE_ENABLED */
/* #define HAL_WWDG_MODULE_ENABLED */
#define HAL_CORTEX_MODULE_ENABLED
/* #define HAL_PCD_MODULE_ENABLED */
/* #define HAL_HCD_MODULE_ENABLED */
/* ########################## HSE/HSI Values adaptation ##################### */
/**
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
* This value is used by the RCC HAL module to compute the system frequency
* (when HSE is used as system clock source, directly or through the PLL).
*/
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
#if !defined (HSE_STARTUP_TIMEOUT)
#define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
#endif /* HSE_STARTUP_TIMEOUT */
/**
* @brief Internal High Speed oscillator (HSI) value.
* This value is used by the RCC HAL module to compute the system frequency
* (when HSI is used as system clock source, directly or through the PLL).
*/
#if !defined (HSI_VALUE)
#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI_VALUE */
/**
* @brief Internal Low Speed oscillator (LSI) value.
*/
#if !defined (LSI_VALUE)
#define LSI_VALUE ((uint32_t)32000)
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
The real value may vary depending on the variations
in voltage and temperature. */
/**
* @brief External Low Speed oscillator (LSE) value.
*/
#if !defined (LSE_VALUE)
#define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */
#endif /* LSE_VALUE */
#if !defined (LSE_STARTUP_TIMEOUT)
#define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
#endif /* LSE_STARTUP_TIMEOUT */
/**
* @brief External clock source for I2S peripheral
* This value is used by the I2S HAL module to compute the I2S clock source
* frequency, this source is inserted directly through I2S_CKIN pad.
*/
#if !defined (EXTERNAL_CLOCK_VALUE)
#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000) /*!< Value of the Internal oscillator in Hz*/
#endif /* EXTERNAL_CLOCK_VALUE */
/* Tip: To avoid modifying this file each time you need to use different HSE,
=== you can define the HSE value in your toolchain compiler preprocessor. */
/* ########################### System Configuration ######################### */
/**
* @brief This is the HAL system configuration section
*/
#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */
#define USE_RTOS 0
#define PREFETCH_ENABLE 0 /* The prefetch will be enabled in SystemClock_Config(), depending on the used
STM32F405/415/07/417 device: RevA (prefetch must be off) or RevZ (prefetch can be on/off) */
#define INSTRUCTION_CACHE_ENABLE 1
#define DATA_CACHE_ENABLE 1
/* ########################## Assert Selection ############################## */
/**
* @brief Uncomment the line below to expanse the "assert_param" macro in the
* HAL drivers code
*/
/* #define USE_FULL_ASSERT 1 */
/* ################## Ethernet peripheral configuration ##################### */
/* Section 1 : Ethernet peripheral configuration */
/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
#define MAC_ADDR0 2
#define MAC_ADDR1 0
#define MAC_ADDR2 0
#define MAC_ADDR3 0
#define MAC_ADDR4 0
#define MAC_ADDR5 0
/* Definition of the Ethernet driver buffers size and count */
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
#define ETH_RXBUFNB ((uint32_t)4) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
#define ETH_TXBUFNB ((uint32_t)4) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
/* Section 2: PHY configuration section */
/* DP83848 PHY Address*/
#define DP83848_PHY_ADDRESS 0x01
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
#define PHY_RESET_DELAY ((uint32_t)0x000000FF)
/* PHY Configuration delay */
#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFF)
#define PHY_READ_TO ((uint32_t)0x0000FFFF)
#define PHY_WRITE_TO ((uint32_t)0x0000FFFF)
/* Section 3: Common PHY Registers */
#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
/* Section 4: Extended PHY Registers */
#define PHY_SR ((uint16_t)0x10) /*!< PHY status register Offset */
#define PHY_MICR ((uint16_t)0x11) /*!< MII Interrupt Control Register */
#define PHY_MISR ((uint16_t)0x12) /*!< MII Interrupt Status and Misc. Control Register */
#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
/* Includes ------------------------------------------------------------------*/
/**
* @brief Include module's header file
*/
#ifdef HAL_RCC_MODULE_ENABLED
#include "stm32f4xx_hal_rcc.h"
#endif /* HAL_RCC_MODULE_ENABLED */
#ifdef HAL_GPIO_MODULE_ENABLED
#include "stm32f4xx_hal_gpio.h"
#endif /* HAL_GPIO_MODULE_ENABLED */
#ifdef HAL_DMA_MODULE_ENABLED
#include "stm32f4xx_hal_dma.h"
#endif /* HAL_DMA_MODULE_ENABLED */
#ifdef HAL_CORTEX_MODULE_ENABLED
#include "stm32f4xx_hal_cortex.h"
#endif /* HAL_CORTEX_MODULE_ENABLED */
#ifdef HAL_ADC_MODULE_ENABLED
#include "stm32f4xx_hal_adc.h"
#endif /* HAL_ADC_MODULE_ENABLED */
#ifdef HAL_CAN_MODULE_ENABLED
#include "stm32f4xx_hal_can.h"
#endif /* HAL_CAN_MODULE_ENABLED */
#ifdef HAL_CRC_MODULE_ENABLED
#include "stm32f4xx_hal_crc.h"
#endif /* HAL_CRC_MODULE_ENABLED */
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32f4xx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
#ifdef HAL_DMA2D_MODULE_ENABLED
#include "stm32f4xx_hal_dma2d.h"
#endif /* HAL_DMA2D_MODULE_ENABLED */
#ifdef HAL_DAC_MODULE_ENABLED
#include "stm32f4xx_hal_dac.h"
#endif /* HAL_DAC_MODULE_ENABLED */
#ifdef HAL_DCMI_MODULE_ENABLED
#include "stm32f4xx_hal_dcmi.h"
#endif /* HAL_DCMI_MODULE_ENABLED */
#ifdef HAL_ETH_MODULE_ENABLED
#include "stm32f4xx_hal_eth.h"
#endif /* HAL_ETH_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32f4xx_hal_flash.h"
#endif /* HAL_FLASH_MODULE_ENABLED */
#ifdef HAL_SRAM_MODULE_ENABLED
#include "stm32f4xx_hal_sram.h"
#endif /* HAL_SRAM_MODULE_ENABLED */
#ifdef HAL_NOR_MODULE_ENABLED
#include "stm32f4xx_hal_nor.h"
#endif /* HAL_NOR_MODULE_ENABLED */
#ifdef HAL_NAND_MODULE_ENABLED
#include "stm32f4xx_hal_nand.h"
#endif /* HAL_NAND_MODULE_ENABLED */
#ifdef HAL_PCCARD_MODULE_ENABLED
#include "stm32f4xx_hal_pccard.h"
#endif /* HAL_PCCARD_MODULE_ENABLED */
#ifdef HAL_SDRAM_MODULE_ENABLED
#include "stm32f4xx_hal_sdram.h"
#endif /* HAL_SDRAM_MODULE_ENABLED */
#ifdef HAL_HASH_MODULE_ENABLED
#include "stm32f4xx_hal_hash.h"
#endif /* HAL_HASH_MODULE_ENABLED */
#ifdef HAL_I2C_MODULE_ENABLED
#include "stm32f4xx_hal_i2c.h"
#endif /* HAL_I2C_MODULE_ENABLED */
#ifdef HAL_I2S_MODULE_ENABLED
#include "stm32f4xx_hal_i2s.h"
#endif /* HAL_I2S_MODULE_ENABLED */
#ifdef HAL_IWDG_MODULE_ENABLED
#include "stm32f4xx_hal_iwdg.h"
#endif /* HAL_IWDG_MODULE_ENABLED */
#ifdef HAL_LTDC_MODULE_ENABLED
#include "stm32f4xx_hal_ltdc.h"
#endif /* HAL_LTDC_MODULE_ENABLED */
#ifdef HAL_PWR_MODULE_ENABLED
#include "stm32f4xx_hal_pwr.h"
#endif /* HAL_PWR_MODULE_ENABLED */
#ifdef HAL_RNG_MODULE_ENABLED
#include "stm32f4xx_hal_rng.h"
#endif /* HAL_RNG_MODULE_ENABLED */
#ifdef HAL_RTC_MODULE_ENABLED
#include "stm32f4xx_hal_rtc.h"
#endif /* HAL_RTC_MODULE_ENABLED */
#ifdef HAL_SAI_MODULE_ENABLED
#include "stm32f4xx_hal_sai.h"
#endif /* HAL_SAI_MODULE_ENABLED */
#ifdef HAL_SD_MODULE_ENABLED
#include "stm32f4xx_hal_sd.h"
#endif /* HAL_SD_MODULE_ENABLED */
#ifdef HAL_SPI_MODULE_ENABLED
#include "stm32f4xx_hal_spi.h"
#endif /* HAL_SPI_MODULE_ENABLED */
#ifdef HAL_TIM_MODULE_ENABLED
#include "stm32f4xx_hal_tim.h"
#endif /* HAL_TIM_MODULE_ENABLED */
#ifdef HAL_UART_MODULE_ENABLED
#include "stm32f4xx_hal_uart.h"
#endif /* HAL_UART_MODULE_ENABLED */
#ifdef HAL_USART_MODULE_ENABLED
#include "stm32f4xx_hal_usart.h"
#endif /* HAL_USART_MODULE_ENABLED */
#ifdef HAL_IRDA_MODULE_ENABLED
#include "stm32f4xx_hal_irda.h"
#endif /* HAL_IRDA_MODULE_ENABLED */
#ifdef HAL_SMARTCARD_MODULE_ENABLED
#include "stm32f4xx_hal_smartcard.h"
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
#ifdef HAL_WWDG_MODULE_ENABLED
#include "stm32f4xx_hal_wwdg.h"
#endif /* HAL_WWDG_MODULE_ENABLED */
#ifdef HAL_PCD_MODULE_ENABLED
#include "stm32f4xx_hal_pcd.h"
#endif /* HAL_PCD_MODULE_ENABLED */
#ifdef HAL_HCD_MODULE_ENABLED
#include "stm32f4xx_hal_hcd.h"
#endif /* HAL_HCD_MODULE_ENABLED */
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_HAL_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"vuhungkt18@gmail.com"
] | vuhungkt18@gmail.com |
7a81dad0544f33a0e65809b0f39b7a9b5f311d93 | 8a42f7246f6df21dd810d80aa52cc7dbd95f598c | /vendor/lua/src/lapi.c | fc6f7a90c004966d3b84f1520a344198d1ac398f | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | calibercheats/client | c7da5b3783efc730249e5b223cb234c7175e748f | f69c0fcb5612e42231c48c181122909c5c57f47a | refs/heads/portability-five | 2021-01-24T15:43:37.294191 | 2016-07-24T20:07:09 | 2016-07-24T20:07:20 | 64,492,887 | 10 | 6 | null | 2016-07-29T15:57:29 | 2016-07-29T15:57:29 | null | UTF-8 | C | false | false | 33,247 | c | /*
** $Id: lapi.c,v 2.249 2015/04/06 12:23:48 roberto Exp $
** Lua API
** See Copyright Notice in lua.h
*/
#define lapi_c
#define LUA_CORE
#include "lprefix.h"
#include <stdarg.h>
#include <string.h>
#include "lua.h"
#include "lapi.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#include "lundump.h"
#include "lvm.h"
const char lua_ident[] =
"$LuaVersion: " LUA_COPYRIGHT " $"
"$LuaAuthors: " LUA_AUTHORS " $";
/* value at a non-valid index */
#define NONVALIDVALUE cast(TValue *, luaO_nilobject)
/* corresponding test */
#define isvalid(o) ((o) != luaO_nilobject)
/* test for pseudo index */
#define ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
/* test for upvalue */
#define isupvalue(i) ((i) < LUA_REGISTRYINDEX)
/* test for valid but not pseudo index */
#define isstackindex(i, o) (isvalid(o) && !ispseudo(i))
#define api_checkvalidindex(l,o) api_check(l, isvalid(o), "invalid index")
#define api_checkstackindex(l, i, o) \
api_check(l, isstackindex(i, o), "index not in the stack")
static TValue *index2addr (lua_State *L, int idx) {
CallInfo *ci = L->ci;
if (idx > 0) {
TValue *o = ci->func + idx;
api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index");
if (o >= L->top) return NONVALIDVALUE;
else return o;
}
else if (!ispseudo(idx)) { /* negative index */
api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
return L->top + idx;
}
else if (idx == LUA_REGISTRYINDEX)
return &G(L)->l_registry;
else { /* upvalues */
idx = LUA_REGISTRYINDEX - idx;
api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
if (ttislcf(ci->func)) /* light C function? */
return NONVALIDVALUE; /* it has no upvalues */
else {
CClosure *func = clCvalue(ci->func);
return (idx <= func->nupvalues) ? &func->upvalue[idx-1] : NONVALIDVALUE;
}
}
}
/*
** to be called by 'lua_checkstack' in protected mode, to grow stack
** capturing memory errors
*/
static void growstack (lua_State *L, void *ud) {
int size = *(int *)ud;
luaD_growstack(L, size);
}
LUA_API int lua_checkstack (lua_State *L, int n) {
int res;
CallInfo *ci = L->ci;
lua_lock(L);
api_check(L, n >= 0, "negative 'n'");
if (L->stack_last - L->top > n) /* stack large enough? */
res = 1; /* yes; check is OK */
else { /* no; need to grow stack */
int inuse = cast_int(L->top - L->stack) + EXTRA_STACK;
if (inuse > LUAI_MAXSTACK - n) /* can grow without overflow? */
res = 0; /* no */
else /* try to grow stack */
res = (luaD_rawrunprotected(L, &growstack, &n) == LUA_OK);
}
if (res && ci->top < L->top + n)
ci->top = L->top + n; /* adjust frame top */
lua_unlock(L);
return res;
}
LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {
int i;
if (from == to) return;
lua_lock(to);
api_checknelems(from, n);
api_check(from, G(from) == G(to), "moving among independent states");
api_check(from, to->ci->top - to->top >= n, "not enough elements to move");
from->top -= n;
for (i = 0; i < n; i++) {
setobj2s(to, to->top, from->top + i);
api_incr_top(to);
}
lua_unlock(to);
}
LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {
lua_CFunction old;
lua_lock(L);
old = G(L)->panic;
G(L)->panic = panicf;
lua_unlock(L);
return old;
}
LUA_API const lua_Number *lua_version (lua_State *L) {
static const lua_Number version = LUA_VERSION_NUM;
if (L == NULL) return &version;
else return G(L)->version;
}
/*
** basic stack manipulation
*/
/*
** convert an acceptable stack index into an absolute index
*/
LUA_API int lua_absindex (lua_State *L, int idx) {
return (idx > 0 || ispseudo(idx))
? idx
: cast_int(L->top - L->ci->func) + idx;
}
LUA_API int lua_gettop (lua_State *L) {
return cast_int(L->top - (L->ci->func + 1));
}
LUA_API void lua_settop (lua_State *L, int idx) {
StkId func = L->ci->func;
lua_lock(L);
if (idx >= 0) {
api_check(L, idx <= L->stack_last - (func + 1), "new top too large");
while (L->top < (func + 1) + idx)
setnilvalue(L->top++);
L->top = (func + 1) + idx;
}
else {
api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top");
L->top += idx+1; /* 'subtract' index (index is negative) */
}
lua_unlock(L);
}
/*
** Reverse the stack segment from 'from' to 'to'
** (auxiliary to 'lua_rotate')
*/
static void reverse (lua_State *L, StkId from, StkId to) {
for (; from < to; from++, to--) {
TValue temp;
setobj(L, &temp, from);
setobjs2s(L, from, to);
setobj2s(L, to, &temp);
}
}
/*
** Let x = AB, where A is a prefix of length 'n'. Then,
** rotate x n == BA. But BA == (A^r . B^r)^r.
*/
LUA_API void lua_rotate (lua_State *L, int idx, int n) {
StkId p, t, m;
lua_lock(L);
t = L->top - 1; /* end of stack segment being rotated */
p = index2addr(L, idx); /* start of segment */
api_checkstackindex(L, idx, p);
api_check(L, (n >= 0 ? n : -n) <= (t - p + 1), "invalid 'n'");
m = (n >= 0 ? t - n : p - n - 1); /* end of prefix */
reverse(L, p, m); /* reverse the prefix with length 'n' */
reverse(L, m + 1, t); /* reverse the suffix */
reverse(L, p, t); /* reverse the entire segment */
lua_unlock(L);
}
LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
TValue *fr, *to;
lua_lock(L);
fr = index2addr(L, fromidx);
to = index2addr(L, toidx);
api_checkvalidindex(L, to);
setobj(L, to, fr);
if (isupvalue(toidx)) /* function upvalue? */
luaC_barrier(L, clCvalue(L->ci->func), fr);
/* LUA_REGISTRYINDEX does not need gc barrier
(collector revisits it before finishing collection) */
lua_unlock(L);
}
LUA_API void lua_pushvalue (lua_State *L, int idx) {
lua_lock(L);
setobj2s(L, L->top, index2addr(L, idx));
api_incr_top(L);
lua_unlock(L);
}
/*
** access functions (stack -> C)
*/
LUA_API int lua_type (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
return (isvalid(o) ? ttnov(o) : LUA_TNONE);
}
LUA_API const char *lua_typename (lua_State *L, int t) {
UNUSED(L);
api_check(L, LUA_TNONE <= t && t < LUA_NUMTAGS, "invalid tag");
return ttypename(t);
}
LUA_API int lua_iscfunction (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
return (ttislcf(o) || (ttisCclosure(o)));
}
LUA_API int lua_isinteger (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
return ttisinteger(o);
}
LUA_API int lua_isnumber (lua_State *L, int idx) {
lua_Number n;
const TValue *o = index2addr(L, idx);
return tonumber(o, &n);
}
LUA_API int lua_isvector2 (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return ttisvector2(o);
}
LUA_API int lua_isvector3 (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return ttisvector3(o);
}
LUA_API int lua_isvector4 (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return ttisvector4(o);
}
LUA_API int lua_isquat (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return ttisquat(o);
}
LUA_API int lua_isstring (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return (ttisstring(o) || cvt2str(o));
}
LUA_API int lua_isuserdata (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return (ttisfulluserdata(o) || ttislightuserdata(o));
}
LUA_API int lua_rawequal (lua_State *L, int index1, int index2) {
StkId o1 = index2addr(L, index1);
StkId o2 = index2addr(L, index2);
return (isvalid(o1) && isvalid(o2)) ? luaV_rawequalobj(o1, o2) : 0;
}
LUA_API void lua_arith (lua_State *L, int op) {
lua_lock(L);
if (op != LUA_OPUNM && op != LUA_OPBNOT)
api_checknelems(L, 2); /* all other operations expect two operands */
else { /* for unary operations, add fake 2nd operand */
api_checknelems(L, 1);
setobjs2s(L, L->top, L->top - 1);
api_incr_top(L);
}
/* first operand at top - 2, second at top - 1; result go to top - 2 */
luaO_arith(L, op, L->top - 2, L->top - 1, L->top - 2);
L->top--; /* remove second operand */
lua_unlock(L);
}
LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
StkId o1, o2;
int i = 0;
lua_lock(L); /* may call tag method */
o1 = index2addr(L, index1);
o2 = index2addr(L, index2);
if (isvalid(o1) && isvalid(o2)) {
switch (op) {
case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
default: api_check(L, 0, "invalid option");
}
}
lua_unlock(L);
return i;
}
LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) {
size_t sz = luaO_str2num(s, L->top);
if (sz != 0)
api_incr_top(L);
return sz;
}
LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *pisnum) {
lua_Number n;
const TValue *o = index2addr(L, idx);
int isnum = tonumber(o, &n);
if (!isnum)
n = 0; /* call to 'tonumber' may change 'n' even if it fails */
if (pisnum) *pisnum = isnum;
return n;
}
LUA_API void lua_checkvector2 (lua_State *L, int idx, float *x, float *y) {
const TValue *o = index2addr(L, idx);
if (ttisvector2(o)) {
lua_Float4 f4 = v3value(o);
*x = f4.x;
*y = f4.y;
} else {
luaG_runerror(L, "Not a vector2");
}
}
LUA_API void lua_checkvector3 (lua_State *L, int idx, float *x, float *y, float *z) {
const TValue *o = index2addr(L, idx);
if (ttisvector3(o)) {
lua_Float4 f4 = v3value(o);
*x = f4.x;
*y = f4.y;
*z = f4.z;
} else {
luaG_runerror(L, "Not a vector3");
}
}
LUA_API void lua_checkvector4 (lua_State *L, int idx, float *x, float *y, float *z, float *w) {
const TValue *o = index2addr(L, idx);
if (ttisvector4(o)) {
lua_Float4 f4 = v4value(o);
*x = f4.x;
*y = f4.y;
*z = f4.z;
*w = f4.w;
} else {
luaG_runerror(L, "Not a vector4");
}
}
LUA_API void lua_checkquat (lua_State *L, int idx, float *w, float *x, float *y, float *z) {
const TValue *o = index2addr(L, idx);
if (ttisquat(o)) {
lua_Float4 f4 = qvalue(o);
*w = f4.w;
*x = f4.x;
*y = f4.y;
*z = f4.z;
} else {
luaG_runerror(L, "Not a quat");
}
}
LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *pisnum) {
lua_Integer res;
const TValue *o = index2addr(L, idx);
int isnum = tointeger(o, &res);
if (!isnum)
res = 0; /* call to 'tointeger' may change 'n' even if it fails */
if (pisnum) *pisnum = isnum;
return res;
}
LUA_API int lua_toboolean (lua_State *L, int idx) {
const TValue *o = index2addr(L, idx);
return !l_isfalse(o);
}
LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
StkId o = index2addr(L, idx);
if (!ttisstring(o)) {
if (!cvt2str(o)) { /* not convertible? */
if (len != NULL) *len = 0;
return NULL;
}
lua_lock(L); /* 'luaO_tostring' may create a new string */
luaC_checkGC(L);
o = index2addr(L, idx); /* previous call may reallocate the stack */
luaO_tostring(L, o);
lua_unlock(L);
}
if (len != NULL)
*len = vslen(o);
return svalue(o);
}
LUA_API size_t lua_rawlen (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
switch (ttype(o)) {
case LUA_TSHRSTR: return tsvalue(o)->shrlen;
case LUA_TLNGSTR: return tsvalue(o)->u.lnglen;
case LUA_TUSERDATA: return uvalue(o)->len;
case LUA_TTABLE: return luaH_getn(hvalue(o));
default: return 0;
}
}
LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
if (ttislcf(o)) return fvalue(o);
else if (ttisCclosure(o))
return clCvalue(o)->f;
else return NULL; /* not a C function */
}
LUA_API void *lua_touserdata (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
switch (ttnov(o)) {
case LUA_TUSERDATA: return getudatamem(uvalue(o));
case LUA_TLIGHTUSERDATA: return pvalue(o);
default: return NULL;
}
}
LUA_API lua_State *lua_tothread (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
return (!ttisthread(o)) ? NULL : thvalue(o);
}
LUA_API const void *lua_topointer (lua_State *L, int idx) {
StkId o = index2addr(L, idx);
switch (ttype(o)) {
case LUA_TTABLE: return hvalue(o);
case LUA_TLCL: return clLvalue(o);
case LUA_TCCL: return clCvalue(o);
case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o)));
case LUA_TTHREAD: return thvalue(o);
case LUA_TUSERDATA: return getudatamem(uvalue(o));
case LUA_TLIGHTUSERDATA: return pvalue(o);
default: return NULL;
}
}
/*
** push functions (C -> stack)
*/
LUA_API void lua_pushnil (lua_State *L) {
lua_lock(L);
setnilvalue(L->top);
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushnumber (lua_State *L, lua_Number n) {
lua_lock(L);
setfltvalue(L->top, n);
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushvector2 (lua_State *L, float x, float y) {
lua_Float4 f4 = { 0, 0, 0, 0 };
f4.x = x;
f4.y = y;
lua_lock(L);
setv2value(L->top, f4);
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushvector3 (lua_State *L, float x, float y, float z) {
lua_Float4 f4 = { 0, 0, 0, 0 };
f4.x = x;
f4.y = y;
f4.z = z;
lua_lock(L);
setv3value(L->top, f4);
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushvector4 (lua_State *L, float x, float y, float z, float w) {
lua_Float4 f4 = { 0, 0, 0, 0 };
f4.x = x;
f4.y = y;
f4.z = z;
f4.w = w;
lua_lock(L);
setv4value(L->top, f4);
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushquat (lua_State *L, float w, float x, float y, float z) {
lua_Float4 f4 = { 0, 0, 0, 0 };
f4.w = w;
f4.x = x;
f4.y = y;
f4.z = z;
lua_lock(L);
setqvalue(L->top, f4);
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {
lua_lock(L);
setivalue(L->top, n);
api_incr_top(L);
lua_unlock(L);
}
LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
TString *ts;
lua_lock(L);
luaC_checkGC(L);
ts = luaS_newlstr(L, s, len);
setsvalue2s(L, L->top, ts);
api_incr_top(L);
lua_unlock(L);
return getstr(ts);
}
LUA_API const char *lua_pushstring (lua_State *L, const char *s) {
lua_lock(L);
if (s == NULL)
setnilvalue(L->top);
else {
TString *ts;
luaC_checkGC(L);
ts = luaS_new(L, s);
setsvalue2s(L, L->top, ts);
s = getstr(ts); /* internal copy's address */
}
api_incr_top(L);
lua_unlock(L);
return s;
}
LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt,
va_list argp) {
const char *ret;
lua_lock(L);
luaC_checkGC(L);
ret = luaO_pushvfstring(L, fmt, argp);
lua_unlock(L);
return ret;
}
LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) {
const char *ret;
va_list argp;
lua_lock(L);
luaC_checkGC(L);
va_start(argp, fmt);
ret = luaO_pushvfstring(L, fmt, argp);
va_end(argp);
lua_unlock(L);
return ret;
}
LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
lua_lock(L);
if (n == 0) {
setfvalue(L->top, fn);
}
else {
CClosure *cl;
api_checknelems(L, n);
api_check(L, n <= MAXUPVAL, "upvalue index too large");
luaC_checkGC(L);
cl = luaF_newCclosure(L, n);
cl->f = fn;
L->top -= n;
while (n--) {
setobj2n(L, &cl->upvalue[n], L->top + n);
/* does not need barrier because closure is white */
}
setclCvalue(L, L->top, cl);
}
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushboolean (lua_State *L, int b) {
lua_lock(L);
setbvalue(L->top, (b != 0)); /* ensure that true is 1 */
api_incr_top(L);
lua_unlock(L);
}
LUA_API void lua_pushlightuserdata (lua_State *L, void *p) {
lua_lock(L);
setpvalue(L->top, p);
api_incr_top(L);
lua_unlock(L);
}
LUA_API int lua_pushthread (lua_State *L) {
lua_lock(L);
setthvalue(L, L->top, L);
api_incr_top(L);
lua_unlock(L);
return (G(L)->mainthread == L);
}
/*
** get functions (Lua -> stack)
*/
LUA_API int lua_getglobal (lua_State *L, const char *name) {
Table *reg = hvalue(&G(L)->l_registry);
const TValue *gt; /* global table */
lua_lock(L);
gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
setsvalue2s(L, L->top, luaS_new(L, name));
api_incr_top(L);
luaV_gettable(L, gt, L->top - 1, L->top - 1);
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API int lua_gettable (lua_State *L, int idx) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
luaV_gettable(L, t, L->top - 1, L->top - 1);
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API int lua_getfield (lua_State *L, int idx, const char *k) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
setsvalue2s(L, L->top, luaS_new(L, k));
api_incr_top(L);
luaV_gettable(L, t, L->top - 1, L->top - 1);
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
setivalue(L->top, n);
api_incr_top(L);
luaV_gettable(L, t, L->top - 1, L->top - 1);
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API int lua_rawget (lua_State *L, int idx) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
api_check(L, ttistable(t), "table expected");
setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1));
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API int lua_rawgeti (lua_State *L, int idx, lua_Integer n) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
api_check(L, ttistable(t), "table expected");
setobj2s(L, L->top, luaH_getint(hvalue(t), n));
api_incr_top(L);
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) {
StkId t;
TValue k;
lua_lock(L);
t = index2addr(L, idx);
api_check(L, ttistable(t), "table expected");
setpvalue(&k, cast(void *, p));
setobj2s(L, L->top, luaH_get(hvalue(t), &k));
api_incr_top(L);
lua_unlock(L);
return ttnov(L->top - 1);
}
LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
Table *t;
lua_lock(L);
luaC_checkGC(L);
t = luaH_new(L);
sethvalue(L, L->top, t);
api_incr_top(L);
if (narray > 0 || nrec > 0)
luaH_resize(L, t, narray, nrec);
lua_unlock(L);
}
LUA_API int lua_getmetatable (lua_State *L, int objindex) {
const TValue *obj;
Table *mt;
int res = 0;
lua_lock(L);
obj = index2addr(L, objindex);
switch (ttnov(obj)) {
case LUA_TTABLE:
mt = hvalue(obj)->metatable;
break;
case LUA_TUSERDATA:
mt = uvalue(obj)->metatable;
break;
default:
mt = G(L)->mt[ttnov(obj)];
break;
}
if (mt != NULL) {
sethvalue(L, L->top, mt);
api_incr_top(L);
res = 1;
}
lua_unlock(L);
return res;
}
LUA_API int lua_getuservalue (lua_State *L, int idx) {
StkId o;
lua_lock(L);
o = index2addr(L, idx);
api_check(L, ttisfulluserdata(o), "full userdata expected");
getuservalue(L, uvalue(o), L->top);
api_incr_top(L);
lua_unlock(L);
return ttnov(L->top - 1);
}
/*
** set functions (stack -> Lua)
*/
LUA_API void lua_setglobal (lua_State *L, const char *name) {
Table *reg = hvalue(&G(L)->l_registry);
const TValue *gt; /* global table */
lua_lock(L);
api_checknelems(L, 1);
gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
setsvalue2s(L, L->top, luaS_new(L, name));
api_incr_top(L);
luaV_settable(L, gt, L->top - 1, L->top - 2);
L->top -= 2; /* pop value and key */
lua_unlock(L);
}
LUA_API void lua_settable (lua_State *L, int idx) {
StkId t;
lua_lock(L);
api_checknelems(L, 2);
t = index2addr(L, idx);
luaV_settable(L, t, L->top - 2, L->top - 1);
L->top -= 2; /* pop index and value */
lua_unlock(L);
}
LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {
StkId t;
lua_lock(L);
api_checknelems(L, 1);
t = index2addr(L, idx);
setsvalue2s(L, L->top, luaS_new(L, k));
api_incr_top(L);
luaV_settable(L, t, L->top - 1, L->top - 2);
L->top -= 2; /* pop value and key */
lua_unlock(L);
}
LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) {
StkId t;
lua_lock(L);
api_checknelems(L, 1);
t = index2addr(L, idx);
setivalue(L->top, n);
api_incr_top(L);
luaV_settable(L, t, L->top - 1, L->top - 2);
L->top -= 2; /* pop value and key */
lua_unlock(L);
}
LUA_API void lua_rawset (lua_State *L, int idx) {
StkId o;
Table *t;
lua_lock(L);
api_checknelems(L, 2);
o = index2addr(L, idx);
api_check(L, ttistable(o), "table expected");
t = hvalue(o);
setobj2t(L, luaH_set(L, t, L->top-2), L->top-1);
invalidateTMcache(t);
luaC_barrierback(L, t, L->top-1);
L->top -= 2;
lua_unlock(L);
}
LUA_API void lua_rawseti (lua_State *L, int idx, lua_Integer n) {
StkId o;
Table *t;
lua_lock(L);
api_checknelems(L, 1);
o = index2addr(L, idx);
api_check(L, ttistable(o), "table expected");
t = hvalue(o);
luaH_setint(L, t, n, L->top - 1);
luaC_barrierback(L, t, L->top-1);
L->top--;
lua_unlock(L);
}
LUA_API void lua_rawsetp (lua_State *L, int idx, const void *p) {
StkId o;
Table *t;
TValue k;
lua_lock(L);
api_checknelems(L, 1);
o = index2addr(L, idx);
api_check(L, ttistable(o), "table expected");
t = hvalue(o);
setpvalue(&k, cast(void *, p));
setobj2t(L, luaH_set(L, t, &k), L->top - 1);
luaC_barrierback(L, t, L->top - 1);
L->top--;
lua_unlock(L);
}
LUA_API int lua_setmetatable (lua_State *L, int objindex) {
TValue *obj;
Table *mt;
lua_lock(L);
api_checknelems(L, 1);
obj = index2addr(L, objindex);
if (ttisnil(L->top - 1))
mt = NULL;
else {
api_check(L, ttistable(L->top - 1), "table expected");
mt = hvalue(L->top - 1);
}
switch (ttnov(obj)) {
case LUA_TTABLE: {
hvalue(obj)->metatable = mt;
if (mt) {
luaC_objbarrier(L, gcvalue(obj), mt);
luaC_checkfinalizer(L, gcvalue(obj), mt);
}
break;
}
case LUA_TUSERDATA: {
uvalue(obj)->metatable = mt;
if (mt) {
luaC_objbarrier(L, uvalue(obj), mt);
luaC_checkfinalizer(L, gcvalue(obj), mt);
}
break;
}
default: {
G(L)->mt[ttnov(obj)] = mt;
break;
}
}
L->top--;
lua_unlock(L);
return 1;
}
LUA_API void lua_setuservalue (lua_State *L, int idx) {
StkId o;
lua_lock(L);
api_checknelems(L, 1);
o = index2addr(L, idx);
api_check(L, ttisfulluserdata(o), "full userdata expected");
setuservalue(L, uvalue(o), L->top - 1);
luaC_barrier(L, gcvalue(o), L->top - 1);
L->top--;
lua_unlock(L);
}
/*
** 'load' and 'call' functions (run Lua code)
*/
#define checkresults(L,na,nr) \
api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
"results from function overflow current stack size")
LUA_API void lua_callk (lua_State *L, int nargs, int nresults,
lua_KContext ctx, lua_KFunction k) {
StkId func;
lua_lock(L);
api_check(L, k == NULL || !isLua(L->ci),
"cannot use continuations inside hooks");
api_checknelems(L, nargs+1);
api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
checkresults(L, nargs, nresults);
func = L->top - (nargs+1);
if (k != NULL && L->nny == 0) { /* need to prepare continuation? */
L->ci->u.c.k = k; /* save continuation */
L->ci->u.c.ctx = ctx; /* save context */
luaD_call(L, func, nresults, 1); /* do the call */
}
else /* no continuation or no yieldable */
luaD_call(L, func, nresults, 0); /* just do the call */
adjustresults(L, nresults);
lua_unlock(L);
}
/*
** Execute a protected call.
*/
struct CallS { /* data to 'f_call' */
StkId func;
int nresults;
};
static void f_call (lua_State *L, void *ud) {
struct CallS *c = cast(struct CallS *, ud);
luaD_call(L, c->func, c->nresults, 0);
}
LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
lua_KContext ctx, lua_KFunction k) {
struct CallS c;
int status;
ptrdiff_t func;
lua_lock(L);
api_check(L, k == NULL || !isLua(L->ci),
"cannot use continuations inside hooks");
api_checknelems(L, nargs+1);
api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread");
checkresults(L, nargs, nresults);
if (errfunc == 0)
func = 0;
else {
StkId o = index2addr(L, errfunc);
api_checkstackindex(L, errfunc, o);
func = savestack(L, o);
}
c.func = L->top - (nargs+1); /* function to be called */
if (k == NULL || L->nny > 0) { /* no continuation or no yieldable? */
c.nresults = nresults; /* do a 'conventional' protected call */
status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func);
}
else { /* prepare continuation (call is already protected by 'resume') */
CallInfo *ci = L->ci;
ci->u.c.k = k; /* save continuation */
ci->u.c.ctx = ctx; /* save context */
/* save information for error recovery */
ci->extra = savestack(L, c.func);
ci->u.c.old_errfunc = L->errfunc;
L->errfunc = func;
setoah(ci->callstatus, L->allowhook); /* save value of 'allowhook' */
ci->callstatus |= CIST_YPCALL; /* function can do error recovery */
luaD_call(L, c.func, nresults, 1); /* do the call */
ci->callstatus &= ~CIST_YPCALL;
L->errfunc = ci->u.c.old_errfunc;
status = LUA_OK; /* if it is here, there were no errors */
}
adjustresults(L, nresults);
lua_unlock(L);
return status;
}
LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
const char *chunkname, const char *mode) {
ZIO z;
int status;
lua_lock(L);
if (!chunkname) chunkname = "?";
luaZ_init(L, &z, reader, data);
status = luaD_protectedparser(L, &z, chunkname, mode);
if (status == LUA_OK) { /* no errors? */
LClosure *f = clLvalue(L->top - 1); /* get newly created function */
if (f->nupvalues >= 1) { /* does it have an upvalue? */
/* get global table from registry */
Table *reg = hvalue(&G(L)->l_registry);
const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
setobj(L, f->upvals[0]->v, gt);
luaC_upvalbarrier(L, f->upvals[0]);
}
}
lua_unlock(L);
return status;
}
LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) {
int status;
TValue *o;
lua_lock(L);
api_checknelems(L, 1);
o = L->top - 1;
if (isLfunction(o))
status = luaU_dump(L, getproto(o), writer, data, strip);
else
status = 1;
lua_unlock(L);
return status;
}
LUA_API int lua_status (lua_State *L) {
return L->status;
}
/*
** Garbage-collection function
*/
LUA_API int lua_gc (lua_State *L, int what, int data) {
int res = 0;
global_State *g;
lua_lock(L);
g = G(L);
switch (what) {
case LUA_GCSTOP: {
g->gcrunning = 0;
break;
}
case LUA_GCRESTART: {
luaE_setdebt(g, 0);
g->gcrunning = 1;
break;
}
case LUA_GCCOLLECT: {
luaC_fullgc(L, 0);
break;
}
case LUA_GCCOUNT: {
/* GC values are expressed in Kbytes: #bytes/2^10 */
res = cast_int(gettotalbytes(g) >> 10);
break;
}
case LUA_GCCOUNTB: {
res = cast_int(gettotalbytes(g) & 0x3ff);
break;
}
case LUA_GCSTEP: {
l_mem debt = 1; /* =1 to signal that it did an actual step */
int oldrunning = g->gcrunning;
g->gcrunning = 1; /* allow GC to run */
if (data == 0) {
luaE_setdebt(g, -GCSTEPSIZE); /* to do a "small" step */
luaC_step(L);
}
else { /* add 'data' to total debt */
debt = cast(l_mem, data) * 1024 + g->GCdebt;
luaE_setdebt(g, debt);
luaC_checkGC(L);
}
g->gcrunning = oldrunning; /* restore previous state */
if (debt > 0 && g->gcstate == GCSpause) /* end of cycle? */
res = 1; /* signal it */
break;
}
case LUA_GCSETPAUSE: {
res = g->gcpause;
g->gcpause = data;
break;
}
case LUA_GCSETSTEPMUL: {
res = g->gcstepmul;
if (data < 40) data = 40; /* avoid ridiculous low values (and 0) */
g->gcstepmul = data;
break;
}
case LUA_GCISRUNNING: {
res = g->gcrunning;
break;
}
default: res = -1; /* invalid option */
}
lua_unlock(L);
return res;
}
/*
** miscellaneous functions
*/
LUA_API void lua_extmemburden (lua_State *L, int sz) {
G(L)->totalbytes += sz;
G(L)->GCestimate += sz;
}
LUA_API int lua_error (lua_State *L) {
lua_lock(L);
api_checknelems(L, 1);
luaG_errormsg(L);
/* code unreachable; will unlock when control actually leaves the kernel */
return 0; /* to avoid warnings */
}
LUA_API int lua_next (lua_State *L, int idx) {
StkId t;
int more;
lua_lock(L);
t = index2addr(L, idx);
api_check(L, ttistable(t), "table expected");
more = luaH_next(L, hvalue(t), L->top - 1);
if (more) {
api_incr_top(L);
}
else /* no more elements */
L->top -= 1; /* remove key */
lua_unlock(L);
return more;
}
LUA_API void lua_concat (lua_State *L, int n) {
lua_lock(L);
api_checknelems(L, n);
if (n >= 2) {
luaC_checkGC(L);
luaV_concat(L, n);
}
else if (n == 0) { /* push empty string */
setsvalue2s(L, L->top, luaS_newlstr(L, "", 0));
api_incr_top(L);
}
/* else n == 1; nothing to do */
lua_unlock(L);
}
LUA_API void lua_len (lua_State *L, int idx) {
StkId t;
lua_lock(L);
t = index2addr(L, idx);
luaV_objlen(L, L->top, t);
api_incr_top(L);
lua_unlock(L);
}
LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) {
lua_Alloc f;
lua_lock(L);
if (ud) *ud = G(L)->ud;
f = G(L)->frealloc;
lua_unlock(L);
return f;
}
LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) {
lua_lock(L);
G(L)->ud = ud;
G(L)->frealloc = f;
lua_unlock(L);
}
LUA_API void *lua_newuserdata (lua_State *L, size_t size) {
Udata *u;
lua_lock(L);
luaC_checkGC(L);
u = luaS_newudata(L, size);
setuvalue(L, L->top, u);
api_incr_top(L);
lua_unlock(L);
return getudatamem(u);
}
static const char *aux_upvalue (StkId fi, int n, TValue **val,
CClosure **owner, UpVal **uv) {
switch (ttype(fi)) {
case LUA_TCCL: { /* C closure */
CClosure *f = clCvalue(fi);
if (!(1 <= n && n <= f->nupvalues)) return NULL;
*val = &f->upvalue[n-1];
if (owner) *owner = f;
return "";
}
case LUA_TLCL: { /* Lua closure */
LClosure *f = clLvalue(fi);
TString *name;
Proto *p = f->p;
if (!(1 <= n && n <= p->sizeupvalues)) return NULL;
*val = f->upvals[n-1]->v;
if (uv) *uv = f->upvals[n - 1];
name = p->upvalues[n-1].name;
return (name == NULL) ? "(*no name)" : getstr(name);
}
default: return NULL; /* not a closure */
}
}
LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {
const char *name;
TValue *val = NULL; /* to avoid warnings */
lua_lock(L);
name = aux_upvalue(index2addr(L, funcindex), n, &val, NULL, NULL);
if (name) {
setobj2s(L, L->top, val);
api_incr_top(L);
}
lua_unlock(L);
return name;
}
LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
const char *name;
TValue *val = NULL; /* to avoid warnings */
CClosure *owner = NULL;
UpVal *uv = NULL;
StkId fi;
lua_lock(L);
fi = index2addr(L, funcindex);
api_checknelems(L, 1);
name = aux_upvalue(fi, n, &val, &owner, &uv);
if (name) {
L->top--;
setobj(L, val, L->top);
if (owner) { luaC_barrier(L, owner, L->top); }
else if (uv) { luaC_upvalbarrier(L, uv); }
}
lua_unlock(L);
return name;
}
static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {
LClosure *f;
StkId fi = index2addr(L, fidx);
api_check(L, ttisLclosure(fi), "Lua function expected");
f = clLvalue(fi);
api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index");
if (pf) *pf = f;
return &f->upvals[n - 1]; /* get its upvalue pointer */
}
LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
StkId fi = index2addr(L, fidx);
switch (ttype(fi)) {
case LUA_TLCL: { /* lua closure */
return *getupvalref(L, fidx, n, NULL);
}
case LUA_TCCL: { /* C closure */
CClosure *f = clCvalue(fi);
api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index");
return &f->upvalue[n - 1];
}
default: {
api_check(L, 0, "closure expected");
return NULL;
}
}
}
LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
int fidx2, int n2) {
LClosure *f1;
UpVal **up1 = getupvalref(L, fidx1, n1, &f1);
UpVal **up2 = getupvalref(L, fidx2, n2, NULL);
luaC_upvdeccount(L, *up1);
*up1 = *up2;
(*up1)->refcount++;
if (upisopen(*up1)) (*up1)->u.open.touched = 1;
luaC_upvalbarrier(L, *up1);
}
| [
"bas@dotbas.net"
] | bas@dotbas.net |
1ff5470fc743a57a927a92cfe6ea22931493dd9d | de8c0ea84980b6d9bb6e3e23b87e6066a65f4995 | /3pp/linux/arch/sh/include/cpu-common/cpu/timer.h | af51438755e003aacb3d9309cb4d6db46ef13eef | [
"MIT",
"Linux-syscall-note",
"GPL-2.0-only"
] | permissive | eerimoq/monolinux-example-project | 7cc19c6fc179a6d1fd3ec60f383f906b727e6715 | 57c4c2928b11cc04db59fb5ced962762099a9895 | refs/heads/master | 2021-02-08T10:57:58.215466 | 2020-07-02T08:04:25 | 2020-07-02T08:04:25 | 244,144,570 | 6 | 0 | MIT | 2020-07-02T08:15:50 | 2020-03-01T12:24:47 | C | UTF-8 | C | false | false | 161 | h | /* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_CPU_SH2_TIMER_H
#define __ASM_CPU_SH2_TIMER_H
/* Nothing needed yet */
#endif /* __ASM_CPU_SH2_TIMER_H */
| [
"erik.moqvist@gmail.com"
] | erik.moqvist@gmail.com |
5d5335e772e33f783f412788315b062574d602d7 | 945b7828f14c4e9bbeea741bbb6e925b98fec118 | /CSC548_ParallelSystems_C_Cpp_Python_MPI_CUDA_OpenMP_OpenACC_PAPI_DMTCP_PERM_Spark_Hadoop_Tensorflow_Horovod/HW01_C_MPI/functions/p2_func8.c | c0b0397872e965de47ea40d0bc30de3b3a9ecbe0 | [] | no_license | AuroraTD/Portfolio | 0478ebc1a4519967b8dbfedd80fb6ae4ed32d7f4 | f24c336bdfb1144374ee97eedee3a81ed9c1f665 | refs/heads/master | 2020-04-17T18:52:20.448287 | 2019-04-29T12:47:45 | 2019-04-29T12:47:45 | 166,844,654 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 625 | c | /*************************************************************************************************************
* FILE: p2_func.c
*
* AUTHORS: attiffan Aurora T. Tiffany-Davis
*
* DESCRIPTION: A file that provides an input function to enable testing of derivative approximation
* We have many such functions defined and this is not the default one included in p2.makefile.
*************************************************************************************************************/
#include <math.h>
// function to return ln(x)
double fn (double x) {
return log(x);
}
| [
"aurora.tdavis@gmail.com"
] | aurora.tdavis@gmail.com |
89110b85d0eda5343d0640fb2b012759e57ae41f | 6b3896b41ab5ae1d88606188bf2f05a1442935b0 | /HARDWARE/__header/RM.h | 1fa54c18c1a1c03a6552fbda76584ab177ee2be0 | [] | no_license | focksor/FlightController | faba2ffc6fb751fece61213130893b5fd3258f4c | c0468c5ea51c1c862cf50e2d941ef5123a4e7f09 | refs/heads/master | 2021-09-16T21:30:14.614915 | 2018-04-12T08:57:07 | 2018-04-12T08:57:07 | 112,199,429 | 4 | 0 | null | null | null | null | UTF-8 | C | false | false | 241 | h | #ifndef __RM_H
#define __RM_H
#include "config.h"
#include "lcd.h"
#include "MOTOR.h"
#include "stdlib.h"
#include "stm32f10x.h"
extern unsigned char CH_Def;
void RM_Init(void);
unsigned char RC_Com(unsigned char,unsigned short);
#endif
| [
"focksor@outlook.com"
] | focksor@outlook.com |
ff9e592b1481329cd390475b43777d1bcfdcb7ec | dee52474971db4fcbc8696feab48ce63d141b2d3 | /Orso8TeV/macro/Plotting/2J0T/corrected/myRead.C | a8bf26338ab3928ec02481f7d262f278b737aa71 | [] | no_license | nadjieh/work | 7de0282f3ed107e25f596fd7d0a95f21793c8d29 | 3c9cc0319e1ab5cd240063f6dd940872b212ddce | refs/heads/master | 2016-09-01T17:34:31.112603 | 2014-02-07T22:43:32 | 2014-02-07T22:43:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,872 | c | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
string settitles(string s){
string ret="";
if(s == string("allW_BJet_Pt"))
ret = string("p_{T}^{b-jets} (GeV)");
if(s == string("Default_allWcosTheta"))
ret = string("cos(#theta_{l}*)");
if(s == string("allW_Muon_Pt"))
ret = string("p_{T}^{l}");
if(s == string("EtaFwD_allWcosTheta"))
ret = string("cos(#theta_{l}*)");
if(s == string("allW_FwD_Eta"))
ret = string("#eta_{jet}^{FwD}");
if(s == string("allW_Jet_Pt"))
ret = string("p_{T}^{jets} (GeV)");
if(s == string("allW_finalMT"))
ret = string("m_{T}^{W} (GeV)");
if(s == string("allW_Met_Pt"))
ret = string("E_{T}^{miss} (GeV)");
if(s == string("Default_allW_topMass"))
ret = string("m_{lb#nu} (GeV)");
return ret;
}
string setYtitles(string s){
string ret=string("Events @ 19.4 fb^{-1}");
if(s == string("allW_Jet_Pt"))
ret = string("Jets @ 19.4 fb^{-1}");
return ret;
}
string getlegend(){
string leg = " TLegend *leg = new TLegend(0.1516667,0.63,0.4983333,0.9516667,NULL,\"brNDC\");\n";
leg+=" leg->SetBorderSize(0);\n";
leg+=" leg->SetTextFont(62);\n";
leg+=" leg->SetTextSize(0.03);\n";
leg+=" leg->SetLineColor(1);\n";
leg+=" leg->SetLineStyle(1);\n";
leg+=" leg->SetLineWidth(1);\n";
leg+=" leg->SetFillColor(0);\n";
leg+=" leg->SetFillStyle(1001);\n";
leg+=" TLegendEntry *entry=leg->AddEntry(\"\",\"data\",\"lpf\");\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" entry->SetLineColor(1);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(1);\n";
leg+=" entry->SetMarkerStyle(20);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"t-channel\",\"lpf\");\n";
leg+=" entry->SetFillColor(2);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" entry->SetLineColor(2);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(2);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"tW-channel\",\"lpf\");\n";
leg+=" ci = TColor::GetColor(\"#ffcc00\");\n";
leg+=" entry->SetFillColor(ci);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" ci = TColor::GetColor(\"#ffcc00\");\n";
leg+=" entry->SetLineColor(ci);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(ci);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"s-channel\",\"lpf\");\n";
leg+=" entry->SetFillColor(5);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" entry->SetLineColor(5);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(5);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"t#bar{t}\",\"lpf\");\n";
leg+=" ci = TColor::GetColor(\"#cc33cc\");\n";
leg+=" entry->SetFillColor(ci);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" ci = TColor::GetColor(\"#cc33cc\");\n";
leg+=" entry->SetLineColor(ci);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(ci);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"W+Jets\",\"lpf\");\n";
leg+=" ci = TColor::GetColor(\"#0033ff\");\n";
leg+=" entry->SetFillColor(ci);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" ci = TColor::GetColor(\"#0033ff\");\n";
leg+=" entry->SetLineColor(ci);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(ci);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"#gamma^{*}/Z+Jets\",\"lpf\");\n";
leg+=" ci = TColor::GetColor(\"#00cc00\");\n";
leg+=" entry->SetFillColor(ci);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" ci = TColor::GetColor(\"#00cc00\");\n";
leg+=" entry->SetLineColor(ci);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(ci);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"\",\"QCD\",\"lpf\");\n";
leg+=" ci = TColor::GetColor(\"#663300\");\n";
leg+=" entry->SetFillColor(kGray);\n";
leg+=" entry->SetFillStyle(1001);\n";
leg+=" ci = TColor::GetColor(\"#663300\");\n";
leg+=" entry->SetLineColor(kGray);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(kGray);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(1);\n";
leg+=" entry=leg->AddEntry(\"NULL\",\"Stat. Unc.\",\"f\");\n";
leg+=" entry->SetFillColor(1);\n";
leg+=" entry->SetFillStyle(3004);\n";
leg+=" ci = TColor::GetColor(\"#000099\");\n";
leg+=" entry->SetLineColor(1);\n";
leg+=" entry->SetLineStyle(1);\n";
leg+=" entry->SetLineWidth(1);\n";
leg+=" entry->SetMarkerColor(1);\n";
leg+=" entry->SetMarkerStyle(1);\n";
leg+=" entry->SetMarkerSize(0);\n";
leg+=" entry->SetMarkerSize(0);\n";
leg+=" leg->Draw();\n";
leg+=" TLatex * tex = new TLatex(0.27,0.9684385,\"CMS preliminary, 19.4 fb^{-1} at #sqrt{s} = 8 TeV\");\n";
leg+=" tex->SetNDC();\n";
leg+=" tex->SetTextSize(0.03156146);\n";
leg+=" tex->SetLineWidth(2);\n";
leg+=" tex->Draw();\n";
leg+=" c->Modified();\n";
leg+=" c->cd();\n";
leg+=" c->SetSelected(c);\n}\n";
return leg;
}
void myRead(string s,string name, double scale =1) {//"bpt_Ele.C"
string line;
string preline;
ifstream myfile (name.c_str());
ofstream myfileOUT ((string("tmp/")+name).c_str());
int iLine = 0;
//string s = "allW_BJet_Pt";
string q = "\"\"";
string myLine = string(" ")+s+string("->Add(")+s+string(",")+q+string(");");
cout<<"---- "<<myLine<<endl;
string errName = "Draw(\"PE1sames\");";
if (myfile.is_open())
{
while ( myfile.good() )
{
preline = line;
getline (myfile,line);
if(string(line) == (" TLatex * tex = new TLatex(0.27,0.9684385,\"CMS preliminary, 19.4 fb^{-1} at #sqrt{s} = 8 TeV\");")){
myfileOUT<<" TLatex * tex = new TLatex(0.27,0.9684385,\"CMS preliminary, 19.8 fb^{-1} at #sqrt{s} = 8 TeV\");\n";
iLine++;
continue;
} else if (string(line).find("->GetYaxis()->SetTitle(\"Events @ 19.4 fb^{-1}\");") > 0 && string(line).find("->GetYaxis()->SetTitle(\"Events @ 19.4 fb^{-1}\");") < string(line).size()){
int pos = string(line).find("->GetYaxis()->SetTitle(\"Events @ 19.4 fb^{-1}\");");
myfileOUT<<string(line).substr(0,pos)<<"->GetYaxis()->SetTitle(\"Events @ 19.8 fb^{-1}\");\n";
iLine++;
continue;
} else {
myfileOUT<<line<<endl;
}
iLine++;
}
myfile.close();
myfileOUT<<"\n"<<getlegend()<<endl;
myfileOUT.close();
}
else cout << "Unable to open file";
}
void doJob(){
double scale = 1.;
myRead("Default_allWcosTheta","Ele_cosTheta_2j0tag.C",scale);
myRead("Default_allWcosTheta","Mu_cosTheta_2j0tag.C",1);
myRead("allW_Muon_Pt","Ele_ept_2j0t.C",scale);
myRead("allW_Muon_Pt","Mu_mupt_2j0t.C",1);
myRead("allW_FwD_Eta","Ele_etafwd_2j0t.C",scale);
myRead("allW_FwD_Eta","Mu_etafwd_2j0t.C",1);
myRead("allW_Jet_Pt","Ele_jetpt_2j0t.C",scale);
myRead("allW_Jet_Pt","Mu_jetpt_2j0t.C",1);
myRead("allW_finalMT","Ele_mt_2j0t.C",scale);
myRead("allW_Met_Pt","Mu_met_2j0t.C",1);
myRead("Default_allW_topMass","Ele_mtop_2j0t.C",scale);
myRead("Default_allW_topMass","Mu_mtop_2j0t.C",1);
}
| [
"ajafari@cern.ch"
] | ajafari@cern.ch |
f8923a99b6cd3821791e437a9814b1a3070a610c | 6ba22205362feb363c9103008b502d730be4d9fb | /System/Library/NanoPreferenceBundles/General/PairedUnlockSettings.bundle/PairedUnlockSettings-Structs.h | dcd353f0dc4081228490f86268cc5f99fefa13eb | [] | no_license | kasumar/iOS-9.3.3-iphoneheaders | 9a4b47dd27aabf37cf237b5b6e8437fde8b3ca89 | 4799de2d13be2c77c5f3d0b1ef750655c0daebd9 | refs/heads/master | 2020-04-06T04:49:07.178532 | 2016-07-29T20:17:36 | 2016-07-29T20:17:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 410 | h | /*
* This header is generated by classdump-dyld 1.0
* on Saturday, July 30, 2016 at 2:11:10 AM Japan Standard Time
* Operating System: Version 9.3.3 (Build 13G34)
* Image Source: /System/Library/NanoPreferenceBundles/General/PairedUnlockSettings.bundle/PairedUnlockSettings
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
typedef struct __MKBAssertion* MKBAssertionRef;
| [
"ichitaso@MBPR.local"
] | ichitaso@MBPR.local |
41153a7fa7654c7974eaaa57e153917662defbcd | 446a8236fcbf15c8bc5f3387dec9a2f3e0b2eb38 | /文件系统类/ATMEL FAT File System/target nand fs - 2004.5/CODE/fs 20045/POSIXFS/PERM.C | 85b34b2ee2a45650e644a248effa7d7525f40913 | [] | no_license | venkatarajasekhar/protocols | 5e12d7e5d9b636bf7fa1a61b4232e84da664c2de | b0c5010c05029750d9e11b02f6883a083fceec3a | refs/heads/master | 2020-06-21T04:59:04.461670 | 2013-08-08T03:22:44 | 2013-08-08T03:22:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,639 | c | /***********************************************************************/
/* */
/* Module: perm.c */
/* Release: 2004.5 */
/* Version: 2002.0 */
/* Purpose: Implements the check and set permission functions */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 2004, Blunk Microsystems */
/* ALL RIGHTS RESERVED */
/* */
/* Licensees have the non-exclusive right to use, modify, or extract */
/* this computer program for software development at a single site. */
/* This program may be resold or disseminated in executable format */
/* only. The source code may not be redistributed or resold. */
/* */
/***********************************************************************/
#include "../posix.h"
#include "../include/libc/errno.h"
#include "../include/fsprivate.h"
/***********************************************************************/
/* Global Function Definitions */
/***********************************************************************/
/***********************************************************************/
/* SetPerm: Set permissions on a file/dir about to be created */
/* */
/* Inputs: comm_ptr = pointer to common control block */
/* mode = mode for file/directory */
/* */
/***********************************************************************/
void SetPerm(FCOM_T *comm_ptr, mode_t mode)
{
uid_t uid;
gid_t gid;
/*-------------------------------------------------------------------*/
/* Get group and user ID for current process. */
/*-------------------------------------------------------------------*/
FsGetId(&uid, &gid);
/*-------------------------------------------------------------------*/
/* Set the permission mode. */
/*-------------------------------------------------------------------*/
comm_ptr->mode = mode;
/*-------------------------------------------------------------------*/
/* Set user and group ID. */
/*-------------------------------------------------------------------*/
comm_ptr->user_id = uid;
comm_ptr->group_id = gid;
}
/***********************************************************************/
/* CheckPerm: Check permissions on existing file or directory */
/* */
/* Inputs: comm_ptr = pointer to common control block */
/* permissions = permissions to check for file/dir */
/* */
/* Returns: 0 if permissions match, -1 otherwise */
/* */
/***********************************************************************/
int CheckPerm(FCOM_T *comm_ptr, int permissions)
{
uid_t uid;
gid_t gid;
/*-------------------------------------------------------------------*/
/* Get group and user ID for current process. */
/*-------------------------------------------------------------------*/
FsGetId(&uid, &gid);
/*-------------------------------------------------------------------*/
/* Check if we need to look at read permissions. */
/*-------------------------------------------------------------------*/
if (permissions & F_READ)
{
/*-----------------------------------------------------------------*/
/* If other has no read permission, check group. */
/*-----------------------------------------------------------------*/
if ((comm_ptr->mode & S_IROTH) == FALSE)
{
/*---------------------------------------------------------------*/
/* If not in group or group has no read permission, check owner. */
/*---------------------------------------------------------------*/
if ((gid != comm_ptr->group_id) || !(comm_ptr->mode & S_IRGRP))
{
/*-------------------------------------------------------------*/
/* If not user or user has no read permissions, return error. */
/*-------------------------------------------------------------*/
if ((uid != comm_ptr->user_id) || !(comm_ptr->mode & S_IRUSR))
{
set_errno(EACCES);
return -1;
}
}
}
}
/*-------------------------------------------------------------------*/
/* Check if we need to look at write permissions. */
/*-------------------------------------------------------------------*/
if (permissions & F_WRITE)
{
/*-----------------------------------------------------------------*/
/* If other has no write permission, check group. */
/*-----------------------------------------------------------------*/
if ((comm_ptr->mode & S_IWOTH) == 0)
{
/*---------------------------------------------------------------*/
/* If not in group or group has no write permission, check owner.*/
/*---------------------------------------------------------------*/
if ((gid != comm_ptr->group_id) || !(comm_ptr->mode & S_IWGRP))
{
/*-------------------------------------------------------------*/
/* If not user or user has no write permissions, return error. */
/*-------------------------------------------------------------*/
if ((uid != comm_ptr->user_id) || !(comm_ptr->mode & S_IWUSR))
{
set_errno(EACCES);
return -1;
}
}
}
}
/*-------------------------------------------------------------------*/
/* Check if we need to look at execute permissions. */
/*-------------------------------------------------------------------*/
if (permissions & F_EXECUTE)
{
/*-----------------------------------------------------------------*/
/* If other has no execute permission, check group. */
/*-----------------------------------------------------------------*/
if ((comm_ptr->mode & S_IXOTH) == 0)
{
/*---------------------------------------------------------------*/
/* If not in group or group can't execute, check owner. */
/*---------------------------------------------------------------*/
if ((gid != comm_ptr->group_id) || !(comm_ptr->mode & S_IXGRP))
{
/*-------------------------------------------------------------*/
/* If not user or user can't execute, return error. */
/*-------------------------------------------------------------*/
if ((uid != comm_ptr->user_id) || !(comm_ptr->mode & S_IXUSR))
{
set_errno(EACCES);
return -1;
}
}
}
}
return 0;
}
| [
"mrtos@163.com"
] | mrtos@163.com |
c8b43655221eeeefe7ca2123fd9a3e49919c8cbc | 0694bd6d62167c5407d1f33dd928cdd8f6fbaa3c | /kbuild/3.18.30/configs/dvr/i2/005A/glibc/include/generated/autoconf.h | 8dbc457925ef2f58c2903907c435ae8b73dc9992 | [] | no_license | jockyw2001/project | 6cffec28edfa3a06bb4fcf841fea845a74e0cbbf | bda3be305bcfe48305f01ead2373c22b2e0a7bbc | refs/heads/master | 2020-03-24T08:05:26.264503 | 2018-06-23T11:04:12 | 2018-06-23T11:04:12 | 142,585,130 | 1 | 0 | null | 2018-07-27T14:09:05 | 2018-07-27T14:09:05 | null | UTF-8 | C | false | false | 20,564 | h | /*
*
* Automatically generated file; DO NOT EDIT.
* Linux/arm 3.18.30 Kernel Configuration
*
*/
#define CONFIG_NOE_ETHTOOL 1
#define CONFIG_HAVE_ARCH_SECCOMP_FILTER 1
#define CONFIG_SCSI_DMA 1
#define CONFIG_ATAGS 1
#define CONFIG_MSTAR_DRIVERS 1
#define CONFIG_INPUT_KEYBOARD 1
#define CONFIG_MEMORY_ISOLATION 1
#define CONFIG_SLUB_CPU_PARTIAL 1
#define CONFIG_RFS_ACCEL 1
#define CONFIG_CRC32 1
#define CONFIG_I2C_BOARDINFO 1
#define CONFIG_VFP 1
#define CONFIG_AEABI 1
#define CONFIG_HIGH_RES_TIMERS 1
#define CONFIG_ARCH_MULTI_V6_V7 1
#define CONFIG_UEVENT_HELPER 1
#define CONFIG_NOE_HW_VLAN_TX 1
#define CONFIG_INOTIFY_USER 1
#define CONFIG_SCSI_LOGGING 1
#define CONFIG_NETWORK_FILESYSTEMS 1
#define CONFIG_MS_PWM 1
#define CONFIG_CRYPTO_MD4 1
#define CONFIG_SATA_AHCI_PLATFORM 1
#define CONFIG_CPU_FREQ_GOV_ONDEMAND 1
#define CONFIG_GLOB 1
#define CONFIG_ARCH_SUSPEND_POSSIBLE 1
#define CONFIG_ARM_UNWIND 1
#define CONFIG_SSB_POSSIBLE 1
#define CONFIG_MP_USB_MSTAR 1
#define CONFIG_MTD_CMDLINE_PARTS 1
#define CONFIG_UHID 1
#define CONFIG_GE2_GMII_AN_EXTPHY 1
#define CONFIG_USB_OHCI_LITTLE_ENDIAN 1
#define CONFIG_FSNOTIFY 1
#define CONFIG_CRYPTO_MANAGER_DISABLE_TESTS 1
#define CONFIG_HAVE_KERNEL_LZMA 1
#define CONFIG_ARCH_WANT_IPC_PARSE_VERSION 1
#define CONFIG_UNIX_DIAG 1
#define CONFIG_GENERIC_SMP_IDLE_THREAD 1
#define CONFIG_DEFAULT_SECURITY_DAC 1
#define CONFIG_MTD_PLATRAM 1
#define CONFIG_HAVE_IRQ_TIME_ACCOUNTING 1
#define CONFIG_CRYPTO_AEAD 1
#define CONFIG_BQL 1
#define CONFIG_INPUT_MOUSEDEV_PSAUX 1
#define CONFIG_DEFAULT_TCP_CONG "cubic"
#define CONFIG_UEVENT_HELPER_PATH ""
#define CONFIG_DEVTMPFS 1
#define CONFIG_NOE_HW_LRO 1
#define CONFIG_MS_GPIO 1
#define CONFIG_ANDROID_BINDER_IPC_MODULE 1
#define CONFIG_HOTPLUG_CPU 1
#define CONFIG_WLAN 1
#define CONFIG_NAMESPACES 1
#define CONFIG_MP_IRQ_TRACE 1
#define CONFIG_HAVE_ARM_SCU 1
#define CONFIG_DEBUG_RT_MUTEXES 1
#define CONFIG_CRYPTO_RNG2 1
#define CONFIG_MSTAR_CHIP_NAME "infinity2"
#define CONFIG_MSDOS_FS_MODULE 1
#define CONFIG_MAC_TO_GIGAPHY_MODE_ADDR 0x1
#define CONFIG_CFG80211_MODULE 1
#define CONFIG_OF_RESERVED_MEM 1
#define CONFIG_TREE_PREEMPT_RCU 1
#define CONFIG_NOE 1
#define CONFIG_HAVE_PROC_CPU 1
#define CONFIG_LZO_DECOMPRESS 1
#define CONFIG_USB_EHCI_ROOT_HUB_TT 1
#define CONFIG_USB 1
#define CONFIG_CRYPTO_HMAC 1
#define CONFIG_MSTAR_MMAHEAP 1
#define CONFIG_HAVE_DMA_CONTIGUOUS 1
#define CONFIG_DQL 1
#define CONFIG_COREDUMP 1
#define CONFIG_BCMA_POSSIBLE 1
#define CONFIG_FORCE_MAX_ZONEORDER 10
#define CONFIG_SND_SOC 1
#define CONFIG_MODULES_USE_ELF_REL 1
#define CONFIG_PRINTK 1
#define CONFIG_ETHERNET_ALBANY 1
#define CONFIG_MTD_CFI_I2 1
#define CONFIG_SHMEM 1
#define CONFIG_MTD 1
#define CONFIG_MIGRATION 1
#define CONFIG_HAVE_ARCH_JUMP_LABEL 1
#define CONFIG_MMC_BLOCK_MINORS 8
#define CONFIG_DEVTMPFS_MOUNT 1
#define CONFIG_DNOTIFY 1
#define CONFIG_INPUT_MOUSEDEV 1
#define CONFIG_GENERIC_NET_UTILS 1
#define CONFIG_ATA 1
#define CONFIG_MTD_TESTS_MODULE 1
#define CONFIG_CRYPTO_DES 1
#define CONFIG_ENABLE_MUST_CHECK 1
#define CONFIG_NLS_CODEPAGE_437 1
#define CONFIG_MTD_NAND_IDS 1
#define CONFIG_MTD_UBI_WL_THRESHOLD 4096
#define CONFIG_ARM_GIC 1
#define CONFIG_OLD_SIGSUSPEND3 1
#define CONFIG_SERIO 1
#define CONFIG_INPUT_MOUSE 1
#define CONFIG_ARCH_HAS_SG_CHAIN 1
#define CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS 1
#define CONFIG_RTC_INTF_SYSFS 1
#define CONFIG_CPU_FREQ_GOV_COMMON 1
#define CONFIG_BLK_DEV_INITRD 1
#define CONFIG_HAVE_BPF_JIT 1
#define CONFIG_ZLIB_INFLATE 1
#define CONFIG_RTC_INTF_PROC 1
#define CONFIG_ARCH_USE_BUILTIN_BSWAP 1
#define CONFIG_CMA_SIZE_SEL_MBYTES 1
#define CONFIG_STACKTRACE_SUPPORT 1
#define CONFIG_LOCKD_MODULE 1
#define CONFIG_ARM 1
#define CONFIG_JFFS2_FS 1
#define CONFIG_ARM_L1_CACHE_SHIFT 6
#define CONFIG_NO_HZ_IDLE 1
#define CONFIG_ARM_CPU_TOPOLOGY 1
#define CONFIG_KERNEL_XZ 1
#define CONFIG_MS_FLASH_ISP 1
#define CONFIG_USB_STORAGE 1
#define CONFIG_CPU_FREQ_GOV_PERFORMANCE 1
#define CONFIG_WATCHDOG_CORE 1
#define CONFIG_BLOCK 1
#define CONFIG_ETH_SKB_ALLOC_SELECT 1
#define CONFIG_INIT_ENV_ARG_LIMIT 32
#define CONFIG_TMPFS_POSIX_ACL 1
#define CONFIG_BUG 1
#define CONFIG_CLKSRC_OF 1
#define CONFIG_SPI 1
#define CONFIG_OF_IRQ 1
#define CONFIG_LIBFDT 1
#define CONFIG_NTFS_RW 1
#define CONFIG_DTC 1
#define CONFIG_REGMAP_SPI 1
#define CONFIG_SPLIT_PTLOCK_CPUS 4
#define CONFIG_CPU_CACHE_VIPT 1
#define CONFIG_WEXT_CORE 1
#define CONFIG_NLS 1
#define CONFIG_SYN_COOKIES 1
#define CONFIG_IRQ_WORK 1
#define CONFIG_IP_ADVANCED_ROUTER 1
#define CONFIG_ENABLE_WARN_DEPRECATED 1
#define CONFIG_USB_COMMON 1
#define CONFIG_CPU_FREQ_GOV_USERSPACE 1
#define CONFIG_LOG_CPU_MAX_BUF_SHIFT 12
#define CONFIG_OF_NET 1
#define CONFIG_ARM_ARCH_TIMER 1
#define CONFIG_DISCONNECT_DELAY_S 1
#define CONFIG_MS_MSYS 1
#define CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB 1
#define CONFIG_NLS_ISO8859_1 1
#define CONFIG_CRYPTO_WORKQUEUE 1
#define CONFIG_USB_EHCI_HCD 1
#define CONFIG_NOE_NAPI 1
#define CONFIG_MP_PLATFORM_GIC_SET_MULTIPLE_CPUS 1
#define CONFIG_NETDEVICES 1
#define CONFIG_HAVE_CONTEXT_TRACKING 1
#define CONFIG_IOSCHED_DEADLINE 1
#define CONFIG_CPU_TLB_V7 1
#define CONFIG_EVENTFD 1
#define CONFIG_FS_POSIX_ACL 1
#define CONFIG_DEFCONFIG_LIST "/lib/modules/$UNAME_RELEASE/.config"
#define CONFIG_USB_ANNOUNCE_NEW_DEVICES 1
#define CONFIG_JUMP_LABEL 1
#define CONFIG_MS_WATCHDOG 1
#define CONFIG_HZ_100 1
#define CONFIG_PROC_PAGE_MONITOR 1
#define CONFIG_CC_OPTIMIZE_FOR_SIZE 1
#define CONFIG_RCU_FANOUT_LEAF 16
#define CONFIG_BPF 1
#define CONFIG_RD_LZO 1
#define CONFIG_MS_L2X0_PATCH 1
#define CONFIG_MIGHT_HAVE_PCI 1
#define CONFIG_HAVE_ARCH_PFN_VALID 1
#define CONFIG_CPU_COPY_V6 1
#define CONFIG_AUTO_DETECT_WRITE 1
#define CONFIG_CRYPTO_DEFLATE 1
#define CONFIG_GENERIC_STRNLEN_USER 1
#define CONFIG_JFFS2_FS_DEBUG 0
#define CONFIG_MS_KERNEL_TYPE ""
#define CONFIG_HAVE_DYNAMIC_FTRACE 1
#define CONFIG_SPARSE_IRQ 1
#define CONFIG_RCU_STALL_COMMON 1
#define CONFIG_MP_PLATFORM_ARM 1
#define CONFIG_FAT_FS_MODULE 1
#define CONFIG_MMC_BLOCK_BOUNCE 1
#define CONFIG_GENERIC_CLOCKEVENTS 1
#define CONFIG_RWSEM_XCHGADD_ALGORITHM 1
#define CONFIG_HAVE_KERNEL_XZ 1
#define CONFIG_CPU_CP15_MMU 1
#define CONFIG_ARCH_SUPPORTS_ATOMIC_RMW 1
#define CONFIG_STOP_MACHINE 1
#define CONFIG_MS_I2C 1
#define CONFIG_CPU_FREQ 1
#define CONFIG_MODULE_FORCE_LOAD 1
#define CONFIG_NLS_ASCII_MODULE 1
#define CONFIG_TRACE_IRQFLAGS_SUPPORT 1
#define CONFIG_AUTO_DETECT 1
#define CONFIG_TCP_CONG_ADVANCED 1
#define CONFIG_UIO_PDRV_GENIRQ 1
#define CONFIG_CRYPTO_RNG 1
#define CONFIG_SND_USB 1
#define CONFIG_RD_GZIP 1
#define CONFIG_HAVE_REGS_AND_STACK_ACCESS_API 1
#define CONFIG_PWM_SYSFS 1
#define CONFIG_LBDAF 1
#define CONFIG_SWIOTLB 1
#define CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN 1
#define CONFIG_CRYPTO_MD5 1
#define CONFIG_BINFMT_ELF 1
#define CONFIG_SCSI_PROC_FS 1
#define CONFIG_HAVE_PERF_REGS 1
#define CONFIG_CPU_CP15 1
#define CONFIG_HZ_FIXED 0
#define CONFIG_MS_ZEN 1
#define CONFIG_DEBUG_MUTEXES 1
#define CONFIG_MS_IVE 1
#define CONFIG_HAVE_ARCH_AUDITSYSCALL 1
#define CONFIG_USE_OF 1
#define CONFIG_HARDIRQS_SW_RESEND 1
#define CONFIG_SPI_MASTER 1
#define CONFIG_ARCH_MULTI_V7 1
#define CONFIG_CRC16 1
#define CONFIG_GENERIC_CALIBRATE_DELAY 1
#define CONFIG_TMPFS 1
#define CONFIG_ANON_INODES 1
#define CONFIG_FUTEX 1
#define CONFIG_REGMAP_I2C 1
#define CONFIG_GENERIC_SCHED_CLOCK 1
#define CONFIG_VMSPLIT_3G 1
#define CONFIG_RTC_HCTOSYS 1
#define CONFIG_SERIAL_CORE_CONSOLE 1
#define CONFIG_CIFS_WEAK_PW_HASH 1
#define CONFIG_USB_HID 1
#define CONFIG_UBIFS_FS 1
#define CONFIG_ANDROID 1
#define CONFIG_CRYPTO_ZLIB 1
#define CONFIG_SYSVIPC 1
#define CONFIG_CRYPTO_PCOMP2 1
#define CONFIG_HAVE_DEBUG_KMEMLEAK 1
#define CONFIG_CMA_DEBUGFS 1
#define CONFIG_MODULES 1
#define CONFIG_CPU_HAS_ASID 1
#define CONFIG_EEPROM_LEGACY_MODULE 1
#define CONFIG_SOUND 1
#define CONFIG_ARCH_HIBERNATION_POSSIBLE 1
#define CONFIG_ARCH_MSTAR 1
#define CONFIG_UNIX 1
#define CONFIG_USB_NET_DRIVERS 1
#define CONFIG_NO_HZ_COMMON 1
#define CONFIG_HAVE_CLK 1
#define CONFIG_CRYPTO_HASH2 1
#define CONFIG_DEFAULT_HOSTNAME "(none)"
#define CONFIG_CPU_FREQ_GOV_POWERSAVE 1
#define CONFIG_RTC_INNER_MODULE 1
#define CONFIG_NFS_FS_MODULE 1
#define CONFIG_XPS 1
#define CONFIG_CRYPTO_ALGAPI 1
#define CONFIG_KEYBOARD_ATKBD 1
#define CONFIG_MTD_CFI_I1 1
#define CONFIG_NFS_COMMON 1
#define CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 1
#define CONFIG_CRYPTO_HASH 1
#define CONFIG_EFI_PARTITION 1
#define CONFIG_LOG_BUF_SHIFT 15
#define CONFIG_CACHE_L2X0 1
#define CONFIG_VFAT_FS_MODULE 1
#define CONFIG_PID_NS 1
#define CONFIG_CRC32_SLICEBY8 1
#define CONFIG_CPU_RMAP 1
#define CONFIG_SND_COMPRESS_OFFLOAD 1
#define CONFIG_AUTO_ZRELADDR 1
#define CONFIG_CPU_PABRT_V7 1
#define CONFIG_MTD_NAND_ECC 1
#define CONFIG_CRYPTO_CBC 1
#define CONFIG_SQUASHFS_DECOMP_SINGLE 1
#define CONFIG_RTC_CLASS 1
#define CONFIG_TMPFS_XATTR 1
#define CONFIG_IOMMU_HELPER 1
#define CONFIG_MS_USCLK_MODULE 1
#define CONFIG_HAVE_FUNCTION_TRACER 1
#define CONFIG_OUTER_CACHE 1
#define CONFIG_CPU_CACHE_V7 1
#define CONFIG_CRYPTO_MANAGER2 1
#define CONFIG_GENERIC_PCI_IOMAP 1
#define CONFIG_SLUB 1
#define CONFIG_CONFIGFS_FS 1
#define CONFIG_MTD_UBI 1
#define CONFIG_XZ_DEC_BCJ 1
#define CONFIG_I2C 1
#define CONFIG_SQUASHFS_4K_DEVBLK_SIZE 1
#define CONFIG_JFFS2_ZLIB 1
#define CONFIG_BINFMT_SCRIPT 1
#define CONFIG_MOUSE_PS2_CYPRESS 1
#define CONFIG_CPU_ABRT_EV7 1
#define CONFIG_MOUSE_PS2_LOGIPS2PP 1
#define CONFIG_TICK_CPU_ACCOUNTING 1
#define CONFIG_CRYPTO_ECB 1
#define CONFIG_SQUASHFS_LZO 1
#define CONFIG_DEBUG_FS 1
#define CONFIG_ARM_THUMBEE 1
#define CONFIG_CC_STACKPROTECTOR_REGULAR 1
#define CONFIG_HAVE_KERNEL_LZ4 1
#define CONFIG_ZLIB_DEFLATE 1
#define CONFIG_SUNRPC_MODULE 1
#define CONFIG_GPIO_SYSFS 1
#define CONFIG_KALLSYMS 1
#define CONFIG_COMMON_CLK 1
#define CONFIG_RTC_HCTOSYS_DEVICE "rtc0"
#define CONFIG_PWM 1
#define CONFIG_DECOMPRESS_XZ 1
#define CONFIG_MS_RTC 1
#define CONFIG_MII 1
#define CONFIG_SIGNALFD 1
#define CONFIG_MOUSE_PS2_ALPS 1
#define CONFIG_UNINLINE_SPIN_UNLOCK 1
#define CONFIG_HAVE_HW_BREAKPOINT 1
#define CONFIG_ARM_DMA_MEM_BUFFERABLE 1
#define CONFIG_MS_FLASH_ISP_MXP_PARTS 1
#define CONFIG_ARCH_WANT_GENERAL_HUGETLB 1
#define CONFIG_XZ_DEC 1
#define CONFIG_SATA_PMP 1
#define CONFIG_WATCHDOG 1
#define CONFIG_HAS_IOMEM 1
#define CONFIG_GPIO_DEVRES 1
#define CONFIG_GENERIC_IRQ_PROBE 1
#define CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND 1
#define CONFIG_MTD_MAP_BANK_WIDTH_1 1
#define CONFIG_SCHED_HRTICK 1
#define CONFIG_EPOLL 1
#define CONFIG_CRYPTO_LZO 1
#define CONFIG_SND_PCM 1
#define CONFIG_PARTITION_ADVANCED 1
#define CONFIG_TI_CMEM_MODULE 1
#define CONFIG_HAVE_NET_DSA 1
#define CONFIG_NET 1
#define CONFIG_SQUASHFS_FILE_DIRECT 1
#define CONFIG_INPUT_EVDEV 1
#define CONFIG_SND_JACK 1
#define CONFIG_EXT2_FS_MODULE 1
#define CONFIG_ARM_ARCH_TIMER_EVTSTREAM 1
#define CONFIG_VFPv3 1
#define CONFIG_PACKET 1
#define CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE 1
#define CONFIG_HAVE_CLK_PREPARE 1
#define CONFIG_NLS_CODEPAGE_949_MODULE 1
#define CONFIG_ETH_SLAB_ALLOC_SKB 1
#define CONFIG_INET 1
#define CONFIG_IP_ROUTE_VERBOSE 1
#define CONFIG_MSTAR_MIU 1
#define CONFIG_NOE_QDMA 1
#define CONFIG_RTC_LIB 1
#define CONFIG_HAVE_KPROBES 1
#define CONFIG_CRYPTO_AES 1
#define CONFIG_GPIOLIB 1
#define CONFIG_SWP_EMULATE 1
#define CONFIG_UIO 1
#define CONFIG_SQUASHFS_EMBEDDED 1
#define CONFIG_SERIO_SERPORT 1
#define CONFIG_CLONE_BACKWARDS 1
#define CONFIG_RD_XZ 1
#define CONFIG_PREEMPT_RCU 1
#define CONFIG_ATA_VERBOSE_ERROR 1
#define CONFIG_SND_DRIVERS 1
#define CONFIG_NET_FLOW_LIMIT 1
#define CONFIG_LOCKDEP_SUPPORT 1
#define CONFIG_NOE_CHECKSUM_OFFLOAD 1
#define CONFIG_NO_HZ 1
#define CONFIG_POSIX_MQUEUE 1
#define CONFIG_CPU_FREQ_STAT 1
#define CONFIG_GENERIC_STRNCPY_FROM_USER 1
#define CONFIG_MTD_BLKDEVS 1
#define CONFIG_ARM_HAS_SG_CHAIN 1
#define CONFIG_DEBUG_SPINLOCK 1
#define CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
#define CONFIG_NEED_DMA_MAP_STATE 1
#define CONFIG_SERIO_LIBPS2 1
#define CONFIG_PAGE_OFFSET 0xC0000000
#define CONFIG_CPU_V7 1
#define CONFIG_PANIC_TIMEOUT 0
#define CONFIG_ZBOOT_ROM_BSS 0x0
#define CONFIG_SATA_HOST_0 1
#define CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT 1
#define CONFIG_GE1_GMII_AN_EXTPHY 1
#define CONFIG_CFG80211_DEFAULT_PS 1
#define CONFIG_SMP 1
#define CONFIG_TTY 1
#define CONFIG_HAVE_KERNEL_GZIP 1
#define CONFIG_GENERIC_ALLOCATOR 1
#define CONFIG_KALLSYMS_ALL 1
#define CONFIG_GENERIC_IO 1
#define CONFIG_ARCH_NR_GPIO 0
#define CONFIG_GENERIC_BUG 1
#define CONFIG_CRYPTO_SHA256 1
#define CONFIG_HAVE_FTRACE_MCOUNT_RECORD 1
#define CONFIG_NOE_TX_RX_INT_SEPARATION 1
#define CONFIG_IOSCHED_NOOP 1
#define CONFIG_HAVE_UID16 1
#define CONFIG_ARM_ATAG_DTB_COMPAT 1
#define CONFIG_NEON 1
#define CONFIG_DEBUG_KERNEL 1
#define CONFIG_MTD_RAM 1
#define CONFIG_COMPAT_BRK 1
#define CONFIG_LOCALVERSION ""
#define CONFIG_CRYPTO 1
#define CONFIG_DEFAULT_MMAP_MIN_ADDR 4096
#define CONFIG_CMDLINE ""
#define CONFIG_USB_XHCI_HCD 1
#define CONFIG_HAVE_DMA_API_DEBUG 1
#define CONFIG_DEFAULT_CUBIC 1
#define CONFIG_HW_PERF_EVENTS 1
#define CONFIG_USB_ARCH_HAS_HCD 1
#define CONFIG_GENERIC_IRQ_SHOW 1
#define CONFIG_PANIC_ON_OOPS_VALUE 0
#define CONFIG_ALIGNMENT_TRAP 1
#define CONFIG_SCSI_MOD 1
#define CONFIG_SERIAL_CORE 1
#define CONFIG_FUSE_FS_MODULE 1
#define CONFIG_BUILDTIME_EXTABLE_SORT 1
#define CONFIG_HANDLE_DOMAIN_IRQ 1
#define CONFIG_UID16 1
#define CONFIG_EMBEDDED 1
#define CONFIG_MEMORY_START_ADDRESS 0x22400000
#define CONFIG_HAVE_KRETPROBES 1
#define CONFIG_MS_SATA_HOST_MODULE 1
#define CONFIG_HAS_DMA 1
#define CONFIG_SCSI 1
#define CONFIG_HID 1
#define CONFIG_CLKDEV_LOOKUP 1
#define CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE 3
#define CONFIG_PHYLIB 1
#define CONFIG_UBIFS_FS_ADVANCED_COMPR 1
#define CONFIG_FB_CMDLINE 1
#define CONFIG_IRQ_DOMAIN 1
#define CONFIG_UNCOMPRESS_INCLUDE "debug/uncompress.h"
#define CONFIG_JFFS2_RTIME 1
#define CONFIG_IPC_NS 1
#define CONFIG_MISC_FILESYSTEMS 1
#define CONFIG_HAVE_CC_STACKPROTECTOR 1
#define CONFIG_ARM_L1_CACHE_SHIFT_6 1
#define CONFIG_MIGHT_HAVE_CACHE_L2X0 1
#define CONFIG_ARCH_SUPPORTS_UPROBES 1
#define CONFIG_DEBUG_LL_INCLUDE "mach/debug-macro.S"
#define CONFIG_OF_GPIO 1
#define CONFIG_RCU_CPU_STALL_TIMEOUT 21
#define CONFIG_IP_ROUTE_MULTIPATH 1
#define CONFIG_CACHE_PL310 1
#define CONFIG_PROFILING 1
#define CONFIG_CRYPTO_ARC4 1
#define CONFIG_GRACE_PERIOD_MODULE 1
#define CONFIG_HAVE_SMP 1
#define CONFIG_MS_SPINAND 1
#define CONFIG_CRYPTO_MANAGER 1
#define CONFIG_EEPROM_AT24_MODULE 1
#define CONFIG_MTD_NAND 1
#define CONFIG_RT_MUTEXES 1
#define CONFIG_VECTORS_BASE 0xffff0000
#define CONFIG_KERNFS 1
#define CONFIG_MMC_BLOCK_MODULE 1
#define CONFIG_EXPERT 1
#define CONFIG_WIRELESS 1
#define CONFIG_WEXT_PROC 1
#define CONFIG_SQUASHFS 1
#define CONFIG_ARCH_MULTIPLATFORM 1
#define CONFIG_PERF_USE_VMALLOC 1
#define CONFIG_FAT_DEFAULT_IOCHARSET "iso8859-1"
#define CONFIG_MAC_TO_GIGAPHY_MODE_ADDR2 0x3
#define CONFIG_FRAME_WARN 4096
#define CONFIG_HID_GENERIC 1
#define CONFIG_GENERIC_HWEIGHT 1
#define CONFIG_INITRAMFS_SOURCE ""
#define CONFIG_CGROUPS 1
#define CONFIG_MMC_MODULE 1
#define CONFIG_LZO_COMPRESS 1
#define CONFIG_CRYPTO_SEQIV 1
#define CONFIG_STACKTRACE 1
#define CONFIG_MULTI_IRQ_HANDLER 1
#define CONFIG_RTCPWC_INNER_MODULE 1
#define CONFIG_OF_EARLY_FLATTREE 1
#define CONFIG_HAS_IOPORT_MAP 1
#define CONFIG_HZ 100
#define CONFIG_SQUASHFS_ZLIB 1
#define CONFIG_ARM_PATCH_PHYS_VIRT 1
#define CONFIG_MTD_UBI_BEB_LIMIT 20
#define CONFIG_DEFAULT_IOSCHED "deadline"
#define CONFIG_MS_SERIAL 1
#define CONFIG_HAVE_PERF_USER_STACK_DUMP 1
#define CONFIG_MSC005A_6A_S01A 1
#define CONFIG_NLATTR 1
#define CONFIG_TCP_CONG_CUBIC 1
#define CONFIG_NR_CPUS 2
#define CONFIG_WATCHDOG_NOWAYOUT 1
#define CONFIG_MOUSE_PS2_TRACKPOINT 1
#define CONFIG_SYSFS 1
#define CONFIG_USB_DEFAULT_PERSIST 1
#define CONFIG_MTD_PHYSMAP_OF 1
#define CONFIG_OUTER_CACHE_SYNC 1
#define CONFIG_ARM_THUMB 1
#define CONFIG_CC_STACKPROTECTOR 1
#define CONFIG_XZ_DEC_ARM 1
#define CONFIG_HAVE_SYSCALL_TRACEPOINTS 1
#define CONFIG_FB 1
#define CONFIG_CPU_32v7 1
#define CONFIG_MS_I2C_INFINITY2 1
#define CONFIG_MSDOS_PARTITION 1
#define CONFIG_HAVE_OPROFILE 1
#define CONFIG_HAVE_GENERIC_DMA_COHERENT 1
#define CONFIG_ARCH_HAVE_CUSTOM_GPIO_H 1
#define CONFIG_OLD_SIGACTION 1
#define CONFIG_CMA_SIZE_MBYTES 16
#define CONFIG_HAVE_ARCH_KGDB 1
#define CONFIG_SMP_ON_UP 1
#define CONFIG_ZONE_DMA_FLAG 0
#define CONFIG_RPS 1
#define CONFIG_MTD_MAP_BANK_WIDTH_2 1
#define CONFIG_GENERIC_IDLE_POLL_SETUP 1
#define CONFIG_IP_MULTICAST 1
#define CONFIG_SQUASHFS_XZ 1
#define CONFIG_CPU_32v6K 1
#define CONFIG_DEFAULT_SECURITY ""
#define CONFIG_TICK_ONESHOT 1
#define CONFIG_CRYPTO_CTR 1
#define CONFIG_MS_EMAC 1
#define CONFIG_WIRELESS_EXT 1
#define CONFIG_ANDROID_LOGGER 1
#define CONFIG_HAVE_DMA_ATTRS 1
#define CONFIG_HAVE_FUNCTION_GRAPH_TRACER 1
#define CONFIG_OF_MDIO 1
#define CONFIG_NTFS_FS_MODULE 1
#define CONFIG_MP_GLOBAL_TIMER_CLK 1
#define CONFIG_BASE_SMALL 1
#define CONFIG_CRYPTO_BLKCIPHER2 1
#define CONFIG_COMPACTION 1
#define CONFIG_NFS_V2_MODULE 1
#define CONFIG_PROC_FS 1
#define CONFIG_MTD_BLOCK 1
#define CONFIG_WEXT_PRIV 1
#define CONFIG_SCSI_LOWLEVEL 1
#define CONFIG_IRQ_FORCED_THREADING 1
#define CONFIG_CRYPTO_CMAC 1
#define CONFIG_SND 1
#define CONFIG_FLATMEM 1
#define CONFIG_PAGEFLAGS_EXTENDED 1
#define CONFIG_SYSCTL 1
#define CONFIG_HAVE_C_RECORDMCOUNT 1
#define CONFIG_HAVE_ARCH_TRACEHOOK 1
#define CONFIG_CIFS_MODULE 1
#define CONFIG_NET_NS 1
#define CONFIG_HAVE_PERF_EVENTS 1
#define CONFIG_NO_BOOTMEM 1
#define CONFIG_KERNEL_MODE_NEON 1
#define CONFIG_SYS_SUPPORTS_APM_EMULATION 1
#define CONFIG_CMA_AREAS 1
#define CONFIG_ARCH_INFINITY2 1
#define CONFIG_SND_TIMER 1
#define CONFIG_USB_EHCI_TT_NEWSCHED 1
#define CONFIG_FAT_DEFAULT_CODEPAGE 437
#define CONFIG_ARM_GLOBAL_TIMER 1
#define CONFIG_OF_FLATTREE 1
#define CONFIG_TRACING_SUPPORT 1
#define CONFIG_ARM_APPENDED_DTB 1
#define CONFIG_UNIX98_PTYS 1
#define CONFIG_NOE_TSO 1
#define CONFIG_NET_RX_BUSY_POLL 1
#define CONFIG_PRINTK_TIME 1
#define CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
#define CONFIG_IRQCHIP 1
#define CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER 1
#define CONFIG_HAVE_KERNEL_LZO 1
#define CONFIG_ELF_CORE 1
#define CONFIG_SATA_HOST_1 1
#define CONFIG_USB_SUPPORT 1
#define CONFIG_CMA_DEBUG 1
#define CONFIG_ANDROID_BINDER_IPC_32BIT 1
#define CONFIG_SOC_BUS 1
#define CONFIG_STAGING 1
#define CONFIG_INET_LRO 1
#define CONFIG_DMA_CMA 1
#define CONFIG_FLAT_NODE_MEM_MAP 1
#define CONFIG_MS_BUILTIN_DTB "infinity2-BGA1G"
#define CONFIG_CFG80211_WEXT 1
#define CONFIG_INPUT_EVBUG 1
#define CONFIG_POSIX_MQUEUE_SYSCTL 1
#define CONFIG_MP_USB_STR_PATCH 1
#define CONFIG_PREEMPT 1
#define CONFIG_OF_MTD 1
#define CONFIG_ARCH_HAS_TICK_BROADCAST 1
#define CONFIG_CPU_FREQ_STAT_DETAILS 1
#define CONFIG_GENERIC_CLOCKEVENTS_BUILD 1
#define CONFIG_MS_PIU_TIMER 1
#define CONFIG_SYSFS_SYSCALL 1
#define CONFIG_SYSVIPC_SYSCTL 1
#define CONFIG_RTC_SYSTOHC 1
#define CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 1
#define CONFIG_OF_ADDRESS 1
#define CONFIG_DECOMPRESS_GZIP 1
#define CONFIG_DECOMPRESS_LZO 1
#define CONFIG_I2C_CHARDEV 1
#define CONFIG_CROSS_COMPILE ""
#define CONFIG_GENERIC_CLOCKEVENTS_BROADCAST 1
#define CONFIG_MOUSE_PS2_SYNAPTICS 1
#define CONFIG_XZ_DEC_ARMTHUMB 1
#define CONFIG_ARCH_USE_CMPXCHG_LOCKREF 1
#define CONFIG_REGMAP 1
#define CONFIG_NLS_UTF8_MODULE 1
#define CONFIG_HAVE_MOD_ARCH_SPECIFIC 1
#define CONFIG_BLK_DEV_SD 1
#define CONFIG_MODULE_UNLOAD 1
#define CONFIG_PREEMPT_COUNT 1
#define CONFIG_CMA 1
#define CONFIG_RWSEM_SPIN_ON_OWNER 1
#define CONFIG_RCU_FANOUT 32
#define CONFIG_BITREVERSE 1
#define CONFIG_NOE_GMAC2 1
#define CONFIG_CRYPTO_PCOMP 1
#define CONFIG_CRYPTO_BLKCIPHER 1
#define CONFIG_FILE_LOCKING 1
#define CONFIG_SND_SOC_I2C_AND_SPI 1
#define CONFIG_AIO 1
#define CONFIG_MS_NOE 1
#define CONFIG_OF 1
#define CONFIG_PERF_EVENTS 1
#define CONFIG_RTC_INTF_DEV 1
#define CONFIG_MTD_MAP_BANK_WIDTH_4 1
#define CONFIG_DCACHE_WORD_ACCESS 1
#define CONFIG_DEFAULT_DEADLINE 1
#define CONFIG_MESSAGE_LOGLEVEL_DEFAULT 3
#define CONFIG_LOCKUP_DETECTOR 1
#define CONFIG_CMA_ALIGNMENT 4
#define CONFIG_NLS_DEFAULT "iso8859-1"
#define CONFIG_UTS_NS 1
#define CONFIG_HAVE_ARM_ARCH_TIMER 1
#define CONFIG_CRYPTO_AEAD2 1
#define CONFIG_DEBUG_INFO 1
#define CONFIG_MOUSE_PS2 1
#define CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE 0
#define CONFIG_CRYPTO_ALGAPI2 1
#define CONFIG_MS_OTG_ENABLE 1
#define CONFIG_UBIFS_FS_LZO 1
#define CONFIG_ZBOOT_ROM_TEXT 0x0
#define CONFIG_HAVE_MEMBLOCK 1
#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 1
#define CONFIG_INPUT 1
#define CONFIG_PROC_SYSCTL 1
#define CONFIG_MMU 1
#define CONFIG_KUSER_HELPERS 1
| [
"1339553896@qq.com"
] | 1339553896@qq.com |
4c12c12835833a7cb324ce9ae811011b8400aa1e | 943d51a06836e615d58a8888cef706d63d270a75 | /DUMP/HG_Damage_Mod_classes.h | feb7e7975910205aac63347cd45a64b803c51a87 | [] | no_license | hengtek/Back4BloodSDK | f1254133d004d7a5237013059d49c80f536879db | 25ab4c4ce2e140b7e6b7afaac443e836802c3b2d | refs/heads/main | 2023-07-05T03:23:01.152076 | 2021-08-15T15:03:38 | 2021-08-15T15:03:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 145 | h | // BlueprintGeneratedClass HG_Damage_Mod.HG_Damage_Mod_C
// Size: 0xe0 (Inherited: 0xe0)
struct UHG_Damage_Mod_C : UApplyGameplayEffectMod {
};
| [
"hsibma02@gmail.com"
] | hsibma02@gmail.com |
05b38c75276952ce3292167ec848525f1b5c26c1 | c87c36977652b6c76a3042a5df63f977461f68f5 | /Software/SDK1_1/demos/apps_sdk1.2/src/demos/ftm_pdb_adc_demo/ftm_pdb_adc_demo.c | ff9b36477ba16c1617e038149d1c8accdc155c07 | [
"MIT"
] | permissive | colossus212/Quadcopter_Will | a21abe97a881b66216e4764135c1786c191f29cf | fd0b0d3db28ff4d2b93b3c481a0378bd0302ae57 | refs/heads/master | 2021-01-15T22:57:42.411637 | 2015-03-20T10:01:03 | 2015-03-20T10:01:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 14,965 | c | /*
* Copyright (c) 2014, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
////////////////////////////////////////////////////////////////////////////////
// Includes
////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include "fsl_clock_manager.h"
#include "fsl_interrupt_manager.h"
#include "fsl_adc16_hal.h"
#include "fsl_pdb_hal.h"
#include "fsl_ftm_hal.h"
#include "board.h"
////////////////////////////////////////////////////////////////////////////////
// Definitions
////////////////////////////////////////////////////////////////////////////////
#define USE_STDIO_FUNCTIONS // Define this symbol to use STDIO functions
#define ADC_SC1A_POINTER 0U
#define ADC_SC1B_POINTER 1U
#define ADC_CHANNEL_1 1U
#define ADC_CHANNEL_5 5U
#define ADC_CHANNEL_7 7U
#define PDB_MODULO_VALUE 2000U
#define PDB_INT_VALUE 1500U
#define PDB_CH0 0U
#define PDB_CH1 1U
#define PDB_PRETRIGGER0 0U
#define PDB_PRETRIGGER1 1U
#define PRETRIGGER_DELAY_VALUE 500U
#define FTM_MODULO_VALUE 4678U
#define DEADTIME_VALUE 0x13U
////////////////////////////////////////////////////////////////////////////////
// Variables
////////////////////////////////////////////////////////////////////////////////
volatile uint16_t u16Result0A[256]={0};
volatile uint16_t u16Result0B[256]={0};
volatile uint16_t u16Result1A[256]={0};
volatile uint16_t u16Result1B[256]={0};
volatile uint16_t u16CycleTimes=0;
////////////////////////////////////////////////////////////////////////////////
// Prototypes
////////////////////////////////////////////////////////////////////////////////
void ADC0_IRQHandler(void);
void ADC1_IRQHandler(void);
uint8_t ADC_Calibration(uint32_t baseAddr);
////////////////////////////////////////////////////////////////////////////////
// Code
////////////////////////////////////////////////////////////////////////////////
int main(void)
{
// Buffer used to hold the string to be transmitted */
char sourceBuff[43] = {"\r\nRun pdb trig adc with flextimer demo.\n\n\r"};
uint32_t i;
uint16_t cnvvalue[6];
// Initialize standard SDK demo application pins
hardware_init();
// Call this function to initialize the console UART.
// This function enables the use of STDIO functions (printf, scanf, etc.)
dbg_uart_init();
// Print the initial banner
printf(sourceBuff);
// Enable [OUTDIV5] bit in SIM_CLKDIV1 register, set the divider to 4, clock source is 75/4 =18.75MHz
CLOCK_HAL_SetOutDiv5ENCmd(SIM_BASE, true);
CLOCK_HAL_SetOutDiv5(SIM_BASE, 3);
// Configure ADC0
// Enable ADC0 clock gate
CLOCK_SYS_EnableAdcClock(HW_ADC0);
// Calibrate ADC0
ADC_Calibration(ADC0_BASE);
// Enable ADC0 IRQ
INT_SYS_EnableIRQ(ADC0_IRQn );
// Select 12-bit single-end mode
ADC16_HAL_SetResolutionMode(ADC0_BASE, kAdcResolutionBitOf12or13);
// High speed configuration.
ADC16_HAL_SetHighSpeedCmd(ADC0_BASE, true);
// Conversion trigger selection.
ADC16_HAL_SetHwTriggerCmd(ADC0_BASE, true);
// Select alternative clock for ADC0 from outdiv5
ADC16_HAL_SetClkSrcMode(ADC0_BASE, kAdcClkSrcOfAltClk);
// Configure ADC1
// Enable ADC1 clock gate
CLOCK_SYS_EnableAdcClock(HW_ADC1);
// Calibrate ADC1
ADC_Calibration(ADC1_BASE);
// Enable ADC1 IRQ
INT_SYS_EnableIRQ(ADC1_IRQn );
// Conversion resolution mode.
// Select 12-bit single-end mode
ADC16_HAL_SetResolutionMode(ADC1_BASE, kAdcResolutionBitOf12or13);
// High speed configuration.
ADC16_HAL_SetHighSpeedCmd(ADC1_BASE, true);
// Conversion trigger selection.
ADC16_HAL_SetHwTriggerCmd(ADC1_BASE, true);
// Select alternative clock for ADC1 from outdiv5
ADC16_HAL_SetClkSrcMode(ADC1_BASE, kAdcClkSrcOfAltClk);
// Write adc0 channel 1 to SC1A register and enable interrupt
ADC16_HAL_ConfigChn(ADC0_BASE, ADC_SC1A_POINTER, true, false, ADC_CHANNEL_1);
// Write adc0 channel 5 to SC1A register and enable interrupt
ADC16_HAL_ConfigChn(ADC0_BASE, ADC_SC1B_POINTER, true, false, ADC_CHANNEL_5);
// Write adc1 channel 1 to SC1A register and enable interrupt
ADC16_HAL_ConfigChn(ADC1_BASE, ADC_SC1A_POINTER, true, false, ADC_CHANNEL_1);
// Write adc1 channel 7 to SC1A register and enable interrupt
ADC16_HAL_ConfigChn(ADC1_BASE, ADC_SC1B_POINTER, true, false, ADC_CHANNEL_7);
// Configure PDB module
// Enable PDB clock gate
CLOCK_SYS_EnablePdbClock(HW_PDB0);
// Clear PDB register
PDB_HAL_Init(PDB0_BASE);
// Enable PDB
PDB_HAL_Enable(PDB0_BASE);
// Set load register mode
PDB_HAL_SetLoadMode(PDB0_BASE, kPdbLoadImmediately);
// Select PDB external trigger source, it is from FTM0
PDB_HAL_SetTriggerSrcMode(PDB0_BASE, kPdbTrigger8);
// Select PDB modulo value
PDB_HAL_SetModulusValue(PDB0_BASE, PDB_MODULO_VALUE);
// Write int value
PDB_HAL_SetIntDelayValue(PDB0_BASE, PDB_INT_VALUE);
// Use PDB back-to-back mode, the channel 0 pre-trigger 0 is from delay counter flag, others trigger is from ADC acknowledge
// Set PDB channel 0, pre-trigger 0 delay counter to 200
PDB_HAL_SetPreTriggerDelayCount(PDB0_BASE, PDB_CH0, PDB_PRETRIGGER0, PRETRIGGER_DELAY_VALUE);
// Enable pre-trigger
PDB_HAL_SetPreTriggerCmd(PDB0_BASE, PDB_CH0, PDB_PRETRIGGER0, true);
PDB_HAL_SetPreTriggerCmd(PDB0_BASE, PDB_CH0, PDB_PRETRIGGER1, true);
PDB_HAL_SetPreTriggerCmd(PDB0_BASE, PDB_CH1, PDB_PRETRIGGER0, true);
PDB_HAL_SetPreTriggerCmd(PDB0_BASE, PDB_CH1, PDB_PRETRIGGER1, true);
// Enable pre-trigger output
PDB_HAL_SetPreTriggerOutputCmd(PDB0_BASE, PDB_CH0, PDB_PRETRIGGER0, true);
PDB_HAL_SetPreTriggerOutputCmd(PDB0_BASE, PDB_CH0, PDB_PRETRIGGER1, true);
PDB_HAL_SetPreTriggerOutputCmd(PDB0_BASE, PDB_CH1, PDB_PRETRIGGER0, true);
PDB_HAL_SetPreTriggerOutputCmd(PDB0_BASE, PDB_CH1, PDB_PRETRIGGER1, true);
// Set back-to-back mode
// Enable channel 0 pre-trigger 1 to back-to-back mode
PDB_HAL_SetPreTriggerBackToBackCmd(PDB0_BASE, PDB_CH0, PDB_PRETRIGGER1, true);
// Enable channel 1 pre-trigger 0 to back-to-back mode
PDB_HAL_SetPreTriggerBackToBackCmd(PDB0_BASE, PDB_CH1, PDB_PRETRIGGER0, true);
// Enable channel 1 pre-trigger 1 to back-to-back mode
PDB_HAL_SetPreTriggerBackToBackCmd(PDB0_BASE, PDB_CH1, PDB_PRETRIGGER1, true);
// load PDB register
PDB_HAL_SetLoadRegsCmd(PDB0_BASE);
// Configure FTM module
// Configure FTM0 as complementary combine mode, the frequency is 16KHz, and insert the dead time is 1us
// Enable FTM0 channel 0 trigger as FTM0 external trigger source for PDB
// configure FTM output pin
configure_ftm_pins(HW_FTM0);
// Enable FTM clock gate
CLOCK_SYS_EnableFtmClock(HW_FTM0);
FTM_HAL_Enable(FTM0_BASE, true);
// Clear CPWMS bit
FTM_HAL_SetCpwms(FTM0_BASE, false);
// Write FTM0 channel register
for(i=0; i<FSL_FEATURE_FTM_CHANNEL_COUNT; i+=2)
{
cnvvalue[i] = (1000 + i*100);
}
for(i=1; i<FSL_FEATURE_FTM_CHANNEL_COUNT; i+=2)
{
cnvvalue[i] = ((1000 + (i-1)*100) + (FTM_MODULO_VALUE + 1)*50/100);
if(cnvvalue[i] > FTM_MODULO_VALUE)
{
cnvvalue[i] = (FTM_MODULO_VALUE - 1);
}
}
for(i=0; i<FSL_FEATURE_FTM_CHANNEL_COUNT; i++)
{
FTM_HAL_SetChnMSnBAMode(FTM0_BASE, i, 2);
FTM_HAL_SetChnEdgeLevel(FTM0_BASE, i, 1);
FTM_HAL_SetChnCountVal(FTM0_BASE, i, cnvvalue[i]);
}
// Configure FTM0 channel ouput period is 16KHz complementary waveform (channel n and n+1)
// Insert the deadtime is 1us
// Modulo value is (75MHz/16KHz -1)
FTM_HAL_SetMod(FTM0_BASE, FTM_MODULO_VALUE);
FTM_HAL_SetWriteProtectionCmd(FTM0_BASE, false);
// Configure combine mode
for(i=0; i<FSL_FEATURE_FTM_CHANNEL_COUNT/2; i+=2)
{
FTM_HAL_SetDualChnCombineCmd(FTM0_BASE, i, true);
FTM_HAL_SetDualChnCompCmd(FTM0_BASE, i, true);
FTM_HAL_SetDualChnDeadtimeCmd(FTM0_BASE, i, true);
FTM_HAL_SetDualChnPwmSyncCmd(FTM0_BASE, i, true);
}
// Set deadtime to 1us
FTM_HAL_SetDeadtimePrescale(FTM0_BASE, kFtmDivided4);
FTM_HAL_SetDeadtimeCount(FTM0_BASE, DEADTIME_VALUE);
FTM_HAL_SetSoftwareTriggerCmd(FTM0_BASE, true);
for(i=1; i<FSL_FEATURE_FTM_CHANNEL_COUNT; i+=2)
{
// Enable channel select in PWMLOAD register
FTM_HAL_SetPwmLoadChnSelCmd(FTM0_BASE, i, true);
}
// Load FTM registers like MOD, CnV and INT
FTM_HAL_SetPwmLoadCmd(FTM0_BASE, true);
// Set PDB clock divide to 1
FTM_HAL_SetClockPs(FTM0_BASE, kFtmDividedBy1);
// Set PDB clock source, use system clock
FTM_HAL_SetClockSource(FTM0_BASE, kClock_source_FTM_SystemClk);
while(1)
{
// Input any character to start demo
printf("\r\nInput any character to start demo.\n\n\r");
getchar();
// Reset counter
FTM_HAL_SetCounter(FTM0_BASE, 0);
// Enable FTM0 channel0 trigger as external trigger
FTM_HAL_SetChnTriggerCmd(FTM0_BASE, HW_CHAN0, true);
// Wait data buffer is full
while(u16CycleTimes<255);
// Disable FTM0 channel0 trigger
FTM_HAL_SetChnTriggerCmd(FTM0_BASE, HW_CHAN0, false);
// Clear FTM0 channel external trigger flag, it will not trig PDB
if(FTM_HAL_IsChnTriggerGenerated(FTM0_BASE))
{
BW_FTM_EXTTRIG_TRIGF(FTM0_BASE, 0);
}
// Ouput ADC conversion result
for(i=0;i<256;i++)
{
printf("\r\n%d, %d, %d, %d\n\r",u16Result0A[i],u16Result0B[i],u16Result1A[i],u16Result1B[i]);
}
// Clear data buffer
for(i=0;i<256;i++)
{
u16Result0A[i]=0;
u16Result0B[i]=0;
u16Result1A[i]=0;
u16Result1B[i]=0;
}
u16CycleTimes=0;
}
}
/*!
* @brief ADC0 interrupt service routine, read data from result register
*/
void ADC0_IRQHandler(void)
{
if(ADC16_HAL_GetChnConvCompletedCmd(ADC0_BASE, ADC_SC1A_POINTER))
{
u16Result0A[u16CycleTimes] = ADC16_HAL_GetChnConvValueRAW(ADC0_BASE, ADC_SC1A_POINTER);
}
if(ADC16_HAL_GetChnConvCompletedCmd(ADC0_BASE, ADC_SC1B_POINTER))
{
u16Result0B[u16CycleTimes] = ADC16_HAL_GetChnConvValueRAW(ADC0_BASE, ADC_SC1B_POINTER);
}
}
/*!
* @brief ADC1 interrupt service routine, read data from result register
*/
void ADC1_IRQHandler(void)
{
if(ADC16_HAL_GetChnConvCompletedCmd(ADC1_BASE, ADC_SC1A_POINTER))
{
u16Result1A[u16CycleTimes] = ADC16_HAL_GetChnConvValueRAW(ADC1_BASE, ADC_SC1A_POINTER);
}
if(ADC16_HAL_GetChnConvCompletedCmd(ADC1_BASE, ADC_SC1B_POINTER))
{
u16Result1B[u16CycleTimes] = ADC16_HAL_GetChnConvValueRAW(ADC1_BASE, ADC_SC1B_POINTER);
if(u16CycleTimes<255)
{
u16CycleTimes++;
}
else
{
u16CycleTimes=0;
}
}
}
/*!
* @brief Perform ADC calibration function
*/
uint8_t ADC_Calibration(uint32_t baseAddr)
{
#if FSL_FEATURE_ADC_HAS_OFFSET_CORRECTION
uint32_t offsetValue;
#endif
uint32_t plusSideGainValue;
#if FSL_FEATURE_ADC_HAS_DIFF_MODE
uint32_t minusSideGainValue;
#endif
// Special configuration for highest accuracy.
// Enable clock for ADC.
if(baseAddr == ADC0_BASE)
{
CLOCK_SYS_EnableAdcClock(HW_ADC0);
}
else
{
CLOCK_SYS_EnableAdcClock(HW_ADC1);
}
ADC16_HAL_Init(baseAddr);
// Maximum Average.
#if FSL_FEATURE_ADC_HAS_HW_AVERAGE
ADC16_HAL_SetHwAverageCmd(baseAddr, true);
ADC16_HAL_SetHwAverageMode(baseAddr, kAdcHwAverageCountOf32);
#endif // FSL_FEATURE_ADC_HAS_HW_AVERAGE
// Lowest ADC Frequency.
ADC16_HAL_SetClkSrcMode(baseAddr, kAdcClkSrcOfBusClk);
ADC16_HAL_SetClkDividerMode(baseAddr, kAdcClkDividerInputOf8);
// Reference voltage as Vadd.
ADC16_HAL_SetRefVoltSrcMode(baseAddr, kAdcRefVoltSrcOfVref);
// Software trigger.
ADC16_HAL_SetHwTriggerCmd(baseAddr, false);
// Launch auto calibration.
ADC16_HAL_SetAutoCalibrationCmd(baseAddr, true);
while (!ADC16_HAL_GetChnConvCompletedCmd(baseAddr, ADC_SC1A_POINTER))
{
if (ADC16_HAL_GetAutoCalibrationFailedCmd(baseAddr))
{
return (uint8_t)false;
}
}
// Read parameters that generated by auto calibration.
#if FSL_FEATURE_ADC_HAS_OFFSET_CORRECTION
offsetValue = ADC16_HAL_GetOffsetValue(baseAddr);
#endif // FSL_FEATURE_ADC_HAS_OFFSET_CORRECTION
plusSideGainValue = ADC16_HAL_GetAutoPlusSideGainValue(baseAddr);
#if FSL_FEATURE_ADC_HAS_DIFF_MODE
minusSideGainValue = ADC16_HAL_GetAutoMinusSideGainValue(baseAddr);
#endif // FSL_FEATURE_ADC_HAS_DIFF_MODE
ADC16_HAL_Init(baseAddr);
#if FSL_FEATURE_ADC_HAS_OFFSET_CORRECTION
ADC16_HAL_SetOffsetValue(baseAddr, offsetValue);
#endif // FSL_FEATURE_ADC_HAS_OFFSET_CORRECTION
ADC16_HAL_SetPlusSideGainValue(baseAddr, plusSideGainValue);
#if FSL_FEATURE_ADC_HAS_DIFF_MODE
ADC16_HAL_SetMinusSideGainValue(baseAddr, minusSideGainValue);
#endif // FSL_FEATURE_ADC_HAS_DIFF_MODE
return (uint8_t)true;
}
////////////////////////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////////////////////////
| [
"wenjian_lin@163.com"
] | wenjian_lin@163.com |
ab03869f2adc0ed02002d37a39f87a53fdab669e | 45181479c15e604fe33b004eb323cecaa913c727 | /rt-thread/rt-thread/components/net/lwip-2.0.2/src/netif/slipif.c | 5ae6c299a55857570a0295b5374844b95c6c152a | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | weimingtom/f1c100s_rt-thread | 3b6b653f0606d066d2abed836325b7de9aaf4344 | f7b8b51a848c393d137658bb5e8514bab63ad099 | refs/heads/master | 2023-03-04T14:37:59.444166 | 2020-02-08T09:59:34 | 2020-02-08T09:59:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 16,024 | c | /**
* @file
* SLIP Interface
*
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is built upon the file: src/arch/rtxc/netif/sioslip.c
*
* Author: Magnus Ivarsson <magnus.ivarsson(at)volvo.com>
* Simon Goldschmidt
*/
/**
* @defgroup slipif SLIP netif
* @ingroup addons
*
* This is an arch independent SLIP netif. The specific serial hooks must be
* provided by another file. They are sio_open, sio_read/sio_tryread and sio_send
*
* Usage: This netif can be used in three ways:\n
* 1) For NO_SYS==0, an RX thread can be used which blocks on sio_read()
* until data is received.\n
* 2) In your main loop, call slipif_poll() to check for new RX bytes,
* completed packets are fed into netif->input().\n
* 3) Call slipif_received_byte[s]() from your serial RX ISR and
* slipif_process_rxqueue() from your main loop. ISR level decodes
* packets and puts completed packets on a queue which is fed into
* the stack from the main loop (needs SYS_LIGHTWEIGHT_PROT for
* pbuf_alloc to work on ISR level!).
*
*/
#include "netif/slipif.h"
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "lwip/sys.h"
#include "lwip/sio.h"
#define SLIP_END 0xC0 /* 0300: start and end of every packet */
#define SLIP_ESC 0xDB /* 0333: escape start (one byte escaped data follows) */
#define SLIP_ESC_END 0xDC /* 0334: following escape: original byte is 0xC0 (END) */
#define SLIP_ESC_ESC 0xDD /* 0335: following escape: original byte is 0xDB (ESC) */
/** Maximum packet size that is received by this netif */
#ifndef SLIP_MAX_SIZE
#define SLIP_MAX_SIZE 1500
#endif
/** Define this to the interface speed for SNMP
* (sio_fd is the sio_fd_t returned by sio_open).
* The default value of zero means 'unknown'.
*/
#ifndef SLIP_SIO_SPEED
#define SLIP_SIO_SPEED(sio_fd) 0
#endif
enum slipif_recv_state {
SLIP_RECV_NORMAL,
SLIP_RECV_ESCAPE
};
struct slipif_priv {
sio_fd_t sd;
/* q is the whole pbuf chain for a packet, p is the current pbuf in the chain */
struct pbuf *p, *q;
uint8_t state;
u16_t i, recved;
#if SLIP_RX_FROM_ISR
struct pbuf *rxpackets;
#endif
};
/**
* Send a pbuf doing the necessary SLIP encapsulation
*
* Uses the serial layer's sio_send()
*
* @param netif the lwip network interface structure for this slipif
* @param p the pbuf chain packet to send
* @return always returns ERR_OK since the serial layer does not provide return values
*/
static err_t
slipif_output(struct netif *netif, struct pbuf *p)
{
struct slipif_priv *priv;
struct pbuf *q;
u16_t i;
uint8_t c;
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
LWIP_ASSERT("p != NULL", (p != NULL));
LWIP_DEBUGF(SLIP_DEBUG, ("slipif_output(%"U16_F"): sending %"U16_F" bytes\n", (u16_t)netif->num, p->tot_len));
priv = (struct slipif_priv *)netif->state;
/* Send pbuf out on the serial I/O device. */
/* Start with packet delimiter. */
sio_send(SLIP_END, priv->sd);
for (q = p; q != NULL; q = q->next) {
for (i = 0; i < q->len; i++) {
c = ((uint8_t *)q->payload)[i];
switch (c) {
case SLIP_END:
/* need to escape this byte (0xC0 -> 0xDB, 0xDC) */
sio_send(SLIP_ESC, priv->sd);
sio_send(SLIP_ESC_END, priv->sd);
break;
case SLIP_ESC:
/* need to escape this byte (0xDB -> 0xDB, 0xDD) */
sio_send(SLIP_ESC, priv->sd);
sio_send(SLIP_ESC_ESC, priv->sd);
break;
default:
/* normal byte - no need for escaping */
sio_send(c, priv->sd);
break;
}
}
}
/* End with packet delimiter. */
sio_send(SLIP_END, priv->sd);
return ERR_OK;
}
#if LWIP_IPV4
/**
* Send a pbuf doing the necessary SLIP encapsulation
*
* Uses the serial layer's sio_send()
*
* @param netif the lwip network interface structure for this slipif
* @param p the pbuf chain packet to send
* @param ipaddr the ip address to send the packet to (not used for slipif)
* @return always returns ERR_OK since the serial layer does not provide return values
*/
static err_t
slipif_output_v4(struct netif *netif, struct pbuf *p, const ip4_addr_t *ipaddr)
{
LWIP_UNUSED_ARG(ipaddr);
return slipif_output(netif, p);
}
#endif /* LWIP_IPV4 */
#if LWIP_IPV6
/**
* Send a pbuf doing the necessary SLIP encapsulation
*
* Uses the serial layer's sio_send()
*
* @param netif the lwip network interface structure for this slipif
* @param p the pbuf chain packet to send
* @param ipaddr the ip address to send the packet to (not used for slipif)
* @return always returns ERR_OK since the serial layer does not provide return values
*/
static err_t
slipif_output_v6(struct netif *netif, struct pbuf *p, const ip6_addr_t *ipaddr)
{
LWIP_UNUSED_ARG(ipaddr);
return slipif_output(netif, p);
}
#endif /* LWIP_IPV6 */
/**
* Handle the incoming SLIP stream character by character
*
* @param netif the lwip network interface structure for this slipif
* @param c received character (multiple calls to this function will
* return a complete packet, NULL is returned before - used for polling)
* @return The IP packet when SLIP_END is received
*/
static struct pbuf*
slipif_rxbyte(struct netif *netif, uint8_t c)
{
struct slipif_priv *priv;
struct pbuf *t;
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
priv = (struct slipif_priv *)netif->state;
switch (priv->state) {
case SLIP_RECV_NORMAL:
switch (c) {
case SLIP_END:
if (priv->recved > 0) {
/* Received whole packet. */
/* Trim the pbuf to the size of the received packet. */
pbuf_realloc(priv->q, priv->recved);
LINK_STATS_INC(link.recv);
LWIP_DEBUGF(SLIP_DEBUG, ("slipif: Got packet (%"U16_F" bytes)\n", priv->recved));
t = priv->q;
priv->p = priv->q = NULL;
priv->i = priv->recved = 0;
return t;
}
return NULL;
case SLIP_ESC:
priv->state = SLIP_RECV_ESCAPE;
return NULL;
default:
break;
} /* end switch (c) */
break;
case SLIP_RECV_ESCAPE:
/* un-escape END or ESC bytes, leave other bytes
(although that would be a protocol error) */
switch (c) {
case SLIP_ESC_END:
c = SLIP_END;
break;
case SLIP_ESC_ESC:
c = SLIP_ESC;
break;
default:
break;
}
priv->state = SLIP_RECV_NORMAL;
break;
default:
break;
} /* end switch (priv->state) */
/* byte received, packet not yet completely received */
if (priv->p == NULL) {
/* allocate a new pbuf */
LWIP_DEBUGF(SLIP_DEBUG, ("slipif_input: alloc\n"));
priv->p = pbuf_alloc(PBUF_LINK, (PBUF_POOL_BUFSIZE - PBUF_LINK_HLEN - PBUF_LINK_ENCAPSULATION_HLEN), PBUF_POOL);
if (priv->p == NULL) {
LINK_STATS_INC(link.drop);
LWIP_DEBUGF(SLIP_DEBUG, ("slipif_input: no new pbuf! (DROP)\n"));
/* don't process any further since we got no pbuf to receive to */
return NULL;
}
if (priv->q != NULL) {
/* 'chain' the pbuf to the existing chain */
pbuf_cat(priv->q, priv->p);
} else {
/* p is the first pbuf in the chain */
priv->q = priv->p;
}
}
/* this automatically drops bytes if > SLIP_MAX_SIZE */
if ((priv->p != NULL) && (priv->recved <= SLIP_MAX_SIZE)) {
((uint8_t *)priv->p->payload)[priv->i] = c;
priv->recved++;
priv->i++;
if (priv->i >= priv->p->len) {
/* on to the next pbuf */
priv->i = 0;
if (priv->p->next != NULL && priv->p->next->len > 0) {
/* p is a chain, on to the next in the chain */
priv->p = priv->p->next;
} else {
/* p is a single pbuf, set it to NULL so next time a new
* pbuf is allocated */
priv->p = NULL;
}
}
}
return NULL;
}
/** Like slipif_rxbyte, but passes completed packets to netif->input
*
* @param netif The lwip network interface structure for this slipif
* @param c received character
*/
static void
slipif_rxbyte_input(struct netif *netif, uint8_t c)
{
struct pbuf *p;
p = slipif_rxbyte(netif, c);
if (p != NULL) {
if (netif->input(p, netif) != ERR_OK) {
pbuf_free(p);
}
}
}
#if SLIP_USE_RX_THREAD
/**
* The SLIP input thread.
*
* Feed the IP layer with incoming packets
*
* @param nf the lwip network interface structure for this slipif
*/
static void
slipif_loop_thread(void *nf)
{
uint8_t c;
struct netif *netif = (struct netif *)nf;
struct slipif_priv *priv = (struct slipif_priv *)netif->state;
while (1) {
if (sio_read(priv->sd, &c, 1) > 0) {
slipif_rxbyte_input(netif, c);
}
}
}
#endif /* SLIP_USE_RX_THREAD */
/**
* SLIP netif initialization
*
* Call the arch specific sio_open and remember
* the opened device in the state field of the netif.
*
* @param netif the lwip network interface structure for this slipif
* @return ERR_OK if serial line could be opened,
* ERR_MEM if no memory could be allocated,
* ERR_IF is serial line couldn't be opened
*
* @note netif->num must contain the number of the serial port to open
* (0 by default). If netif->state is != NULL, it is interpreted as an
* uint8_t pointer pointing to the serial port number instead of netif->num.
*
*/
err_t
slipif_init(struct netif *netif)
{
struct slipif_priv *priv;
uint8_t sio_num;
LWIP_DEBUGF(SLIP_DEBUG, ("slipif_init: netif->num=%"U16_F"\n", (u16_t)netif->num));
/* Allocate private data */
priv = (struct slipif_priv *)mem_malloc(sizeof(struct slipif_priv));
if (!priv) {
return ERR_MEM;
}
netif->name[0] = 's';
netif->name[1] = 'l';
#if LWIP_IPV4
netif->output = slipif_output_v4;
#endif /* LWIP_IPV4 */
#if LWIP_IPV6
netif->output_ip6 = slipif_output_v6;
#endif /* LWIP_IPV6 */
netif->mtu = SLIP_MAX_SIZE;
/* netif->state or netif->num contain the port number */
if (netif->state != NULL) {
sio_num = *(uint8_t*)netif->state;
} else {
sio_num = netif->num;
}
/* Try to open the serial port. */
priv->sd = sio_open(sio_num);
if (!priv->sd) {
/* Opening the serial port failed. */
mem_free(priv);
return ERR_IF;
}
/* Initialize private data */
priv->p = NULL;
priv->q = NULL;
priv->state = SLIP_RECV_NORMAL;
priv->i = 0;
priv->recved = 0;
#if SLIP_RX_FROM_ISR
priv->rxpackets = NULL;
#endif
netif->state = priv;
/* initialize the snmp variables and counters inside the struct netif */
MIB2_INIT_NETIF(netif, snmp_ifType_slip, SLIP_SIO_SPEED(priv->sd));
#if SLIP_USE_RX_THREAD
/* Create a thread to poll the serial line. */
sys_thread_new(SLIPIF_THREAD_NAME, slipif_loop_thread, netif,
SLIPIF_THREAD_STACKSIZE, SLIPIF_THREAD_PRIO);
#endif /* SLIP_USE_RX_THREAD */
return ERR_OK;
}
/**
* Polls the serial device and feeds the IP layer with incoming packets.
*
* @param netif The lwip network interface structure for this slipif
*/
void
slipif_poll(struct netif *netif)
{
uint8_t c;
struct slipif_priv *priv;
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
priv = (struct slipif_priv *)netif->state;
while (sio_tryread(priv->sd, &c, 1) > 0) {
slipif_rxbyte_input(netif, c);
}
}
#if SLIP_RX_FROM_ISR
/**
* Feeds the IP layer with incoming packets that were receive
*
* @param netif The lwip network interface structure for this slipif
*/
void
slipif_process_rxqueue(struct netif *netif)
{
struct slipif_priv *priv;
SYS_ARCH_DECL_PROTECT(old_level);
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
priv = (struct slipif_priv *)netif->state;
SYS_ARCH_PROTECT(old_level);
while (priv->rxpackets != NULL) {
struct pbuf *p = priv->rxpackets;
#if SLIP_RX_QUEUE
/* dequeue packet */
struct pbuf *q = p;
while ((q->len != q->tot_len) && (q->next != NULL)) {
q = q->next;
}
priv->rxpackets = q->next;
q->next = NULL;
#else /* SLIP_RX_QUEUE */
priv->rxpackets = NULL;
#endif /* SLIP_RX_QUEUE */
SYS_ARCH_UNPROTECT(old_level);
if (netif->input(p, netif) != ERR_OK) {
pbuf_free(p);
}
SYS_ARCH_PROTECT(old_level);
}
}
/** Like slipif_rxbyte, but queues completed packets.
*
* @param netif The lwip network interface structure for this slipif
* @param data Received serial byte
*/
static void
slipif_rxbyte_enqueue(struct netif *netif, uint8_t data)
{
struct pbuf *p;
struct slipif_priv *priv = (struct slipif_priv *)netif->state;
SYS_ARCH_DECL_PROTECT(old_level);
p = slipif_rxbyte(netif, data);
if (p != NULL) {
SYS_ARCH_PROTECT(old_level);
if (priv->rxpackets != NULL) {
#if SLIP_RX_QUEUE
/* queue multiple pbufs */
struct pbuf *q = p;
while (q->next != NULL) {
q = q->next;
}
q->next = p;
} else {
#else /* SLIP_RX_QUEUE */
pbuf_free(priv->rxpackets);
}
{
#endif /* SLIP_RX_QUEUE */
priv->rxpackets = p;
}
SYS_ARCH_UNPROTECT(old_level);
}
}
/**
* Process a received byte, completed packets are put on a queue that is
* fed into IP through slipif_process_rxqueue().
*
* This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled.
*
* @param netif The lwip network interface structure for this slipif
* @param data received character
*/
void
slipif_received_byte(struct netif *netif, uint8_t data)
{
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
slipif_rxbyte_enqueue(netif, data);
}
/**
* Process multiple received byte, completed packets are put on a queue that is
* fed into IP through slipif_process_rxqueue().
*
* This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled.
*
* @param netif The lwip network interface structure for this slipif
* @param data received character
* @param len Number of received characters
*/
void
slipif_received_bytes(struct netif *netif, uint8_t *data, uint8_t len)
{
uint8_t i;
uint8_t *rxdata = data;
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
for (i = 0; i < len; i++, rxdata++) {
slipif_rxbyte_enqueue(netif, *rxdata);
}
}
#endif /* SLIP_RX_FROM_ISR */
| [
"9866328@qq.com"
] | 9866328@qq.com |
773e39c8e6b3f21fdc8ba23e506bc2ee6b89688b | 7f25d2d9672ac24938c3bf2b5e6725ef144419fa | /ML/NLP/c-programs/array6.c | 7bc59f2bf62de0da8520a7964b5ac6fadb551a3d | [] | no_license | chandanbcsm012/AI-Materials | 0fb3868b713581a926086dde42f87c0fb6799a77 | 5814a51fb6793c6d94d29cc3be73ec18cd059f07 | refs/heads/master | 2022-12-11T03:26:43.211706 | 2020-09-13T01:53:09 | 2020-09-13T01:53:09 | 293,808,053 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 124 | c | #include<stdio.h>
void main()
{
int a[3]={2,3,4};
int i;
for(i=0;i<3;i++)
{
printf("%d\n",a[i]);
}
} | [
"chandanbcsm012@gmail.com"
] | chandanbcsm012@gmail.com |
9d100039dc921a4ad20e15e201fa9c414ac6cc88 | 4d9190c2926ebbd6e0751336787f90bd82441918 | /Code/signals/signal.c | 48601b7ffe52b9a8ef5af228397bedc2f16e58dd | [] | no_license | mohit-ingale/Operating_Systems | 5aac9c0b7517e27ec13560d11bfd67a9527702a9 | 5fd5dc995606767d19ea3e23224c78869c56e071 | refs/heads/master | 2020-12-05T08:43:23.300029 | 2020-01-06T08:50:27 | 2020-01-06T08:50:27 | 232,060,055 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 442 | c | #include<stdio.h>
#include <signal.h>
#include<string.h>
#include<unistd.h>
void sighandler(int signum,siginfo_t info)
{
printf("you think i am interrupt no!!!\n i am signal from linux\n");
}
int main(int argc, char const *argv[]) {
struct sigaction sa;
memset(&sa,0,sizeof(sa));
sa.sa_sigaction=sighandler;
sigaction(SIGUSR1,&sa,NULL);
while(1)
{
printf("i am waiting for your signal\n");
sleep(1);
}
return 0;
}
| [
"mohitingale5@gmail.com"
] | mohitingale5@gmail.com |
2b51e8fd627571c919c4fb9a74214e9a9bbdb3a9 | 5a24327bb172aa98e8092c08a648948c3bbe7a50 | /DarkSUSY_mH_125/mGammaD_2000/cT_500/DarkSusy_mH_125_mGammaD_2000_cT_5_LHE_dimuon_m_fake.C | dbd12cb3f2f49fa508737aff07814bf2202bb1f5 | [] | no_license | cms-tamu/MuJetAnalysis_DarkSusySamples_LHE_8TeV_03 | 06c920e0611937f31e8d302a61694bed2bcc0f64 | aeb11a14a0a2e05804fe890f65bc3a1a224d89d5 | refs/heads/master | 2016-09-15T22:35:16.768732 | 2015-03-18T14:28:38 | 2015-03-18T14:28:38 | 31,564,465 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 16,790 | c | {
//=========Macro generated from canvas: cnv/cnv
//========= (Mon Mar 16 17:12:18 2015) by ROOT version5.34/18
TCanvas *cnv = new TCanvas("cnv", "cnv",1320,22,904,928);
gStyle->SetOptFit(1);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
cnv->SetHighLightColor(2);
cnv->Range(-26.5625,-0.007541109,129.6875,0.05046743);
cnv->SetFillColor(0);
cnv->SetBorderMode(0);
cnv->SetBorderSize(2);
cnv->SetTickx(1);
cnv->SetTicky(1);
cnv->SetLeftMargin(0.17);
cnv->SetRightMargin(0.03);
cnv->SetTopMargin(0.07);
cnv->SetBottomMargin(0.13);
cnv->SetFrameFillStyle(0);
cnv->SetFrameBorderMode(0);
cnv->SetFrameFillStyle(0);
cnv->SetFrameBorderMode(0);
TH1F *h_dimuon_m_fake_dummy = new TH1F("h_dimuon_m_fake_dummy","h_dimuon_m_fake_dummy",125,0,125);
h_dimuon_m_fake_dummy->SetMaximum(0.04640683);
h_dimuon_m_fake_dummy->SetLineStyle(0);
h_dimuon_m_fake_dummy->SetMarkerStyle(20);
h_dimuon_m_fake_dummy->GetXaxis()->SetTitle("Mass of Fake #mu#mu [GeV]");
h_dimuon_m_fake_dummy->GetXaxis()->SetLabelFont(42);
h_dimuon_m_fake_dummy->GetXaxis()->SetLabelOffset(0.007);
h_dimuon_m_fake_dummy->GetXaxis()->SetTitleSize(0.06);
h_dimuon_m_fake_dummy->GetXaxis()->SetTitleOffset(0.95);
h_dimuon_m_fake_dummy->GetXaxis()->SetTitleFont(42);
h_dimuon_m_fake_dummy->GetYaxis()->SetTitle("Fraction of events / 1 GeV");
h_dimuon_m_fake_dummy->GetYaxis()->SetNdivisions(508);
h_dimuon_m_fake_dummy->GetYaxis()->SetLabelFont(42);
h_dimuon_m_fake_dummy->GetYaxis()->SetLabelOffset(0.007);
h_dimuon_m_fake_dummy->GetYaxis()->SetTitleSize(0.06);
h_dimuon_m_fake_dummy->GetYaxis()->SetTitleOffset(1.35);
h_dimuon_m_fake_dummy->GetYaxis()->SetTitleFont(42);
h_dimuon_m_fake_dummy->GetZaxis()->SetLabelFont(42);
h_dimuon_m_fake_dummy->GetZaxis()->SetLabelOffset(0.007);
h_dimuon_m_fake_dummy->GetZaxis()->SetTitleSize(0.06);
h_dimuon_m_fake_dummy->GetZaxis()->SetTitleFont(42);
h_dimuon_m_fake_dummy->Draw("");
TH1F *h_dimuon_m_fake_0__62 = new TH1F("h_dimuon_m_fake_0__62","h_dimuon_m_fake_0",125,0,125);
h_dimuon_m_fake_0__62->SetBinContent(1,0.001900024);
h_dimuon_m_fake_0__62->SetBinContent(2,0.007656346);
h_dimuon_m_fake_0__62->SetBinContent(3,0.0117689);
h_dimuon_m_fake_0__62->SetBinContent(4,0.01491894);
h_dimuon_m_fake_0__62->SetBinContent(5,0.01722522);
h_dimuon_m_fake_0__62->SetBinContent(6,0.01856273);
h_dimuon_m_fake_0__62->SetBinContent(7,0.02046901);
h_dimuon_m_fake_0__62->SetBinContent(8,0.02165652);
h_dimuon_m_fake_0__62->SetBinContent(9,0.02225653);
h_dimuon_m_fake_0__62->SetBinContent(10,0.02304404);
h_dimuon_m_fake_0__62->SetBinContent(11,0.02381905);
h_dimuon_m_fake_0__62->SetBinContent(12,0.02441281);
h_dimuon_m_fake_0__62->SetBinContent(13,0.02458781);
h_dimuon_m_fake_0__62->SetBinContent(14,0.02571907);
h_dimuon_m_fake_0__62->SetBinContent(15,0.02578157);
h_dimuon_m_fake_0__62->SetBinContent(16,0.02559407);
h_dimuon_m_fake_0__62->SetBinContent(17,0.02555657);
h_dimuon_m_fake_0__62->SetBinContent(18,0.02510656);
h_dimuon_m_fake_0__62->SetBinContent(19,0.02473156);
h_dimuon_m_fake_0__62->SetBinContent(20,0.02447531);
h_dimuon_m_fake_0__62->SetBinContent(21,0.0242628);
h_dimuon_m_fake_0__62->SetBinContent(22,0.0239128);
h_dimuon_m_fake_0__62->SetBinContent(23,0.02283153);
h_dimuon_m_fake_0__62->SetBinContent(24,0.02286904);
h_dimuon_m_fake_0__62->SetBinContent(25,0.02157527);
h_dimuon_m_fake_0__62->SetBinContent(26,0.02213778);
h_dimuon_m_fake_0__62->SetBinContent(27,0.02131277);
h_dimuon_m_fake_0__62->SetBinContent(28,0.020394);
h_dimuon_m_fake_0__62->SetBinContent(29,0.020019);
h_dimuon_m_fake_0__62->SetBinContent(30,0.01884399);
h_dimuon_m_fake_0__62->SetBinContent(31,0.01880023);
h_dimuon_m_fake_0__62->SetBinContent(32,0.01795647);
h_dimuon_m_fake_0__62->SetBinContent(33,0.01768147);
h_dimuon_m_fake_0__62->SetBinContent(34,0.01687521);
h_dimuon_m_fake_0__62->SetBinContent(35,0.01628145);
h_dimuon_m_fake_0__62->SetBinContent(36,0.01588145);
h_dimuon_m_fake_0__62->SetBinContent(37,0.01506269);
h_dimuon_m_fake_0__62->SetBinContent(38,0.01397518);
h_dimuon_m_fake_0__62->SetBinContent(39,0.01365642);
h_dimuon_m_fake_0__62->SetBinContent(40,0.01374392);
h_dimuon_m_fake_0__62->SetBinContent(41,0.01243141);
h_dimuon_m_fake_0__62->SetBinContent(42,0.0120814);
h_dimuon_m_fake_0__62->SetBinContent(43,0.01103764);
h_dimuon_m_fake_0__62->SetBinContent(44,0.01137514);
h_dimuon_m_fake_0__62->SetBinContent(45,0.01038138);
h_dimuon_m_fake_0__62->SetBinContent(46,0.01039388);
h_dimuon_m_fake_0__62->SetBinContent(47,0.009668871);
h_dimuon_m_fake_0__62->SetBinContent(48,0.009168864);
h_dimuon_m_fake_0__62->SetBinContent(49,0.008500107);
h_dimuon_m_fake_0__62->SetBinContent(50,0.008356354);
h_dimuon_m_fake_0__62->SetBinContent(51,0.007593845);
h_dimuon_m_fake_0__62->SetBinContent(52,0.007393843);
h_dimuon_m_fake_0__62->SetBinContent(53,0.006837585);
h_dimuon_m_fake_0__62->SetBinContent(54,0.007093839);
h_dimuon_m_fake_0__62->SetBinContent(55,0.005962574);
h_dimuon_m_fake_0__62->SetBinContent(56,0.006025075);
h_dimuon_m_fake_0__62->SetBinContent(57,0.005531319);
h_dimuon_m_fake_0__62->SetBinContent(58,0.004587557);
h_dimuon_m_fake_0__62->SetBinContent(59,0.00482506);
h_dimuon_m_fake_0__62->SetBinContent(60,0.004243803);
h_dimuon_m_fake_0__62->SetBinContent(61,0.0040188);
h_dimuon_m_fake_0__62->SetBinContent(62,0.003956299);
h_dimuon_m_fake_0__62->SetBinContent(63,0.003493794);
h_dimuon_m_fake_0__62->SetBinContent(64,0.003531294);
h_dimuon_m_fake_0__62->SetBinContent(65,0.003000038);
h_dimuon_m_fake_0__62->SetBinContent(66,0.002925036);
h_dimuon_m_fake_0__62->SetBinContent(67,0.002537532);
h_dimuon_m_fake_0__62->SetBinContent(68,0.00242503);
h_dimuon_m_fake_0__62->SetBinContent(69,0.001818773);
h_dimuon_m_fake_0__62->SetBinContent(70,0.001931274);
h_dimuon_m_fake_0__62->SetBinContent(71,0.001981275);
h_dimuon_m_fake_0__62->SetBinContent(72,0.001975025);
h_dimuon_m_fake_0__62->SetBinContent(73,0.00157502);
h_dimuon_m_fake_0__62->SetBinContent(74,0.001550019);
h_dimuon_m_fake_0__62->SetBinContent(75,0.001318767);
h_dimuon_m_fake_0__62->SetBinContent(76,0.001312516);
h_dimuon_m_fake_0__62->SetBinContent(77,0.0009875123);
h_dimuon_m_fake_0__62->SetBinContent(78,0.001025013);
h_dimuon_m_fake_0__62->SetBinContent(79,0.0008937612);
h_dimuon_m_fake_0__62->SetBinContent(80,0.0009125114);
h_dimuon_m_fake_0__62->SetBinContent(81,0.0007000088);
h_dimuon_m_fake_0__62->SetBinContent(82,0.0006500082);
h_dimuon_m_fake_0__62->SetBinContent(83,0.000556257);
h_dimuon_m_fake_0__62->SetBinContent(84,0.0006875086);
h_dimuon_m_fake_0__62->SetBinContent(85,0.0004375055);
h_dimuon_m_fake_0__62->SetBinContent(86,0.0003125039);
h_dimuon_m_fake_0__62->SetBinContent(87,0.0003750047);
h_dimuon_m_fake_0__62->SetBinContent(88,0.0003625045);
h_dimuon_m_fake_0__62->SetBinContent(89,0.0002875036);
h_dimuon_m_fake_0__62->SetBinContent(90,0.000318754);
h_dimuon_m_fake_0__62->SetBinContent(91,0.0002312529);
h_dimuon_m_fake_0__62->SetBinContent(92,0.0002000025);
h_dimuon_m_fake_0__62->SetBinContent(93,0.000162502);
h_dimuon_m_fake_0__62->SetBinContent(94,0.0001500019);
h_dimuon_m_fake_0__62->SetBinContent(95,0.0001250016);
h_dimuon_m_fake_0__62->SetBinContent(96,0.0001000012);
h_dimuon_m_fake_0__62->SetBinContent(97,5.000062e-05);
h_dimuon_m_fake_0__62->SetBinContent(98,8.125102e-05);
h_dimuon_m_fake_0__62->SetBinContent(99,5.000062e-05);
h_dimuon_m_fake_0__62->SetBinContent(100,1.875023e-05);
h_dimuon_m_fake_0__62->SetBinContent(101,3.125039e-05);
h_dimuon_m_fake_0__62->SetBinContent(102,3.125039e-05);
h_dimuon_m_fake_0__62->SetBinContent(103,5.000062e-05);
h_dimuon_m_fake_0__62->SetBinContent(104,1.250016e-05);
h_dimuon_m_fake_0__62->SetBinContent(105,6.250078e-06);
h_dimuon_m_fake_0__62->SetBinContent(106,1.875023e-05);
h_dimuon_m_fake_0__62->SetBinContent(109,1.250016e-05);
h_dimuon_m_fake_0__62->SetBinContent(112,6.250078e-06);
h_dimuon_m_fake_0__62->SetBinError(1,0.0001089738);
h_dimuon_m_fake_0__62->SetBinError(2,0.0002187527);
h_dimuon_m_fake_0__62->SetBinError(3,0.0002712131);
h_dimuon_m_fake_0__62->SetBinError(4,0.0003053597);
h_dimuon_m_fake_0__62->SetBinError(5,0.0003281142);
h_dimuon_m_fake_0__62->SetBinError(6,0.0003406149);
h_dimuon_m_fake_0__62->SetBinError(7,0.0003576771);
h_dimuon_m_fake_0__62->SetBinError(8,0.0003679062);
h_dimuon_m_fake_0__62->SetBinError(9,0.0003729679);
h_dimuon_m_fake_0__62->SetBinError(10,0.0003795089);
h_dimuon_m_fake_0__62->SetBinError(11,0.0003858379);
h_dimuon_m_fake_0__62->SetBinError(12,0.0003906174);
h_dimuon_m_fake_0__62->SetBinError(13,0.0003920149);
h_dimuon_m_fake_0__62->SetBinError(14,0.0004009317);
h_dimuon_m_fake_0__62->SetBinError(15,0.0004014185);
h_dimuon_m_fake_0__62->SetBinError(16,0.0003999562);
h_dimuon_m_fake_0__62->SetBinError(17,0.0003996631);
h_dimuon_m_fake_0__62->SetBinError(18,0.0003961287);
h_dimuon_m_fake_0__62->SetBinError(19,0.0003931592);
h_dimuon_m_fake_0__62->SetBinError(20,0.0003911171);
h_dimuon_m_fake_0__62->SetBinError(21,0.0003894155);
h_dimuon_m_fake_0__62->SetBinError(22,0.0003865965);
h_dimuon_m_fake_0__62->SetBinError(23,0.0003777551);
h_dimuon_m_fake_0__62->SetBinError(24,0.0003780652);
h_dimuon_m_fake_0__62->SetBinError(25,0.0003672154);
h_dimuon_m_fake_0__62->SetBinError(26,0.0003719716);
h_dimuon_m_fake_0__62->SetBinError(27,0.0003649746);
h_dimuon_m_fake_0__62->SetBinError(28,0.0003570212);
h_dimuon_m_fake_0__62->SetBinError(29,0.0003537235);
h_dimuon_m_fake_0__62->SetBinError(30,0.0003431856);
h_dimuon_m_fake_0__62->SetBinError(31,0.000342787);
h_dimuon_m_fake_0__62->SetBinError(32,0.0003350065);
h_dimuon_m_fake_0__62->SetBinError(33,0.0003324313);
h_dimuon_m_fake_0__62->SetBinError(34,0.0003247636);
h_dimuon_m_fake_0__62->SetBinError(35,0.000318999);
h_dimuon_m_fake_0__62->SetBinError(36,0.000315056);
h_dimuon_m_fake_0__62->SetBinError(37,0.0003068273);
h_dimuon_m_fake_0__62->SetBinError(38,0.0002955435);
h_dimuon_m_fake_0__62->SetBinError(39,0.0002921535);
h_dimuon_m_fake_0__62->SetBinError(40,0.000293088);
h_dimuon_m_fake_0__62->SetBinError(41,0.0002787423);
h_dimuon_m_fake_0__62->SetBinError(42,0.0002747903);
h_dimuon_m_fake_0__62->SetBinError(43,0.0002626521);
h_dimuon_m_fake_0__62->SetBinError(44,0.0002666374);
h_dimuon_m_fake_0__62->SetBinError(45,0.0002547242);
h_dimuon_m_fake_0__62->SetBinError(46,0.0002548775);
h_dimuon_m_fake_0__62->SetBinError(47,0.0002458276);
h_dimuon_m_fake_0__62->SetBinError(48,0.000239387);
h_dimuon_m_fake_0__62->SetBinError(49,0.0002304915);
h_dimuon_m_fake_0__62->SetBinError(50,0.0002285342);
h_dimuon_m_fake_0__62->SetBinError(51,0.000217858);
h_dimuon_m_fake_0__62->SetBinError(52,0.00021497);
h_dimuon_m_fake_0__62->SetBinError(53,0.0002067255);
h_dimuon_m_fake_0__62->SetBinError(54,0.0002105636);
h_dimuon_m_fake_0__62->SetBinError(55,0.0001930455);
h_dimuon_m_fake_0__62->SetBinError(56,0.0001940546);
h_dimuon_m_fake_0__62->SetBinError(57,0.0001859333);
h_dimuon_m_fake_0__62->SetBinError(58,0.0001693298);
h_dimuon_m_fake_0__62->SetBinError(59,0.0001736577);
h_dimuon_m_fake_0__62->SetBinError(60,0.0001628622);
h_dimuon_m_fake_0__62->SetBinError(61,0.000158486);
h_dimuon_m_fake_0__62->SetBinError(62,0.0001572488);
h_dimuon_m_fake_0__62->SetBinError(63,0.0001477717);
h_dimuon_m_fake_0__62->SetBinError(64,0.0001485627);
h_dimuon_m_fake_0__62->SetBinError(65,0.0001369324);
h_dimuon_m_fake_0__62->SetBinError(66,0.0001352099);
h_dimuon_m_fake_0__62->SetBinError(67,0.0001259356);
h_dimuon_m_fake_0__62->SetBinError(68,0.0001231123);
h_dimuon_m_fake_0__62->SetBinError(69,0.0001066183);
h_dimuon_m_fake_0__62->SetBinError(70,0.0001098663);
h_dimuon_m_fake_0__62->SetBinError(71,0.0001112795);
h_dimuon_m_fake_0__62->SetBinError(72,0.0001111038);
h_dimuon_m_fake_0__62->SetBinError(73,9.921691e-05);
h_dimuon_m_fake_0__62->SetBinError(74,9.842633e-05);
h_dimuon_m_fake_0__62->SetBinError(75,9.078763e-05);
h_dimuon_m_fake_0__62->SetBinError(76,9.057224e-05);
h_dimuon_m_fake_0__62->SetBinError(77,7.856226e-05);
h_dimuon_m_fake_0__62->SetBinError(78,8.004005e-05);
h_dimuon_m_fake_0__62->SetBinError(79,7.474006e-05);
h_dimuon_m_fake_0__62->SetBinError(80,7.551998e-05);
h_dimuon_m_fake_0__62->SetBinError(81,6.614461e-05);
h_dimuon_m_fake_0__62->SetBinError(82,6.373854e-05);
h_dimuon_m_fake_0__62->SetBinError(83,5.896312e-05);
h_dimuon_m_fake_0__62->SetBinError(84,6.555137e-05);
h_dimuon_m_fake_0__62->SetBinError(85,5.229191e-05);
h_dimuon_m_fake_0__62->SetBinError(86,4.419473e-05);
h_dimuon_m_fake_0__62->SetBinError(87,4.84129e-05);
h_dimuon_m_fake_0__62->SetBinError(88,4.759918e-05);
h_dimuon_m_fake_0__62->SetBinError(89,4.239009e-05);
h_dimuon_m_fake_0__62->SetBinError(90,4.463449e-05);
h_dimuon_m_fake_0__62->SetBinError(91,3.801774e-05);
h_dimuon_m_fake_0__62->SetBinError(92,3.535578e-05);
h_dimuon_m_fake_0__62->SetBinError(93,3.186927e-05);
h_dimuon_m_fake_0__62->SetBinError(94,3.0619e-05);
h_dimuon_m_fake_0__62->SetBinError(95,2.79512e-05);
h_dimuon_m_fake_0__62->SetBinError(96,2.500031e-05);
h_dimuon_m_fake_0__62->SetBinError(97,1.767789e-05);
h_dimuon_m_fake_0__62->SetBinError(98,2.253498e-05);
h_dimuon_m_fake_0__62->SetBinError(99,1.767789e-05);
h_dimuon_m_fake_0__62->SetBinError(100,1.082545e-05);
h_dimuon_m_fake_0__62->SetBinError(101,1.39756e-05);
h_dimuon_m_fake_0__62->SetBinError(102,1.39756e-05);
h_dimuon_m_fake_0__62->SetBinError(103,1.767789e-05);
h_dimuon_m_fake_0__62->SetBinError(104,8.838945e-06);
h_dimuon_m_fake_0__62->SetBinError(105,6.250078e-06);
h_dimuon_m_fake_0__62->SetBinError(106,1.082545e-05);
h_dimuon_m_fake_0__62->SetBinError(109,8.838945e-06);
h_dimuon_m_fake_0__62->SetBinError(112,6.250078e-06);
h_dimuon_m_fake_0__62->SetEntries(159998);
h_dimuon_m_fake_0__62->SetDirectory(0);
Int_t ci; // for color index setting
ci = TColor::GetColor("#ff0000");
h_dimuon_m_fake_0__62->SetLineColor(ci);
h_dimuon_m_fake_0__62->SetLineWidth(2);
h_dimuon_m_fake_0__62->SetMarkerStyle(20);
h_dimuon_m_fake_0__62->GetXaxis()->SetLabelFont(42);
h_dimuon_m_fake_0__62->GetXaxis()->SetLabelOffset(0.007);
h_dimuon_m_fake_0__62->GetXaxis()->SetTitleSize(0.06);
h_dimuon_m_fake_0__62->GetXaxis()->SetTitleOffset(0.95);
h_dimuon_m_fake_0__62->GetXaxis()->SetTitleFont(42);
h_dimuon_m_fake_0__62->GetYaxis()->SetLabelFont(42);
h_dimuon_m_fake_0__62->GetYaxis()->SetLabelOffset(0.007);
h_dimuon_m_fake_0__62->GetYaxis()->SetTitleSize(0.06);
h_dimuon_m_fake_0__62->GetYaxis()->SetTitleOffset(1.3);
h_dimuon_m_fake_0__62->GetYaxis()->SetTitleFont(42);
h_dimuon_m_fake_0__62->GetZaxis()->SetLabelFont(42);
h_dimuon_m_fake_0__62->GetZaxis()->SetLabelOffset(0.007);
h_dimuon_m_fake_0__62->GetZaxis()->SetTitleSize(0.06);
h_dimuon_m_fake_0__62->GetZaxis()->SetTitleFont(42);
h_dimuon_m_fake_0__62->Draw("SAMEHIST");
TLegend *leg = new TLegend(0.4566667,0.82,0.7822222,0.9066667,NULL,"brNDC");
leg->SetBorderSize(0);
leg->SetTextSize(0.02777778);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(0);
TLegendEntry *entry=leg->AddEntry("NULL","#splitline{pp #rightarrow h #rightarrow 2n_{1} #rightarrow 2n_{D} + 2 #gamma_{D} #rightarrow 2n_{D} + 4#mu}{#splitline{m_{h} = 125 GeV, m_{n_{1}} = 10 GeV, m_{n_{D}} = 1 GeV}{m_{#gamma_{D}} = 2.000 GeV, c#tau_{#gamma_{D}} = 5. mm}}","h");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
leg->Draw();
leg = new TLegend(0.17,0.935,0.97,1,NULL,"brNDC");
leg->SetBorderSize(0);
leg->SetTextAlign(22);
leg->SetTextSize(0.045);
leg->SetLineColor(1);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(0);
entry=leg->AddEntry("NULL","CMS Simulation (LHE) 8 TeV","h");
entry->SetLineColor(1);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
leg->Draw();
cnv->Modified();
cnv->cd();
cnv->SetSelected(cnv);
}
| [
"bmichlin@rice.edu"
] | bmichlin@rice.edu |
62e5819835b9363e3d45e03de660fbda682b4d31 | 5792b184e71a9de7779e0bd21b6833f8ddfdb4b5 | /SysVr2.0_32000/SysVr2.0_32000/src/lib/libF77/d_log.c | 3cd9cdf1a4d18fdf970108e1ee3ded00ddda793c | [] | no_license | ryanwoodsmall/oldsysv | 1637a3e62bb1b9426a224e832f44a46f1e1a31d4 | e68293af91e2dc39f5f29c20d7e429f9e0cabc75 | refs/heads/master | 2020-03-30T06:06:30.495611 | 2018-09-29T09:04:59 | 2018-09-29T09:04:59 | 150,839,670 | 7 | 0 | null | null | null | null | UTF-8 | C | false | false | 821 | c | /*
********************************************************************************
* Copyright (c) 1985 AT&T *
* All Rights Reserved *
* *
* *
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T *
* The copyright notice above does not evidence any actual *
* or intended publication of such source code. *
********************************************************************************
*/
/* @(#)d_log.c 1.2 */
double d_log(x)
double *x;
{
double log();
return( log(*x) );
}
| [
"rwoodsmall@gmail.com"
] | rwoodsmall@gmail.com |
4d0d1ac3947c91939a21fdfc8e7ac19d63189e13 | a037e1cc32976d4d2cd772d9b866b5c75e9cea9f | /Temp/StagingArea/Data/il2cppOutput/t2082.h | 61a9235ec6d5b280724e1c9f1361d319ecaf073b | [] | no_license | Sojex/BumbleBrigadeWithClickToKill | 4e11642e5e4d23d6456ac9add86570e15e28145f | fb7c30ae13a6e10bc388315bc2dc2b6e3cf1c581 | refs/heads/master | 2021-01-10T15:45:59.727221 | 2016-03-28T17:15:18 | 2016-03-28T17:15:18 | 54,907,861 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 214 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
struct t442;
#include "t8.h"
struct t2082 : public t8
{
t442 * f0;
};
| [
"student@c515-d25hq0s2dhjt-0112012.hostos.cuny.edu"
] | student@c515-d25hq0s2dhjt-0112012.hostos.cuny.edu |
87087f830312550ef3338821f40e83c08b5e5a28 | 83dbe9a60f20ab97034d8166a87a0f43d342e7d8 | /src/host/sgx_hostcalls.c | 79331f9afd5e8b8c310706578497045bc5c72af7 | [
"MIT"
] | permissive | foesi/sgx-lkl | 56d4305befa8f110893c0f22fc588d71c1681969 | c4d0b2638ab8c7bd3844d2344fac62fca34a744b | refs/heads/master | 2020-06-11T21:54:23.550734 | 2019-06-27T12:14:03 | 2019-06-27T12:14:03 | 194,098,767 | 0 | 0 | MIT | 2019-06-27T13:16:45 | 2019-06-27T13:16:44 | null | UTF-8 | C | false | false | 21,897 | c | /*
* Copyright 2016, 2017, 2018 Imperial College London
* Copyright 2016, 2017 TU Dresden (under SCONE source code license)
*/
#define WANT_REAL_ARCH_SYSCALLS
#include "ksigaction.h"
#include "sgx_hostcalls.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <net/if.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
#include <sys/stat.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include "atomic.h"
#include "sgx_hostcall_interface.h"
int host_syscall_SYS_close(int fd) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
sc->syscallno = SYS_close;
sc->arg1 = (uintptr_t)fd;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_fcntl(int fd, intptr_t cmd, intptr_t arg) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len = 0;
void *val= 0;
if (cmd == F_OFD_SETLK) { len = 1*sizeof(struct flock);}
if (cmd == F_SETOWN_EX) { len = 1*sizeof(struct f_owner_ex);}
if (cmd == F_OFD_GETLK) { len = 1*sizeof(struct flock);}
if (cmd == F_GETOWN_EX) { len = 1*sizeof(struct f_owner_ex);}
if (cmd == F_SETLKW) { len = 1*sizeof(struct flock);}
if (cmd == F_OFD_SETLKW) { len = 1*sizeof(struct flock);}
if (cmd == F_GETLK) { len = 1*sizeof(struct flock);}
if (cmd == F_GETOWNER_UIDS) { len = 2*sizeof(uid_t);}
if (cmd == F_SETLK) { len = 1*sizeof(struct flock);}
if (len > 0) sc = arena_ensure(a, len, (syscall_t*) sc);
sc->syscallno = SYS_fcntl;
sc->arg1 = (uintptr_t)fd;
sc->arg2 = (uintptr_t)cmd;
if (len == 0) { sc->arg3 = (uintptr_t)arg; }
else {val = arena_alloc(a, len); if (arg != 0) memcpy(val, (void*)arg, len); sc->arg3 = (uintptr_t)val;}
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
if (len > 0 && arg != 0) {memcpy((void*)arg, val, len);}
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_fstat(int fd, struct stat *buf) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = sizeof(*buf);
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_fstat;
sc->arg1 = (uintptr_t)fd;
struct stat * val2;
val2 = arena_alloc(a, len2);
sc->arg2 = (uintptr_t)val2;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val2 != NULL && buf != NULL) memcpy(buf, val2, len2);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_poll(struct pollfd * fds, nfds_t nfds, int timeout) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1;
len1 = sizeof(*fds) * nfds;
sc = arena_ensure(a, len1, (syscall_t*) sc);
sc->syscallno = SYS_poll;
struct pollfd * val1;
val1 = arena_alloc(a, len1);
if (fds != NULL && val1 != NULL) memcpy(val1, fds, len1);
sc->arg1 = (uintptr_t)val1;
sc->arg2 = (uintptr_t)nfds;
sc->arg3 = (uintptr_t)timeout;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val1 != NULL && fds != NULL) memcpy(fds, val1, len1);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_fdatasync(int fd) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
sc->syscallno = SYS_fdatasync;
sc->arg1 = (uintptr_t)fd;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_ioctl(int fd, unsigned long request, void * arg) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
void* val3 = arg;
size_t len3 = 0;
switch (request) {
case SIOCGIFNAME:
case SIOCGIFINDEX:
case SIOCGIFFLAGS:
case SIOCSIFFLAGS:
case SIOCGIFPFLAGS:
case SIOCSIFPFLAGS:
case SIOCGIFADDR:
case SIOCSIFADDR:
case SIOCGIFDSTADDR:
case SIOCSIFDSTADDR:
case SIOCGIFBRDADDR:
case SIOCSIFBRDADDR:
case SIOCGIFNETMASK:
case SIOCSIFNETMASK:
case SIOCGIFMETRIC:
case SIOCSIFMETRIC:
case SIOCGIFMTU:
case SIOCSIFMTU:
case SIOCGIFHWADDR:
case SIOCSIFHWADDR:
case SIOCSIFHWBROADCAST:
case SIOCGIFMAP:
case SIOCSIFMAP:
case SIOCADDMULTI:
case SIOCDELMULTI:
case SIOCGIFTXQLEN:
case SIOCSIFTXQLEN:
case SIOCSIFNAME:
len3 = sizeof(struct ifreq);
}
sc = getsyscallslot(&a);
if (len3 != 0) {
sc = arena_ensure(a, len3, (syscall_t*) sc);
val3 = arena_alloc(a, len3);
if (val3 != NULL && arg != NULL) memcpy(val3, arg, len3);
}
sc->syscallno = SYS_ioctl;
sc->arg1 = (uintptr_t)fd;
sc->arg2 = (uintptr_t)request;
sc->arg3 = (uintptr_t)val3;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (len3!= 0 && val3 != NULL && arg != NULL) memcpy(arg, val3, len3);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_pipe(int pipefd[2]) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1;
len1 = sizeof(*pipefd) * 2;
sc = arena_ensure(a, len1, (syscall_t*) sc);
sc->syscallno = SYS_pipe;
int * val1;
val1 = arena_alloc(a, len1);
sc->arg1 = (uintptr_t)val1;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val1 != NULL && pipefd != NULL) memcpy(pipefd, val1, len1);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
ssize_t host_syscall_SYS_pread64(int fd, void * buf, size_t count, off_t offset) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = count;
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_pread64;
sc->arg1 = (uintptr_t)fd;
void * val2;
val2 = arena_alloc(a, len2);
sc->arg2 = (uintptr_t)val2;
sc->arg3 = (uintptr_t)count;
sc->arg4 = (uintptr_t)offset;
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
if (val2 != NULL && buf != NULL) memcpy(buf, val2, len2);
arena_free(a);
sc->status = 0;
return (ssize_t)__syscall_return_value;
}
ssize_t host_syscall_SYS_pwrite64(int fd, const void * buf, size_t count, off_t offset) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = count;
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_pwrite64;
sc->arg1 = (uintptr_t)fd;
void * val2;
val2 = arena_alloc(a, len2);
if (buf != NULL && val2 != NULL) memcpy(val2, buf, len2);
sc->arg2 = (uintptr_t)val2;
sc->arg3 = (uintptr_t)count;
sc->arg4 = (uintptr_t)offset;
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
arena_free(a);
sc->status = 0;
return (ssize_t)__syscall_return_value;
}
ssize_t host_syscall_SYS_read(int fd, void * buf, size_t count) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = count;
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_read;
sc->arg1 = (uintptr_t)fd;
void * val2;
val2 = arena_alloc(a, len2);
sc->arg2 = (uintptr_t)val2;
sc->arg3 = (uintptr_t)count;
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
if (val2 != NULL && buf != NULL) memcpy(buf, val2, len2);
arena_free(a);
sc->status = 0;
return (ssize_t)__syscall_return_value;
}
ssize_t host_syscall_SYS_readv(int fd, struct iovec * iov, int iovcnt) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = 0;
for(size_t i = 0; i < iovcnt; i++) {len2 += deepsizeiovec(&iov[i]);}
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_readv;
sc->arg1 = (uintptr_t)fd;
struct iovec * val2;
val2 = arena_alloc(a, sizeof(*iov) * iovcnt);
for(size_t i = 0; i < iovcnt; i++) {deepinitiovec(a, &val2[i], &iov[i]);}
sc->arg2 = (uintptr_t)val2;
sc->arg3 = (uintptr_t)iovcnt;
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
for(size_t i = 0; i < iovcnt; i++) {deepcopyiovec(&iov[i], &val2[i]);}
arena_free(a);
sc->status = 0;
return (ssize_t)__syscall_return_value;
}
ssize_t host_syscall_SYS_write(int fd, const void * buf, size_t count) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = count;
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_write;
sc->arg1 = (uintptr_t)fd;
void * val2;
val2 = arena_alloc(a, len2);
if (buf != NULL && val2 != NULL) memcpy(val2, buf, len2);
sc->arg2 = (uintptr_t)val2;
sc->arg3 = (uintptr_t)count;
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
arena_free(a);
sc->status = 0;
return (ssize_t)__syscall_return_value;
}
ssize_t host_syscall_SYS_writev(int fd, const struct iovec * iov, int iovcnt) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = 0;
for(size_t i = 0; i < iovcnt; i++) {len2 += deepsizeiovec(&iov[i]);}
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_writev;
sc->arg1 = (uintptr_t)fd;
struct iovec * val2;
val2 = arena_alloc(a, sizeof(*iov) * iovcnt);
for(size_t i = 0; i < iovcnt; i++) {deepinitiovec(a, &val2[i], &iov[i]);}
for(size_t i = 0; i < iovcnt; i++) {deepcopyiovec(&val2[i], &iov[i]);}
sc->arg2 = (uintptr_t)val2;
sc->arg3 = (uintptr_t)iovcnt;
threadswitch((syscall_t*) sc);
__syscall_return_value = (ssize_t)sc->ret_val;
arena_free(a);
sc->status = 0;
return (ssize_t)__syscall_return_value;
}
int host_syscall_SYS_mprotect(void * addr, size_t len, int prot) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
if(!(sc && a))
return 0;
sc->syscallno = SYS_mprotect;
sc->arg1 = (uintptr_t)addr;
sc->arg2 = (uintptr_t)len;
sc->arg3 = (uintptr_t)prot;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_rt_sigaction(int signum, struct sigaction * act, struct sigaction * oldact, unsigned long nsig) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = sizeof(k_sigaction_t);
size_t len3;
len3 = sizeof(k_sigaction_t);
sc = arena_ensure(a, len2 + len3, (syscall_t*) sc);
sc->syscallno = SYS_rt_sigaction;
sc->arg1 = (uintptr_t)signum;
struct sigaction * val2;
val2 = arena_alloc(a, len2);
if (act != NULL && val2 != NULL)
{
memcpy(val2, act, len2);
sc->arg2 = (uintptr_t)val2;
} else {
sc->arg2 = (uintptr_t)NULL;
}
struct sigaction * val3;
val3 = arena_alloc(a, len3);
sc->arg3 = (uintptr_t)val3;
sc->arg4 = (uintptr_t)nsig;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val3 != NULL && oldact != NULL) memcpy(oldact, val3, len3);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_rt_sigpending(sigset_t * set, unsigned long nsig) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1;
len1 = sizeof(*set);
sc = arena_ensure(a, len1, (syscall_t*) sc);
sc->syscallno = SYS_rt_sigpending;
sigset_t * val1;
val1 = arena_alloc(a, len1);
sc->arg1 = (uintptr_t)val1;
sc->arg2 = (uintptr_t)nsig;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val1 != NULL && set != NULL) memcpy(set, val1, len1);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_rt_sigprocmask(int how, void * set, sigset_t * oldset, unsigned long nsig) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = sizeof(sigset_t);
size_t len3;
len3 = sizeof(sigset_t);
sc = arena_ensure(a, len2 + len3, (syscall_t*) sc);
sc->syscallno = SYS_rt_sigprocmask;
sc->arg1 = (uintptr_t)how;
void * val2;
val2 = arena_alloc(a, len2);
if (set != NULL && val2 != NULL) memcpy(val2, set, len2);
sc->arg2 = (uintptr_t)val2;
sigset_t * val3;
val3 = arena_alloc(a, len3);
sc->arg3 = (uintptr_t)val3;
sc->arg4 = (uintptr_t)nsig;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val3 != NULL && oldset != NULL) memcpy(oldset, val3, len3);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_rt_sigsuspend(const sigset_t * mask, unsigned long nsig) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1;
len1 = sizeof(*mask);
sc = arena_ensure(a, len1, (syscall_t*) sc);
sc->syscallno = SYS_rt_sigsuspend;
sigset_t * val1;
val1 = arena_alloc(a, len1);
if (mask != NULL && val1 != NULL) memcpy(val1, mask, len1);
sc->arg1 = (uintptr_t)val1;
sc->arg2 = (uintptr_t)nsig;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_rt_sigtimedwait(const sigset_t * set, siginfo_t * info, const struct timespec * timeout, unsigned long nsig) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1;
len1 = sizeof(*set);
size_t len2;
if (info != NULL ) {
len2 = sizeof(*info);
} else {len2 = 0;}
size_t len3;
if (timeout != NULL ) {
len3 = sizeof(*timeout);
} else {len3 = 0;}
sc = arena_ensure(a, len1 + len2 + len3, (syscall_t*) sc);
sc->syscallno = SYS_rt_sigtimedwait;
sigset_t * val1;
val1 = arena_alloc(a, len1);
if (set != NULL && val1 != NULL) memcpy(val1, set, len1);
sc->arg1 = (uintptr_t)val1;
siginfo_t * val2;
if (info != NULL) {
val2 = arena_alloc(a, len2);
} else { val2 = NULL; }
sc->arg2 = (uintptr_t)val2;
struct timespec * val3;
if (timeout != NULL) {
val3 = arena_alloc(a, len3);
if (timeout != NULL && val3 != NULL) memcpy(val3, timeout, len3);
} else { val3 = NULL; }
sc->arg3 = (uintptr_t)val3;
sc->arg4 = (uintptr_t)nsig;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (info != NULL) {
if (val2 != NULL && info != NULL) memcpy(info, val2, len2);
}
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_tkill(int tid, int sig) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
sc->syscallno = SYS_tkill;
sc->arg1 = (uintptr_t)tid;
sc->arg2 = (uintptr_t)sig;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_nanosleep(const struct timespec * req, struct timespec * rem) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1;
len1 = sizeof(*req);
size_t len2;
len2 = sizeof(*rem);
sc = arena_ensure(a, len1 + len2, (syscall_t*) sc);
sc->syscallno = SYS_nanosleep;
struct timespec * val1;
val1 = arena_alloc(a, len1);
if (req != NULL && val1 != NULL) memcpy(val1, req, len1);
sc->arg1 = (uintptr_t)val1;
struct timespec * val2;
val2 = arena_alloc(a, len2);
sc->arg2 = (uintptr_t)val2;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val2 != NULL && rem != NULL) memcpy(rem, val2, len2);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_clock_getres(clockid_t clk_id, struct timespec * res) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = sizeof(*res);
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_clock_getres;
sc->arg1 = (uintptr_t)clk_id;
struct timespec * val2;
val2 = arena_alloc(a, len2);
sc->arg2 = (uintptr_t)val2;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val2 != NULL && res != NULL) memcpy(res, val2, len2);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_clock_gettime(clockid_t clk_id, struct timespec * tp) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len2;
len2 = sizeof(*tp);
sc = arena_ensure(a, len2, (syscall_t*) sc);
sc->syscallno = SYS_clock_gettime;
sc->arg1 = (uintptr_t)clk_id;
struct timespec * val2;
val2 = arena_alloc(a, len2);
sc->arg2 = (uintptr_t)val2;
threadswitch((syscall_t*) sc);
__syscall_return_value = (int)sc->ret_val;
if (val2 != NULL && tp != NULL) memcpy(tp, val2, len2);
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_gettid() {
volatile syscall_t *sc;
volatile uintptr_t __syscall_return_value;
sc = getsyscallslot(NULL);
sc->syscallno = SYS_gettid;
threadswitch((syscall_t*)sc);
__syscall_return_value = sc->ret_val;
sc->status = 0;
return (int)__syscall_return_value;
}
void *host_syscall_SYS_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) {
volatile syscall_t *sc;
volatile uintptr_t __syscall_return_value;
sc = getsyscallslot(NULL);
sc->syscallno = SYS_mmap;
sc->arg1 = (uintptr_t)addr;
sc->arg2 = (uintptr_t)length;
sc->arg3 = (uintptr_t)prot;
sc->arg4 = (uintptr_t)flags;
sc->arg5 = (uintptr_t)fd;
sc->arg6 = (uintptr_t)offset;
threadswitch((syscall_t*)sc);
__syscall_return_value = sc->ret_val;
sc->status = 0;
return (void *)__syscall_return_value;
}
void *host_syscall_SYS_mremap(void *old_addr, size_t old_size, size_t new_size, int flags, void *new_addr) {
volatile syscall_t *sc;
volatile uintptr_t __syscall_return_value;
sc = getsyscallslot(NULL);
sc->syscallno = SYS_mremap;
sc->arg1 = (uintptr_t)old_addr;
sc->arg2 = (uintptr_t)old_size;
sc->arg3 = (uintptr_t)new_size;
sc->arg4 = (uintptr_t)flags;
sc->arg5 = (uintptr_t)new_addr;
threadswitch((syscall_t*)sc);
__syscall_return_value = sc->ret_val;
sc->status = 0;
return (void *)__syscall_return_value;
}
int host_syscall_SYS_munmap(void *addr, size_t length) {
volatile syscall_t *sc;
volatile uintptr_t __syscall_return_value;
sc = getsyscallslot(NULL);
sc->syscallno = SYS_munmap;
sc->arg1 = (uintptr_t)addr;
sc->arg2 = (uintptr_t)length;
threadswitch((syscall_t*)sc);
__syscall_return_value = sc->ret_val;
sc->status = 0;
return (int)__syscall_return_value;
}
int host_syscall_SYS_msync(void *addr, size_t length, int flags) {
volatile syscall_t *sc;
volatile uintptr_t __syscall_return_value;
sc = getsyscallslot(NULL);
sc->syscallno = SYS_msync;
sc->arg1 = (uintptr_t)addr;
sc->arg2 = (uintptr_t)length;
sc->arg3 = (uintptr_t)flags;
threadswitch((syscall_t*)sc);
__syscall_return_value = sc->ret_val;
sc->status = 0;
return (int)__syscall_return_value;
}
/* Some host system calls are only needed for debug purposed. Don't include
* them in a non-debug build. */
#if DEBUG
int host_syscall_SYS_open(const char *pathname, int flags, mode_t mode) {
volatile syscall_t *sc;
volatile intptr_t __syscall_return_value;
Arena *a = NULL;
sc = getsyscallslot(&a);
size_t len1 = 0;
if (pathname != 0) len1 = strlen(pathname) + 1;
sc = arena_ensure(a, len1, (syscall_t*) sc);
sc->syscallno = SYS_open;
char * val1;
val1 = arena_alloc(a, len1);
if (pathname != NULL && val1 != NULL) memcpy(val1, pathname, len1);
sc->arg1 = (uintptr_t)val1;
sc->arg2 = (uintptr_t)flags;
sc->arg3 = (uintptr_t)mode;
threadswitch((syscall_t*) sc);
__syscall_return_value = sc->ret_val;
arena_free(a);
sc->status = 0;
return (int)__syscall_return_value;
}
#endif /* DEBUG */
| [
"cp3213@ic.ac.uk"
] | cp3213@ic.ac.uk |
c96aa1379f646b5e8a901def3687cab81c8fbdef | 8baae52066c1e716ab6be31894b4f5a4122e0ce6 | /apps/flash/CurentData.c | 4524f273178b363a2605b37c2b38511708983f62 | [] | no_license | nguyendao3154/iro3 | c35902ccb53575527beb9cca77b30cb024a54d6b | 908c7d762e77b2214377a1ffc5a3453e333b18d1 | refs/heads/master | 2023-06-29T16:51:25.030563 | 2020-10-07T10:16:36 | 2020-10-07T10:16:36 | 390,341,150 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,454 | c | /******************************************************************************
*
* Embedded software team.
* (c) Copyright 2018.
* ALL RIGHTS RESERVED.
*
***************************************************************************//*!
*
* @file CurentData.c
*
* @author quanvu
*
* @version 1.0
*
* @date
*
* @brief
*
*******************************************************************************
*
* Detailed Description of the file. If not used, remove the separator above.
*
******************************************************************************/
#include "CurentData.h"
#include "flash_app.h"
#include <string.h>
/******************************************************************************
* External objects
******************************************************************************/
/******************************************************************************
* Global variables
******************************************************************************/
/******************************************************************************
* Constants and macros
******************************************************************************/
static const SavedData DATA_DEFAULD = {
.tdsOutMin = 0,
};
/******************************************************************************
* Local types
******************************************************************************/
/******************************************************************************
* Local function prototypes
******************************************************************************/
/******************************************************************************
* Local variables
******************************************************************************/
SavedData curentData;
/******************************************************************************
* Local functions
******************************************************************************/
/**
* @brief One line documentation
*
* A more detailed documentation
*
* @param arg1 the first function argument
* @param arg2 the second function argument
*
* @return descrition for the function return value
*/
void curentData_updateToFlash()
{
flash_app_writeBlock((uint8_t *)&curentData, CURENT_DATA_BLOCK, sizeof(curentData));
}
/******************************************************************************
* Global functions
******************************************************************************/
/**
* @brief One line documentation
*
* A more detailed documentation
*
* @param arg1 the first function argument
* @param arg2 the second function argument
*
* @return descrition for the function return value
*/
void curentData_init()
{
bool readOk = flash_app_readData((uint8_t*)&curentData,CURENT_DATA_BLOCK,sizeof(curentData));
if(!readOk)
{
memcpy(&curentData,&DATA_DEFAULD,sizeof(DATA_DEFAULD));
curentData_updateToFlash();
}
}
// call when update tds display
void curentData_updateTdsMin(uint16_t tdsOut)
{
static bool getNewValue = false;
if(tdsOut == 0) return;
if((curentData.tdsOutMin == 0) || (!getNewValue))
{
curentData.tdsOutMin = tdsOut;
curentData_updateToFlash();
getNewValue = true;
}
}
void curentData_resetData()
{
memcpy(&curentData,&DATA_DEFAULD,sizeof(DATA_DEFAULD));
curentData_updateToFlash();
}
uint16_t curentData_getLastTdsOut()
{
return curentData.tdsOutMin;
}
| [
"daonguyen3154@gmail.com"
] | daonguyen3154@gmail.com |
5261c4db9d33011763567110d623a5820c3c8c23 | 47c336336b176b4bd961f5170bdccbca23a7e7ea | /build-riscv/libsel4/include/sel4/shared_types_gen.h | cae420bcae3bca615ca202603dd050bb4ee77bcf | [] | no_license | SanNare/seL4Shakti | bec58d78c0e268b3ff89efd6e4a096d53e5b1504 | 6c06338d8859b42b41469c43b994746f00caf293 | refs/heads/master | 2020-04-21T02:48:02.255904 | 2019-02-05T15:45:10 | 2019-02-05T15:45:10 | 169,265,513 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 19,587 | h | #ifndef _HOME_SANDIP_DESKTOP_TEST_SEL_BUILD_RISCV_LIBSEL4_INCLUDE_SEL4_SHARED_TYPES_GEN_H
#define _HOME_SANDIP_DESKTOP_TEST_SEL_BUILD_RISCV_LIBSEL4_INCLUDE_SEL4_SHARED_TYPES_GEN_H
#include <autoconf.h>
#include <sel4/simple_types.h>
#include <sel4/debug_assert.h>
struct seL4_MessageInfo {
seL4_Uint64 words[1];
};
typedef struct seL4_MessageInfo seL4_MessageInfo_t;
LIBSEL4_INLINE_FUNC seL4_MessageInfo_t CONST
seL4_MessageInfo_new(seL4_Uint64 label, seL4_Uint64 capsUnwrapped, seL4_Uint64 extraCaps, seL4_Uint64 length) {
seL4_MessageInfo_t seL4_MessageInfo;
/* fail if user has passed bits that we will override */
seL4_DebugAssert((label & ~0xfffffffffffffull) == ((0 && (label & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capsUnwrapped & ~0x7ull) == ((0 && (capsUnwrapped & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((extraCaps & ~0x3ull) == ((0 && (extraCaps & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((length & ~0x7full) == ((0 && (length & (1ull << 63))) ? 0x0 : 0));
seL4_MessageInfo.words[0] = 0
| (label & 0xfffffffffffffull) << 12
| (capsUnwrapped & 0x7ull) << 9
| (extraCaps & 0x3ull) << 7
| (length & 0x7full) << 0;
return seL4_MessageInfo;
}
LIBSEL4_INLINE_FUNC void
seL4_MessageInfo_ptr_new(seL4_MessageInfo_t *seL4_MessageInfo_ptr, seL4_Uint64 label, seL4_Uint64 capsUnwrapped, seL4_Uint64 extraCaps, seL4_Uint64 length) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((label & ~0xfffffffffffffull) == ((0 && (label & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capsUnwrapped & ~0x7ull) == ((0 && (capsUnwrapped & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((extraCaps & ~0x3ull) == ((0 && (extraCaps & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((length & ~0x7full) == ((0 && (length & (1ull << 63))) ? 0x0 : 0));
seL4_MessageInfo_ptr->words[0] = 0
| (label & 0xfffffffffffffull) << 12
| (capsUnwrapped & 0x7ull) << 9
| (extraCaps & 0x3ull) << 7
| (length & 0x7full) << 0;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_MessageInfo_get_label(seL4_MessageInfo_t seL4_MessageInfo) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo.words[0] & 0xfffffffffffff000ull) >> 12;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_MessageInfo_t CONST
seL4_MessageInfo_set_label(seL4_MessageInfo_t seL4_MessageInfo, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0xfffffffffffff000 >> 12 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo.words[0] &= ~0xfffffffffffff000ull;
seL4_MessageInfo.words[0] |= (v64 << 12) & 0xfffffffffffff000ull;
return seL4_MessageInfo;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_MessageInfo_ptr_get_label(seL4_MessageInfo_t *seL4_MessageInfo_ptr) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo_ptr->words[0] & 0xfffffffffffff000ull) >> 12;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_MessageInfo_ptr_set_label(seL4_MessageInfo_t *seL4_MessageInfo_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0xfffffffffffff000 >> 12) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo_ptr->words[0] &= ~0xfffffffffffff000ull;
seL4_MessageInfo_ptr->words[0] |= (v64 << 12) & 0xfffffffffffff000;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_MessageInfo_get_capsUnwrapped(seL4_MessageInfo_t seL4_MessageInfo) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo.words[0] & 0xe00ull) >> 9;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_MessageInfo_t CONST
seL4_MessageInfo_set_capsUnwrapped(seL4_MessageInfo_t seL4_MessageInfo, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0xe00 >> 9 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo.words[0] &= ~0xe00ull;
seL4_MessageInfo.words[0] |= (v64 << 9) & 0xe00ull;
return seL4_MessageInfo;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_MessageInfo_ptr_get_capsUnwrapped(seL4_MessageInfo_t *seL4_MessageInfo_ptr) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo_ptr->words[0] & 0xe00ull) >> 9;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_MessageInfo_ptr_set_capsUnwrapped(seL4_MessageInfo_t *seL4_MessageInfo_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0xe00 >> 9) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo_ptr->words[0] &= ~0xe00ull;
seL4_MessageInfo_ptr->words[0] |= (v64 << 9) & 0xe00;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_MessageInfo_get_extraCaps(seL4_MessageInfo_t seL4_MessageInfo) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo.words[0] & 0x180ull) >> 7;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_MessageInfo_t CONST
seL4_MessageInfo_set_extraCaps(seL4_MessageInfo_t seL4_MessageInfo, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x180 >> 7 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo.words[0] &= ~0x180ull;
seL4_MessageInfo.words[0] |= (v64 << 7) & 0x180ull;
return seL4_MessageInfo;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_MessageInfo_ptr_get_extraCaps(seL4_MessageInfo_t *seL4_MessageInfo_ptr) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo_ptr->words[0] & 0x180ull) >> 7;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_MessageInfo_ptr_set_extraCaps(seL4_MessageInfo_t *seL4_MessageInfo_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x180 >> 7) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo_ptr->words[0] &= ~0x180ull;
seL4_MessageInfo_ptr->words[0] |= (v64 << 7) & 0x180;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_MessageInfo_get_length(seL4_MessageInfo_t seL4_MessageInfo) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo.words[0] & 0x7full) >> 0;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_MessageInfo_t CONST
seL4_MessageInfo_set_length(seL4_MessageInfo_t seL4_MessageInfo, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x7f >> 0 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo.words[0] &= ~0x7full;
seL4_MessageInfo.words[0] |= (v64 << 0) & 0x7full;
return seL4_MessageInfo;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_MessageInfo_ptr_get_length(seL4_MessageInfo_t *seL4_MessageInfo_ptr) {
seL4_Uint64 ret;
ret = (seL4_MessageInfo_ptr->words[0] & 0x7full) >> 0;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_MessageInfo_ptr_set_length(seL4_MessageInfo_t *seL4_MessageInfo_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x7f >> 0) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_MessageInfo_ptr->words[0] &= ~0x7full;
seL4_MessageInfo_ptr->words[0] |= (v64 << 0) & 0x7f;
}
struct seL4_CNode_CapData {
seL4_Uint64 words[1];
};
typedef struct seL4_CNode_CapData seL4_CNode_CapData_t;
LIBSEL4_INLINE_FUNC seL4_CNode_CapData_t CONST
seL4_CNode_CapData_new(seL4_Uint64 guard, seL4_Uint64 guardSize) {
seL4_CNode_CapData_t seL4_CNode_CapData;
/* fail if user has passed bits that we will override */
seL4_DebugAssert((guard & ~0x3ffffffffffffffull) == ((0 && (guard & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((guardSize & ~0x3full) == ((0 && (guardSize & (1ull << 63))) ? 0x0 : 0));
seL4_CNode_CapData.words[0] = 0
| (guard & 0x3ffffffffffffffull) << 6
| (guardSize & 0x3full) << 0;
return seL4_CNode_CapData;
}
LIBSEL4_INLINE_FUNC void
seL4_CNode_CapData_ptr_new(seL4_CNode_CapData_t *seL4_CNode_CapData_ptr, seL4_Uint64 guard, seL4_Uint64 guardSize) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((guard & ~0x3ffffffffffffffull) == ((0 && (guard & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((guardSize & ~0x3full) == ((0 && (guardSize & (1ull << 63))) ? 0x0 : 0));
seL4_CNode_CapData_ptr->words[0] = 0
| (guard & 0x3ffffffffffffffull) << 6
| (guardSize & 0x3full) << 0;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_CNode_CapData_get_guard(seL4_CNode_CapData_t seL4_CNode_CapData) {
seL4_Uint64 ret;
ret = (seL4_CNode_CapData.words[0] & 0xffffffffffffffc0ull) >> 6;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_CNode_CapData_t CONST
seL4_CNode_CapData_set_guard(seL4_CNode_CapData_t seL4_CNode_CapData, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0xffffffffffffffc0 >> 6 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CNode_CapData.words[0] &= ~0xffffffffffffffc0ull;
seL4_CNode_CapData.words[0] |= (v64 << 6) & 0xffffffffffffffc0ull;
return seL4_CNode_CapData;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_CNode_CapData_ptr_get_guard(seL4_CNode_CapData_t *seL4_CNode_CapData_ptr) {
seL4_Uint64 ret;
ret = (seL4_CNode_CapData_ptr->words[0] & 0xffffffffffffffc0ull) >> 6;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_CNode_CapData_ptr_set_guard(seL4_CNode_CapData_t *seL4_CNode_CapData_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0xffffffffffffffc0 >> 6) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CNode_CapData_ptr->words[0] &= ~0xffffffffffffffc0ull;
seL4_CNode_CapData_ptr->words[0] |= (v64 << 6) & 0xffffffffffffffc0;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_CNode_CapData_get_guardSize(seL4_CNode_CapData_t seL4_CNode_CapData) {
seL4_Uint64 ret;
ret = (seL4_CNode_CapData.words[0] & 0x3full) >> 0;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_CNode_CapData_t CONST
seL4_CNode_CapData_set_guardSize(seL4_CNode_CapData_t seL4_CNode_CapData, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x3f >> 0 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CNode_CapData.words[0] &= ~0x3full;
seL4_CNode_CapData.words[0] |= (v64 << 0) & 0x3full;
return seL4_CNode_CapData;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_CNode_CapData_ptr_get_guardSize(seL4_CNode_CapData_t *seL4_CNode_CapData_ptr) {
seL4_Uint64 ret;
ret = (seL4_CNode_CapData_ptr->words[0] & 0x3full) >> 0;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_CNode_CapData_ptr_set_guardSize(seL4_CNode_CapData_t *seL4_CNode_CapData_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x3f >> 0) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CNode_CapData_ptr->words[0] &= ~0x3full;
seL4_CNode_CapData_ptr->words[0] |= (v64 << 0) & 0x3f;
}
struct seL4_CapRights {
seL4_Uint64 words[1];
};
typedef struct seL4_CapRights seL4_CapRights_t;
LIBSEL4_INLINE_FUNC seL4_CapRights_t CONST
seL4_CapRights_new(seL4_Uint64 capAllowGrantReply, seL4_Uint64 capAllowGrant, seL4_Uint64 capAllowRead, seL4_Uint64 capAllowWrite) {
seL4_CapRights_t seL4_CapRights;
/* fail if user has passed bits that we will override */
seL4_DebugAssert((capAllowGrantReply & ~0x1ull) == ((0 && (capAllowGrantReply & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capAllowGrant & ~0x1ull) == ((0 && (capAllowGrant & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capAllowRead & ~0x1ull) == ((0 && (capAllowRead & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capAllowWrite & ~0x1ull) == ((0 && (capAllowWrite & (1ull << 63))) ? 0x0 : 0));
seL4_CapRights.words[0] = 0
| (capAllowGrantReply & 0x1ull) << 3
| (capAllowGrant & 0x1ull) << 2
| (capAllowRead & 0x1ull) << 1
| (capAllowWrite & 0x1ull) << 0;
return seL4_CapRights;
}
LIBSEL4_INLINE_FUNC void
seL4_CapRights_ptr_new(seL4_CapRights_t *seL4_CapRights_ptr, seL4_Uint64 capAllowGrantReply, seL4_Uint64 capAllowGrant, seL4_Uint64 capAllowRead, seL4_Uint64 capAllowWrite) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((capAllowGrantReply & ~0x1ull) == ((0 && (capAllowGrantReply & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capAllowGrant & ~0x1ull) == ((0 && (capAllowGrant & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capAllowRead & ~0x1ull) == ((0 && (capAllowRead & (1ull << 63))) ? 0x0 : 0));
seL4_DebugAssert((capAllowWrite & ~0x1ull) == ((0 && (capAllowWrite & (1ull << 63))) ? 0x0 : 0));
seL4_CapRights_ptr->words[0] = 0
| (capAllowGrantReply & 0x1ull) << 3
| (capAllowGrant & 0x1ull) << 2
| (capAllowRead & 0x1ull) << 1
| (capAllowWrite & 0x1ull) << 0;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_CapRights_get_capAllowGrantReply(seL4_CapRights_t seL4_CapRights) {
seL4_Uint64 ret;
ret = (seL4_CapRights.words[0] & 0x8ull) >> 3;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_CapRights_t CONST
seL4_CapRights_set_capAllowGrantReply(seL4_CapRights_t seL4_CapRights, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x8 >> 3 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights.words[0] &= ~0x8ull;
seL4_CapRights.words[0] |= (v64 << 3) & 0x8ull;
return seL4_CapRights;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_CapRights_ptr_get_capAllowGrantReply(seL4_CapRights_t *seL4_CapRights_ptr) {
seL4_Uint64 ret;
ret = (seL4_CapRights_ptr->words[0] & 0x8ull) >> 3;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_CapRights_ptr_set_capAllowGrantReply(seL4_CapRights_t *seL4_CapRights_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x8 >> 3) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights_ptr->words[0] &= ~0x8ull;
seL4_CapRights_ptr->words[0] |= (v64 << 3) & 0x8;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_CapRights_get_capAllowGrant(seL4_CapRights_t seL4_CapRights) {
seL4_Uint64 ret;
ret = (seL4_CapRights.words[0] & 0x4ull) >> 2;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_CapRights_t CONST
seL4_CapRights_set_capAllowGrant(seL4_CapRights_t seL4_CapRights, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x4 >> 2 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights.words[0] &= ~0x4ull;
seL4_CapRights.words[0] |= (v64 << 2) & 0x4ull;
return seL4_CapRights;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_CapRights_ptr_get_capAllowGrant(seL4_CapRights_t *seL4_CapRights_ptr) {
seL4_Uint64 ret;
ret = (seL4_CapRights_ptr->words[0] & 0x4ull) >> 2;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_CapRights_ptr_set_capAllowGrant(seL4_CapRights_t *seL4_CapRights_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x4 >> 2) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights_ptr->words[0] &= ~0x4ull;
seL4_CapRights_ptr->words[0] |= (v64 << 2) & 0x4;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_CapRights_get_capAllowRead(seL4_CapRights_t seL4_CapRights) {
seL4_Uint64 ret;
ret = (seL4_CapRights.words[0] & 0x2ull) >> 1;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_CapRights_t CONST
seL4_CapRights_set_capAllowRead(seL4_CapRights_t seL4_CapRights, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x2 >> 1 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights.words[0] &= ~0x2ull;
seL4_CapRights.words[0] |= (v64 << 1) & 0x2ull;
return seL4_CapRights;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_CapRights_ptr_get_capAllowRead(seL4_CapRights_t *seL4_CapRights_ptr) {
seL4_Uint64 ret;
ret = (seL4_CapRights_ptr->words[0] & 0x2ull) >> 1;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_CapRights_ptr_set_capAllowRead(seL4_CapRights_t *seL4_CapRights_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x2 >> 1) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights_ptr->words[0] &= ~0x2ull;
seL4_CapRights_ptr->words[0] |= (v64 << 1) & 0x2;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 CONST
seL4_CapRights_get_capAllowWrite(seL4_CapRights_t seL4_CapRights) {
seL4_Uint64 ret;
ret = (seL4_CapRights.words[0] & 0x1ull) >> 0;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC seL4_CapRights_t CONST
seL4_CapRights_set_capAllowWrite(seL4_CapRights_t seL4_CapRights, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x1 >> 0 ) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights.words[0] &= ~0x1ull;
seL4_CapRights.words[0] |= (v64 << 0) & 0x1ull;
return seL4_CapRights;
}
LIBSEL4_INLINE_FUNC seL4_Uint64 PURE
seL4_CapRights_ptr_get_capAllowWrite(seL4_CapRights_t *seL4_CapRights_ptr) {
seL4_Uint64 ret;
ret = (seL4_CapRights_ptr->words[0] & 0x1ull) >> 0;
/* Possibly sign extend */
if (0 && (ret & (1ull << (63)))) {
ret |= 0x0;
}
return ret;
}
LIBSEL4_INLINE_FUNC void
seL4_CapRights_ptr_set_capAllowWrite(seL4_CapRights_t *seL4_CapRights_ptr, seL4_Uint64 v64) {
/* fail if user has passed bits that we will override */
seL4_DebugAssert((((~0x1 >> 0) | 0x0) & v64) == ((0 && (v64 & (1ull << (63)))) ? 0x0 : 0));
seL4_CapRights_ptr->words[0] &= ~0x1ull;
seL4_CapRights_ptr->words[0] |= (v64 << 0) & 0x1;
}
#endif
| [
"sandipnr98@yahoo.com"
] | sandipnr98@yahoo.com |
60a33d8227af14b859835a0b0546df2e8a3287c4 | d321f4a07566c87ed3aa0d8ade58e8ea6b2399e5 | /9-binary_tree_height.c | a0008af1ef250581b8b839b64a9f670eea56adf2 | [] | no_license | JHS1790/binary_trees | 2650d12225e2e835f8046c1ee7e6b555b4856b3e | 89a1de18cc4c88a2d99daa957bedd2c71c57334b | refs/heads/main | 2023-01-15T05:36:46.931683 | 2020-11-24T17:37:32 | 2020-11-24T17:37:32 | 314,295,097 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 866 | c | #include "binary_trees.h"
/**
* binary_tree_height - measures the height of a binary tree
* @tree: a pointer to the root node of the tree to measure the height
* Return: height but we're doing that weird 0 thing
*/
size_t binary_tree_height(const binary_tree_t *tree)
{
if (tree == NULL)
return (0);
return (recursiveSearch(tree) - 1);
}
/**
* recursiveSearch - recursive function to find height
* @tree: current working node
* Return: actual height
*/
size_t recursiveSearch(const binary_tree_t *tree)
{
if (tree == NULL)
return (0);
return (
findMax(
recursiveSearch(tree->left),
recursiveSearch(tree->right)
) + 1
);
}
/**
* findMax - find the bigger of two numbers
* @a: first number
* @b: second number
* Return: the larger of the two
*/
size_t findMax(size_t a, size_t b)
{
if (a >= b)
return (a);
else
return (b);
}
| [
"1790@holbertonschool.com"
] | 1790@holbertonschool.com |
0062144dd823b870c12b8c97676c19a3b77f32a0 | ac69dcb06099d53fded92459001f6f572d9daf4d | /mutants/gnuplot-5.2.2/src/tables_c/tables_RIND_3.c | 42000c068f04f4f222689802fa02fe0b9c2ba88d | [] | no_license | lzmths/tcc | 215b70454dc2f048d19da01b756936fa5bd71fda | 7919bad06ae82fb8908b4b9318bb6cc402d27a79 | refs/heads/master | 2021-09-04T07:38:45.237849 | 2018-01-17T03:36:53 | 2018-01-17T03:36:53 | 117,493,375 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 27,814 | c | #ifndef lint
static char *RCSid() { return RCSid("$Id: tables.c,v 1.155.2.1 2017/10/10 03:55:45 sfeam Exp $"); }
#endif
/* GNUPLOT - tables.c */
/*[
* Copyright 1999, 2004 Lars Hecking
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
*
* Permission to modify the software is granted, but not the right to
* distribute the complete modified source code. Modifications are to
* be distributed as patches to the released version. Permission to
* distribute binaries produced by compiling modified sources is granted,
* provided you
* 1. distribute the corresponding source modifications from the
* released version in the form of a patch file along with the binaries,
* 2. add special version identification to distinguish your version
* in addition to the base release version number,
* 3. provide your name and address as the primary contact for the
* support of your modified version, and
* 4. retain our contact information in regard to use of the base
* software.
* Permission to distribute the released version of the source code along
* with corresponding source modifications in the form of a patch file is
* granted with same provisions 2 through 4 for binary distributions.
*
* This software is provided "as is" without express or implied warranty
* to the extent permitted by applicable law.
]*/
#include "tables.h"
#include "command.h"
#include "datablock.h"
#include "fit.h"
#include "setshow.h"
#include "term_api.h"
#include "util.h"
#include "alloc.h" /* for init_colornames() */
#include "graph3d.h" /* for DGRID3D_* options */
# include "getcolor.h"
/* gnuplot commands */
/* the actual commands */
const struct gen_ftable command_ftbl[] =
{
{ "ra$ise", raise_command },
{ "low$er", lower_command },
#ifdef USE_MOUSE
{ "bi$nd", bind_command },
#endif
{ "array", array_command },
{ "break", break_command },
{ "ca$ll", call_command },
{ "cd", changedir_command },
{ "cl$ear", clear_command },
{ "continue", continue_command },
{ "do", do_command },
{ "eval$uate", eval_command },
{ "ex$it", exit_command },
{ "f$it", fit_command },
{ "h$elp", help_command },
{ "?", help_command },
{ "hi$story", history_command },
{ "if", if_command },
{ "import", import_command },
{ "else", else_command },
{ "l$oad", load_command },
{ "pa$use", pause_command },
{ "p$lot", plot_command },
{ "pr$int", print_command },
{ "printerr$or", printerr_command },
{ "pwd", pwd_command },
{ "q$uit", exit_command },
{ "ref$resh", refresh_command },
{ "rep$lot", replot_command },
{ "re$read", reread_command },
{ "res$et", reset_command },
{ "sa$ve", save_command },
{ "scr$eendump", screendump_command },
{ "se$t", set_command },
{ "she$ll", do_shell },
{ "sh$ow", show_command },
{ "sp$lot", splot_command },
{ "st$ats", stats_command },
{ "sy$stem", system_command },
{ "test", test_command },
{ "tog$gle", toggle_command },
{ "und$efine", undefine_command },
{ "uns$et", unset_command },
{ "up$date", update_command },
{ "while", while_command },
{ "{", begin_clause },
{ "}", end_clause },
{ ";", null_command },
{ "$", datablock_command },
/* last key must be NULL */
{ NULL, invalid_command }
};
/* 'plot ax[ei]s' parameter */
const struct gen_table plot_axes_tbl[] =
{
{ "x1y1", AXES_X1Y1 },
{ "x2y2", AXES_X2Y2 },
{ "x1y2", AXES_X1Y2 },
{ "x2y1", AXES_X2Y1 },
{ NULL, AXES_NONE }
};
/* 'plot smooth' parameter */
const struct gen_table plot_smooth_tbl[] =
{
{ "a$csplines", SMOOTH_ACSPLINES },
{ "bins", SMOOTH_BINS },
{ "b$ezier", SMOOTH_BEZIER },
{ "c$splines", SMOOTH_CSPLINES },
{ "s$bezier", SMOOTH_SBEZIER },
{ "u$nique", SMOOTH_UNIQUE },
{ "unwrap", SMOOTH_UNWRAP },
{ "f$requency", SMOOTH_FREQUENCY },
{ "cum$ulative", SMOOTH_CUMULATIVE },
{ "k$density", SMOOTH_KDENSITY },
{ "cn$ormal", SMOOTH_CUMULATIVE_NORMALISED },
{ "mcs$plines", SMOOTH_MONOTONE_CSPLINE },
{ "fnor$mal", SMOOTH_FREQUENCY_NORMALISED },
{ NULL, SMOOTH_NONE }
};
/* dgrid3d modes */
const struct gen_table dgrid3d_mode_tbl[] =
{
{ "qnorm", DGRID3D_QNORM },
{ "spline$s", DGRID3D_SPLINES },
{ "gauss", DGRID3D_GAUSS },
{ "exp", DGRID3D_EXP },
{ "cauchy", DGRID3D_CAUCHY },
{ "box", DGRID3D_BOX },
{ "hann", DGRID3D_HANN },
{ NULL, DGRID3D_OTHER }
};
/* 'save' command */
const struct gen_table save_tbl[] =
{
{ "fit", SAVE_FIT },
{ "fun$ctions", SAVE_FUNCS },
{ "set", SAVE_SET },
{ "ter$minal", SAVE_TERMINAL },
{ "var$iables", SAVE_VARS },
{ NULL, SAVE_INVALID }
};
/* 'set' and 'show' commands */
const struct gen_table set_tbl[] =
{
{ "a$ll", S_ALL },
{ "ac$tion_table", S_ACTIONTABLE },
{ "at", S_ACTIONTABLE },
{ "an$gles", S_ANGLES },
{ "ar$row", S_ARROW },
{ "au$toscale", S_AUTOSCALE },
{ "b$ars", S_BARS },
{ "bind", S_BIND },
{ "bor$der", S_BORDER },
{ "box$width", S_BOXWIDTH },
{ "cl$abel", S_CLABEL },
{ "c$lip", S_CLIP },
{ "cntrp$aram", S_CNTRPARAM },
{ "cntrl$abel", S_CNTRLABEL },
{ "cont$ours", S_CONTOUR },
{ "dasht$ype", S_DASHTYPE },
{ "dt", S_DASHTYPE },
{ "da$ta", S_DATA },
{ "data$file", S_DATAFILE },
{ "dg$rid3d", S_DGRID3D },
{ "du$mmy", S_DUMMY },
{ "enc$oding", S_ENCODING },
{ "dec$imalsign", S_DECIMALSIGN },
{ "errorbars", S_BARS },
{ "fit", S_FIT },
{ "font$path", S_FONTPATH },
{ "fo$rmat", S_FORMAT },
{ "fu$nction", S_FUNCTIONS },
{ "fu$nctions", S_FUNCTIONS },
{ "g$rid", S_GRID },
{ "hid$den3d", S_HIDDEN3D },
{ "historysize", S_HISTORYSIZE }, /* Deprecated */
{ "his$tory", S_HISTORY },
{ "is$osamples", S_ISOSAMPLES },
{ "jitter", S_JITTER },
{ "k$ey", S_KEY },
{ "keyt$itle", S_KEY },
{ "la$bel", S_LABEL },
{ "link", S_LINK },
{ "lines$tyle", S_LINESTYLE },
{ "linetype$s", S_LINETYPE },
{ "ls", S_LINESTYLE },
{ "lt", S_LINETYPE },
{ "loa$dpath", S_LOADPATH },
{ "loc$ale", S_LOCALE },
{ "log$scale", S_LOGSCALE },
{ "mac$ros", S_MACROS },
{ "map$ping", S_MAPPING },
{ "map$ping3d", S_MAPPING },
{ "mar$gins", S_MARGIN },
{ "lmar$gin", S_LMARGIN },
{ "rmar$gin", S_RMARGIN },
{ "tmar$gin", S_TMARGIN },
{ "bmar$gin", S_BMARGIN },
{ "micro", S_MICRO },
{ "minus$sign", S_MINUS_SIGN },
#ifdef USE_MOUSE
{ "mo$use", S_MOUSE },
#endif
{ "mono$chrome", S_MONOCHROME },
{ "multi$plot", S_MULTIPLOT },
{ "mxt$ics", S_MXTICS },
{ "nomxt$ics", S_NOMXTICS },
{ "mx2t$ics", S_MX2TICS },
{ "nomx2t$ics", S_NOMX2TICS },
{ "myt$ics", S_MYTICS },
{ "nomyt$ics", S_NOMYTICS },
{ "my2t$ics", S_MY2TICS },
{ "nomy2t$ics", S_NOMY2TICS },
{ "mzt$ics", S_MZTICS },
{ "nomzt$ics", S_NOMZTICS },
{ "mrt$ics", S_MRTICS },
{ "mtt$ics", S_MTTICS },
{ "mcbt$ics", S_MCBTICS },
{ "nomcbt$ics", S_NOMCBTICS },
{ "nonlinear", S_NONLINEAR },
{ "of$fsets", S_OFFSETS },
{ "or$igin", S_ORIGIN },
{ "o$utput", SET_OUTPUT },
{ "pa$rametric", S_PARAMETRIC },
{ "pm$3d", S_PM3D },
{ "pal$ette", S_PALETTE },
{ "color", S_COLOR },
{ "colorb$ox", S_COLORBOX },
{ "colorn$ames", S_COLORNAMES },
{ "colors$equence", S_COLORSEQUENCE },
{ "p$lot", S_PLOT },
{ "pointint$ervalbox", S_POINTINTERVALBOX },
{ "poi$ntsize", S_POINTSIZE },
{ "pol$ar", S_POLAR },
{ "pr$int", S_PRINT },
{ "psdir", S_PSDIR },
{ "obj$ect", S_OBJECT },
{ "rgbmax", S_RGBMAX },
{ "sa$mples", S_SAMPLES },
{ "si$ze", S_SIZE },
{ "st$yle", S_STYLE },
{ "su$rface", S_SURFACE },
{ "table", S_TABLE },
{ "t$erminal", S_TERMINAL },
{ "termopt$ions", S_TERMOPTIONS },
{ "theta$0", S_THETA },
{ "ti$cs", S_TICS },
{ "ticsc$ale", S_TICSCALE },
{ "ticsl$evel", S_TICSLEVEL },
{ "timef$mt", S_TIMEFMT },
{ "tim$estamp", S_TIMESTAMP },
{ "tit$le", S_TITLE },
{ "v$ariables", S_VARIABLES },
{ "ve$rsion", S_VERSION },
{ "vi$ew", S_VIEW },
{ "xyp$lane", S_XYPLANE },
{ "xda$ta", S_XDATA },
{ "x2da$ta", S_X2DATA },
{ "yda$ta", S_YDATA },
{ "y2da$ta", S_Y2DATA },
{ "zda$ta", S_ZDATA },
{ "cbda$ta", S_CBDATA },
{ "xl$abel", S_XLABEL },
{ "x2l$abel", S_X2LABEL },
{ "yl$abel", S_YLABEL },
{ "y2l$abel", S_Y2LABEL },
{ "zl$abel", S_ZLABEL },
{ "cbl$abel", S_CBLABEL },
{ "rlabel", S_RLABEL },
{ "xti$cs", S_XTICS },
{ "noxti$cs", S_NOXTICS },
{ "x2ti$cs", S_X2TICS },
{ "nox2ti$cs", S_NOX2TICS },
{ "yti$cs", S_YTICS },
{ "noyti$cs", S_NOYTICS },
{ "y2ti$cs", S_Y2TICS },
{ "noy2ti$cs", S_NOY2TICS },
{ "zti$cs", S_ZTICS },
{ "nozti$cs", S_NOZTICS },
{ "rti$cs", S_RTICS },
{ "tti$cs", S_TTICS },
{ "cbti$cs", S_CBTICS },
{ "nocbti$cs", S_NOCBTICS },
{ "xdti$cs", S_XDTICS },
{ "noxdti$cs", S_NOXDTICS },
{ "x2dti$cs", S_X2DTICS },
{ "nox2dti$cs", S_NOX2DTICS },
{ "ydti$cs", S_YDTICS },
{ "noydti$cs", S_NOYDTICS },
{ "y2dti$cs", S_Y2DTICS },
{ "noy2dti$cs", S_NOY2DTICS },
{ "zdti$cs", S_ZDTICS },
{ "nozdti$cs", S_NOZDTICS },
{ "cbdti$cs", S_CBDTICS },
{ "nocbdti$cs", S_NOCBDTICS },
{ "xmti$cs", S_XMTICS },
{ "noxmti$cs", S_NOXMTICS },
{ "x2mti$cs", S_X2MTICS },
{ "nox2mti$cs", S_NOX2MTICS },
{ "ymti$cs", S_YMTICS },
{ "noymti$cs", S_NOYMTICS },
{ "y2mti$cs", S_Y2MTICS },
{ "noy2mti$cs", S_NOY2MTICS },
{ "zmti$cs", S_ZMTICS },
{ "nozmti$cs", S_NOZMTICS },
{ "cbmti$cs", S_CBMTICS },
{ "nocbmti$cs", S_NOCBMTICS },
{ "xr$ange", S_XRANGE },
{ "x2r$ange", S_X2RANGE },
{ "yr$ange", S_YRANGE },
{ "y2r$ange", S_Y2RANGE },
{ "zr$ange", S_ZRANGE },
{ "cbr$ange", S_CBRANGE },
{ "rr$ange", S_RRANGE },
{ "tr$ange", S_TRANGE },
{ "ur$ange", S_URANGE },
{ "vr$ange", S_VRANGE },
{ "xzeroa$xis", S_XZEROAXIS },
{ "x2zeroa$xis", S_X2ZEROAXIS },
{ "yzeroa$xis", S_YZEROAXIS },
{ "y2zeroa$xis", S_Y2ZEROAXIS },
{ "zzeroa$xis", S_ZZEROAXIS },
{ "zeroa$xis", S_ZEROAXIS },
{ "rax$is", S_RAXIS },
{ "paxis", S_PAXIS },
{ "z$ero", S_ZERO },
{ NULL, S_INVALID }
};
/* 'set hidden3d' options */
const struct gen_table set_hidden3d_tbl[] =
{
{ "def$aults", S_HI_DEFAULTS },
{ "off$set", S_HI_OFFSET },
{ "nooff$set", S_HI_NOOFFSET },
{ "tri$anglepattern", S_HI_TRIANGLEPATTERN },
{ "undef$ined", S_HI_UNDEFINED },
{ "nound$efined", S_HI_NOUNDEFINED },
{ "alt$diagonal", S_HI_ALTDIAGONAL },
{ "noalt$diagonal", S_HI_NOALTDIAGONAL },
{ "bent$over", S_HI_BENTOVER },
{ "nobent$over", S_HI_NOBENTOVER },
{ "front", S_HI_FRONT },
{ "back", S_HI_BACK },
{ NULL, S_HI_INVALID }
};
/* 'set key' options */
const struct gen_table set_key_tbl[] =
{
{ "def$ault", S_KEY_DEFAULT },
{ "on", S_KEY_ON },
{ "off", S_KEY_OFF },
{ "t$op", S_KEY_TOP },
{ "b$ottom", S_KEY_BOTTOM },
{ "l$eft", S_KEY_LEFT },
{ "r$ight", S_KEY_RIGHT },
{ "c$enter", S_KEY_CENTER },
{ "ver$tical", S_KEY_VERTICAL },
{ "hor$izontal", S_KEY_HORIZONTAL },
{ "ov$er", S_KEY_OVER },
{ "ab$ove", S_KEY_ABOVE },
{ "u$nder", S_KEY_UNDER },
{ "be$low", S_KEY_BELOW },
{ "at", S_KEY_MANUAL },
{ "ins$ide", S_KEY_INSIDE },
{ "o$utside", S_KEY_OUTSIDE },
{ "fix$ed", S_KEY_FIXED },
{ "tm$argin", S_KEY_TMARGIN },
{ "bm$argin", S_KEY_BMARGIN },
{ "lm$argin", S_KEY_LMARGIN },
{ "rm$argin", S_KEY_RMARGIN },
{ "L$eft", S_KEY_LLEFT },
{ "R$ight", S_KEY_RRIGHT },
{ "rev$erse", S_KEY_REVERSE },
{ "norev$erse", S_KEY_NOREVERSE },
{ "inv$ert", S_KEY_INVERT },
{ "noinv$ert", S_KEY_NOINVERT },
{ "enh$anced", S_KEY_ENHANCED },
{ "noenh$anced", S_KEY_NOENHANCED },
{ "b$ox", S_KEY_BOX },
{ "nob$ox", S_KEY_NOBOX },
{ "sa$mplen", S_KEY_SAMPLEN },
{ "sp$acing", S_KEY_SPACING },
{ "w$idth", S_KEY_WIDTH },
{ "h$eight", S_KEY_HEIGHT },
{ "a$utotitles", S_KEY_AUTOTITLES },
{ "noa$utotitles", S_KEY_NOAUTOTITLES },
{ "ti$tle", S_KEY_TITLE },
{ "noti$tle", S_KEY_NOTITLE },
{ "font", S_KEY_FONT },
{ "tc", S_KEY_TEXTCOLOR },
{ "text$color", S_KEY_TEXTCOLOR },
{ "maxcol$s", S_KEY_MAXCOLS},
{ "maxcolu$mns", S_KEY_MAXCOLS},
{ "maxrow$s", S_KEY_MAXROWS},
{ "opaque", S_KEY_FRONT},
{ "noopaque", S_KEY_NOFRONT},
{ NULL, S_KEY_INVALID }
};
/* 'test' command */
const struct gen_table test_tbl[] =
{
{ "term$inal", TEST_TERMINAL },
{ "pal$ette", TEST_PALETTE },
{ NULL, TEST_INVALID }
};
/* 'set colorbox' options */
const struct gen_table set_colorbox_tbl[] =
{
{ "v$ertical", S_COLORBOX_VERTICAL },
{ "h$orizontal", S_COLORBOX_HORIZONTAL },
{ "def$ault", S_COLORBOX_DEFAULT },
{ "u$ser", S_COLORBOX_USER },
{ "at", S_COLORBOX_USER },
{ "bo$rder", S_COLORBOX_BORDER },
{ "bd$efault", S_COLORBOX_BDEFAULT },
{ "nobo$rder", S_COLORBOX_NOBORDER },
{ "o$rigin", S_COLORBOX_ORIGIN },
{ "s$ize", S_COLORBOX_SIZE },
{ "inv$ert", S_COLORBOX_INVERT },
{ "noinv$ert", S_COLORBOX_NOINVERT },
{ "fr$ont", S_COLORBOX_FRONT },
{ "ba$ck", S_COLORBOX_BACK },
{ NULL, S_COLORBOX_INVALID }
};
/* 'set palette' options */
const struct gen_table set_palette_tbl[] =
{
{ "pos$itive", S_PALETTE_POSITIVE },
{ "neg$ative", S_PALETTE_NEGATIVE },
{ "gray$scale", S_PALETTE_GRAY },
{ "grey$scale", S_PALETTE_GRAY },
{ "col$or", S_PALETTE_COLOR },
{ "rgb$formulae", S_PALETTE_RGBFORMULAE },
{ "def$ined", S_PALETTE_DEFINED },
{ "file", S_PALETTE_FILE },
{ "func$tions", S_PALETTE_FUNCTIONS },
{ "mo$del", S_PALETTE_MODEL },
{ "nops_allcF", S_PALETTE_NOPS_ALLCF },
{ "ps_allcF", S_PALETTE_PS_ALLCF },
{ "maxc$olors", S_PALETTE_MAXCOLORS },
{ "gam$ma", S_PALETTE_GAMMA },
{ "cubehelix", S_PALETTE_CUBEHELIX },
{ NULL, S_PALETTE_INVALID }
};
const struct gen_table color_model_tbl[] =
{
{ "RGB", C_MODEL_RGB },
{ "HSV", C_MODEL_HSV },
{ "CMY", C_MODEL_CMY },
{ "YIQ", C_MODEL_YIQ },
{ "XYZ", C_MODEL_XYZ },
{ NULL, -1 }
};
/* 'set pm3d' options */
const struct gen_table set_pm3d_tbl[] =
{
{ "at", S_PM3D_AT },
{ "interp$olate", S_PM3D_INTERPOLATE },
{ "scansfor$ward", S_PM3D_SCANSFORWARD },
{ "scansback$ward", S_PM3D_SCANSBACKWARD },
{ "scansauto$matic",S_PM3D_SCANS_AUTOMATIC },
{ "dep$thorder", S_PM3D_DEPTH },
{ "fl$ush", S_PM3D_FLUSH },
{ "ftr$iangles", S_PM3D_FTRIANGLES },
{ "noftr$iangles", S_PM3D_NOFTRIANGLES },
{ "clip1$in", S_PM3D_CLIP_1IN },
{ "clip4$in", S_PM3D_CLIP_4IN },
{ "map", S_PM3D_MAP },
{ "bo$rder", S_PM3D_BORDER },
{ "nobo$rder", S_PM3D_NOBORDER },
{ "hi$dden3d", S_PM3D_HIDDEN },
{ "nohi$dden3d", S_PM3D_NOHIDDEN },
{ "so$lid", S_PM3D_SOLID },
{ "notr$ansparent", S_PM3D_NOTRANSPARENT },
{ "noso$lid", S_PM3D_NOSOLID },
{ "tr$ansparent", S_PM3D_TRANSPARENT },
{ "i$mplicit", S_PM3D_IMPLICIT },
{ "noe$xplicit", S_PM3D_NOEXPLICIT },
{ "noi$mplicit", S_PM3D_NOIMPLICIT },
{ "e$xplicit", S_PM3D_EXPLICIT },
{ "corners2c$olor", S_PM3D_WHICH_CORNER },
{ "light$ing", S_PM3D_LIGHTING_MODEL },
{ "nolight$ing", S_PM3D_NOLIGHTING_MODEL },
{ NULL, S_PM3D_INVALID }
};
/* EAM Nov 2008 - RGB color names for 'set palette defined'
* merged with colors from web_color_rgbs used by terminals.
*/
struct gen_table default_color_names_tbl[] =
{
/* Put the colors used by gd/pdf/ppm terminals first */
{ "white" , 255*(1<<16) + 255*(1<<8) + 255 },
{ "black" , 0*(1<<16) + 0*(1<<8) + 0 },
{ "dark-grey" , 160*(1<<16) + 160*(1<<8) + 160 },
{ "red" , 255*(1<<16) + 0*(1<<8) + 0 },
{ "web-green" , 0*(1<<16) + 192*(1<<8) + 0 },
{ "web-blue" , 0*(1<<16) + 128*(1<<8) + 255 },
{ "dark-magenta" , 192*(1<<16) + 0*(1<<8) + 255 },
{ "dark-cyan" , 0*(1<<16) + 238*(1<<8) + 238 },
{ "dark-orange" , 192*(1<<16) + 64*(1<<8) + 0 },
{ "dark-yellow" , 200*(1<<16) + 200*(1<<8) + 0 },
{ "royalblue" , 65*(1<<16) + 105*(1<<8) + 225 },
{ "goldenrod" , 255*(1<<16) + 192*(1<<8) + 32 },
{ "dark-spring-green", 0*(1<<16) + 128*(1<<8) + 64 },
{ "purple" , 192*(1<<16) + 128*(1<<8) + 255 },
{ "steelblue" , 48*(1<<16) + 96*(1<<8) + 128 },
{ "dark-red" , 139*(1<<16) + 0*(1<<8) + 0 },
{ "dark-chartreuse" , 64*(1<<16) + 128*(1<<8) + 0 },
{ "orchid" , 255*(1<<16) + 128*(1<<8) + 255 },
{ "aquamarine" , 127*(1<<16) + 255*(1<<8) + 212 },
{ "brown" , 165*(1<<16) + 42*(1<<8) + 42 },
{ "yellow" , 255*(1<<16) + 255*(1<<8) + 0 },
{ "turquoise" , 64*(1<<16) + 224*(1<<8) + 208 },
/* greyscale gradient */
{ "grey0" , 0*(1<<16) + 0*(1<<8) + 0 },
{ "grey10" , 26*(1<<16) + 26*(1<<8) + 26 },
{ "grey20" , 51*(1<<16) + 51*(1<<8) + 51 },
{ "grey30" , 77*(1<<16) + 77*(1<<8) + 77 },
{ "grey40" , 102*(1<<16) + 102*(1<<8) + 102 },
{ "grey50" , 127*(1<<16) + 127*(1<<8) + 127 },
{ "grey60" , 153*(1<<16) + 153*(1<<8) + 153 },
{ "grey70" , 179*(1<<16) + 179*(1<<8) + 179 },
{ "grey" , 192*(1<<16) + 192*(1<<8) + 192 },
{ "grey80" , 204*(1<<16) + 204*(1<<8) + 204 },
{ "grey90" , 229*(1<<16) + 229*(1<<8) + 229 },
{ "grey100" , 255*(1<<16) + 255*(1<<8) + 255 },
/* random other colors */
{ "light-red" , 240*(1<<16) + 50*(1<<8) + 50 },
{ "light-green" , 144*(1<<16) + 238*(1<<8) + 144 },
{ "light-blue" , 173*(1<<16) + 216*(1<<8) + 230 },
{ "light-magenta" , 240*(1<<16) + 85*(1<<8) + 240 },
{ "light-cyan" , 224*(1<<16) + 255*(1<<8) + 255 },
{ "light-goldenrod" , 238*(1<<16) + 221*(1<<8) + 130 },
{ "light-pink" , 255*(1<<16) + 182*(1<<8) + 193 },
{ "light-turquoise" , 175*(1<<16) + 238*(1<<8) + 238 },
{ "gold" , 255*(1<<16) + 215*(1<<8) + 0 },
{ "green" , 0*(1<<16) + 255*(1<<8) + 0 },
{ "dark-green" , 0*(1<<16) + 100*(1<<8) + 0 },
{ "spring-green" , 0*(1<<16) + 255*(1<<8) + 127 },
{ "forest-green" , 34*(1<<16) + 139*(1<<8) + 34 },
{ "sea-green" , 46*(1<<16) + 139*(1<<8) + 87 },
{ "blue" , 0*(1<<16) + 0*(1<<8) + 255 },
{ "dark-blue" , 0*(1<<16) + 0*(1<<8) + 139 },
{ "midnight-blue" , 25*(1<<16) + 25*(1<<8) + 112 },
{ "navy" , 0*(1<<16) + 0*(1<<8) + 128 },
{ "medium-blue" , 0*(1<<16) + 0*(1<<8) + 205 },
{ "skyblue" , 135*(1<<16) + 206*(1<<8) + 235 },
{ "cyan" , 0*(1<<16) + 255*(1<<8) + 255 },
{ "magenta" , 255*(1<<16) + 0*(1<<8) + 255 },
{ "dark-turquoise" , 0*(1<<16) + 206*(1<<8) + 209 },
{ "dark-pink" , 255*(1<<16) + 20*(1<<8) + 147 },
{ "coral" , 255*(1<<16) + 127*(1<<8) + 80 },
{ "light-coral" , 240*(1<<16) + 128*(1<<8) + 128 },
{ "orange-red" , 255*(1<<16) + 69*(1<<8) + 0 },
{ "salmon" , 250*(1<<16) + 128*(1<<8) + 114 },
{ "dark-salmon" , 233*(1<<16) + 150*(1<<8) + 122 },
{ "khaki" , 240*(1<<16) + 230*(1<<8) + 140 },
{ "dark-khaki" , 189*(1<<16) + 183*(1<<8) + 107 },
{ "dark-goldenrod" , 184*(1<<16) + 134*(1<<8) + 11 },
{ "beige" , 245*(1<<16) + 245*(1<<8) + 220 },
{ "olive" , 160*(1<<16) + 128*(1<<8) + 32 },
{ "orange" , 255*(1<<16) + 165*(1<<8) + 0 },
{ "violet" , 238*(1<<16) + 130*(1<<8) + 238 },
{ "dark-violet" , 148*(1<<16) + 0*(1<<8) + 211 },
{ "plum" , 221*(1<<16) + 160*(1<<8) + 221 },
{ "dark-plum" , 144*(1<<16) + 80*(1<<8) + 64 },
{ "dark-olivegreen" , 85*(1<<16) + 107*(1<<8) + 47 },
{ "orangered4" , 128*(1<<16) + 20*(1<<8) + 0 },
{ "brown4" , 128*(1<<16) + 20*(1<<8) + 20 },
{ "sienna4" , 128*(1<<16) + 64*(1<<8) + 20 },
{ "orchid4" , 128*(1<<16) + 64*(1<<8) + 128 },
{ "mediumpurple3" , 128*(1<<16) + 96*(1<<8) + 192 },
{ "slateblue1" , 128*(1<<16) + 96*(1<<8) + 255 },
{ "yellow4" , 128*(1<<16) + 128*(1<<8) + 0 },
{ "sienna1" , 255*(1<<16) + 128*(1<<8) + 64 },
{ "tan1" , 255*(1<<16) + 160*(1<<8) + 64 },
{ "sandybrown" , 255*(1<<16) + 160*(1<<8) + 96 },
{ "light-salmon" , 255*(1<<16) + 160*(1<<8) + 112 },
{ "pink" , 255*(1<<16) + 192*(1<<8) + 192 },
{ "khaki1" , 255*(1<<16) + 255*(1<<8) + 128 },
{ "lemonchiffon" , 255*(1<<16) + 255*(1<<8) + 192 },
{ "bisque" , 205*(1<<16) + 183*(1<<8) + 158 },
{ "honeydew" , 240*(1<<16) + 255*(1<<8) + 240 },
{ "slategrey" , 160*(1<<16) + 182*(1<<8) + 205 },
{ "seagreen" , 193*(1<<16) + 255*(1<<8) + 193 },
{ "antiquewhite" , 205*(1<<16) + 192*(1<<8) + 176 },
{ "chartreuse" , 124*(1<<16) + 255*(1<<8) + 64 },
{ "greenyellow" , 160*(1<<16) + 255*(1<<8) + 32 },
/* Synonyms */
{ "gray" , 190*(1<<16) + 190*(1<<8) + 190 },
{ "light-gray" , 211*(1<<16) + 211*(1<<8) + 211 },
{ "light-grey" , 211*(1<<16) + 211*(1<<8) + 211 },
{ "dark-gray" , 160*(1<<16) + 160*(1<<8) + 160 },
{ "slategray" , 160*(1<<16) + 182*(1<<8) + 205 },
{ "gray0" , 0*(1<<16) + 0*(1<<8) + 0 },
{ "gray10" , 26*(1<<16) + 26*(1<<8) + 26 },
{ "gray20" , 51*(1<<16) + 51*(1<<8) + 51 },
{ "gray30" , 77*(1<<16) + 77*(1<<8) + 77 },
{ "gray40" , 102*(1<<16) + 102*(1<<8) + 102 },
{ "gray50" , 127*(1<<16) + 127*(1<<8) + 127 },
{ "gray60" , 153*(1<<16) + 153*(1<<8) + 153 },
{ "gray70" , 179*(1<<16) + 179*(1<<8) + 179 },
{ "gray80" , 204*(1<<16) + 204*(1<<8) + 204 },
{ "gray90" , 229*(1<<16) + 229*(1<<8) + 229 },
{ "gray100" , 255*(1<<16) + 255*(1<<8) + 255 },
{ NULL, -1 }
};
struct gen_table *pm3d_color_names_tbl = default_color_names_tbl;
struct gen_table *user_color_names_tbl = NULL;
const int num_predefined_colors = sizeof(default_color_names_tbl)
/ sizeof(struct gen_table) - 1;
int num_userdefined_colors = 0;
const struct gen_table show_style_tbl[] =
{
{ "d$ata", SHOW_STYLE_DATA },
{ "f$unction", SHOW_STYLE_FUNCTION },
{ "l$ines", SHOW_STYLE_LINE },
{ "fill", SHOW_STYLE_FILLING },
{ "fs", SHOW_STYLE_FILLING },
{ "ar$row", SHOW_STYLE_ARROW },
{ "incr$ement", SHOW_STYLE_INCREMENT },
{ "hist$ogram", SHOW_STYLE_HISTOGRAM },
{ "circ$le", SHOW_STYLE_CIRCLE },
{ "ell$ipse", SHOW_STYLE_ELLIPSE },
{ "rect$angle", SHOW_STYLE_RECTANGLE },
{ "boxplot", SHOW_STYLE_BOXPLOT },
{ "parallel$axis", SHOW_STYLE_PARALLEL },
#ifndef EAM_BOXED_TEXT
{ "textbox", SHOW_STYLE_TEXTBOX },
#endif
{ NULL, SHOW_STYLE_INVALID }
};
const struct gen_table plotstyle_tbl[] =
{
{ "l$ines", LINES },
{ "i$mpulses", IMPULSES },
{ "p$oints", POINTSTYLE },
{ "linesp$oints", LINESPOINTS },
{ "lp", LINESPOINTS },
{ "d$ots", DOTS },
{ "yerrorl$ines", YERRORLINES },
{ "errorl$ines", YERRORLINES },
{ "xerrorl$ines", XERRORLINES },
{ "xyerrorl$ines", XYERRORLINES },
{ "ye$rrorbars", YERRORBARS },
{ "e$rrorbars", YERRORBARS },
{ "xe$rrorbars", XERRORBARS },
{ "xye$rrorbars", XYERRORBARS },
{ "boxes", BOXES },
{ "hist$ograms", HISTOGRAMS },
{ "filledc$urves", FILLEDCURVES },
{ "boxer$rorbars", BOXERROR },
{ "boxx$yerrorbars", BOXXYERROR },
{ "st$eps", STEPS },
{ "fillst$eps", FILLSTEPS },
{ "fs$teps", FSTEPS },
{ "his$teps", HISTEPS },
{ "vec$tors", VECTOR },
{ "fin$ancebars", FINANCEBARS },
{ "can$dlesticks", CANDLESTICKS },
{ "boxplot", BOXPLOT },
{ "pm$3d", PM3DSURFACE },
{ "labels", LABELPOINTS },
{ "ima$ge", IMAGE },
{ "rgbima$ge", RGBIMAGE },
{ "rgba$lpha", RGBA_IMAGE },
#ifdef EAM_OBJECTS
{ "cir$cles", CIRCLES },
{ "ell$ipses", ELLIPSES },
#endif
{ "sur$face", SURFACEGRID },
{ "parallel$axes", PARALLELPLOT },
{ "table", TABLESTYLE },
{ "zerror$fill", ZERRORFILL },
{ NULL, PLOT_STYLE_NONE }
};
const struct gen_table filledcurves_opts_tbl[] =
{
{ "c$losed", FILLEDCURVES_CLOSED },
{ "x$1", FILLEDCURVES_X1 },
{ "y1", FILLEDCURVES_Y1 },
{ "x2", FILLEDCURVES_X2 },
{ "y2", FILLEDCURVES_Y2 },
{ "xy", FILLEDCURVES_ATXY },
{ "r", FILLEDCURVES_ATR },
{ "above", FILLEDCURVES_ABOVE },
{ "below", FILLEDCURVES_BELOW },
{ "y", FILLEDCURVES_Y1 },
{ NULL, -1 }
};
int
lookup_table(const struct gen_table *tbl, int find_token)
{
while (tbl->key) {
if (almost_equals(find_token, tbl->key))
return tbl->value;
tbl++;
}
return tbl->value; /* *_INVALID */
}
parsefuncp_t
lookup_ftable(const struct gen_ftable *ftbl, int find_token)
{
while (ftbl->key) {
if (almost_equals(find_token, ftbl->key))
return ftbl->value;
ftbl++;
}
return ftbl->value;
}
/* Returns value of the first table entry for which the search string
* is a leading substring, or -1 if there is no match.
*/
int
lookup_table_entry(const struct gen_table *tbl, const char *search_str)
{
while (tbl->key) {
if (!strncmp(search_str, tbl->key, strlen(search_str)))
return tbl->value;
tbl++;
}
return -1;
}
/* Returns the index of the table entry whose key matches the search string.
* If there is no exact match return the first table entry that is a leading
* substring of the search string. Returns -1 if there is no match.
*/
int
lookup_table_nth(const struct gen_table *tbl, const char *search_str)
{
int k = -1;
int best_so_far = -1;
while (tbl[++k].key) {
/* Exact match always wins */
if (!strcmp(search_str, tbl[k].key))
return k;
if (!strncmp(search_str, tbl[k].key, strlen(tbl[k].key)))
if (best_so_far < 0) best_so_far = k;
}
return best_so_far;
}
/* Returns index of the table tbl whose key matches the beginning of the
* search string search_str. The table_len is necessary because the table
* is searched in the reversed order. The routine is used in parsing commands
* '(un)set log x2zcb', for instance.
* It returns index into the table or -1 if there is no match.
*/
int
lookup_table_nth_reverse(
const struct gen_table *tbl,
int table_len,
const char *search_str)
{
while (--table_len >= 0) {
if (tbl[table_len].key && !strncmp(search_str, tbl[table_len].key, strlen(tbl[table_len].key)))
return table_len;
}
return -1; /* not found */
}
/* Returns the key associated with this indexed value
* or NULL if the key/value pair is not found.
*/
const char *
reverse_table_lookup(const struct gen_table *tbl, int entry)
{
int k = -1;
while (tbl[++k].key)
if (tbl[k].value == entry)
return(tbl[k].key);
return NULL;
}
| [
"luiz@ic.ufal.br"
] | luiz@ic.ufal.br |
de27422bd4669c7ab7b6d7a73497f1ed5570edcc | 0fbd393e538372cd77ce2de2ba7e08401127aa94 | /BinaryHeap/BinaryHeap.h | 30526d6f9382fc1ae09e7b4347dcee8deeedee07 | [] | no_license | NoSoul/ToolsLib | 3e9e90a689cb989384d94c249876ee68c58f5f21 | 9c6caec142c6053ce2f55734c70566ca58050d0a | refs/heads/master | 2021-12-12T01:53:17.172152 | 2021-11-29T06:41:42 | 2021-11-29T06:41:42 | 18,164,191 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,038 | h | #ifndef _BinaryHeap_H_
#define _BinaryHeap_H_
typedef int DataType_t;
int DataCMP(DataType_t a, DataType_t b)
{
return a > b ? 1 : 0;
}
void BinaryHeapPush(DataType_t *array, int *len, DataType_t val)
{
++(*len);
int now = *len;
while(now > 1 && DataCMP(val, array[now >> 1])) {
array[now] = array[now >> 1];
now >>= 1;
}
array[now] = val;
}
DataType_t BinaryHeapPop(DataType_t *array, int *len)
{
DataType_t ret = array[1];
int now = 1, temp;
while((now << 1) <= *len) {
temp = now << 1;
if((temp + 1) <= *len && DataCMP(array[temp + 1], array[temp])) {
++temp;
}
if(DataCMP(array[temp], array[*len])) {
array[now] = array[temp];
} else {
break;
}
now = temp;
}
array[now] = array[*len];
--(*len);
return ret;
}
void BinaryHeapSort(DataType_t *array, int len)
{
while(len) {
int curIdx = len;
array[curIdx] = BinaryHeapPop(array, &len);
}
}
#endif
| [
"NoSoul.Love@GMail.com"
] | NoSoul.Love@GMail.com |
a04d86812e773faddf0b392e1023b3de28017668 | f1fa2ac7f82bc25f7c1281013d31db2527cb1740 | /selected-cgc-prgs/electronictrading/src/cgc_stock.h | c31c72abb5a49e005faffdf4180cbcb9693aa3c5 | [] | no_license | pansilup/cgc-prgs-for-klee-seed-mode | 9e5788cd65f5b860b10e8eb47d4f1d3eb1d2b5cb | c4c21dc0e836a4c043d5302be0c262ee5792c37d | refs/heads/master | 2023-08-17T00:08:52.537823 | 2021-09-10T06:30:08 | 2021-09-10T06:30:08 | 390,788,158 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,495 | h | /*
* Copyright (C) Narf Industries <info@narfindustries.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* @file stock.h
*
* Functions for manipulating stock and order structs.
*/
#ifndef STOCK_H_
#define STOCK_H_
#include "cgc_list.h"
#include "cgc_pool.h"
#define HASH_TABLE_NUM_BUCKETS 251
#define STOCK_NAME_MAX_LEN 4
enum order_type {
BUY,
SELL
};
typedef LIST_OF(struct order) order_list_t;
typedef LIST_OF(struct stock) stock_list_t;
struct stock;
// Type confusion
#ifdef PATCHED
enum object_type {
ORDER,
STOCK
};
#endif
struct order {
// Type confusion
#ifdef PATCHED
enum object_type obj_type;
#else
int dummy;
#endif
void (*on_complete)(struct order *order);
// unsigned int id, price, quantity;
unsigned long id;
unsigned int price, quantity;
LIST_ELEMS(struct order) global_list, stock_list;
enum order_type type;
struct stock *stock;
};
struct stock {
// Type confusion
#ifdef PATCHED
enum object_type obj_type;
#else
int dummy;
#endif
char name[STOCK_NAME_MAX_LEN];
unsigned int num_orders;
LIST_ELEMS(struct stock) bucket_list, global_list;
order_list_t buy_orders, sell_orders;
};
struct stock_state {
// Use after free
#ifdef PATCHED
int stock_freed;
#endif
struct pool stock_pool;
stock_list_t stocks_list;
order_list_t orders_list;
stock_list_t stock_hash_table[HASH_TABLE_NUM_BUCKETS];
};
/**
* Initialize a stock state struct.
*
* @param state The stock state struct
*/
void cgc_stock_init(struct stock_state *state);
/**
* Destroy a stock state struct.
*
* @param state The stock state struct
*/
void cgc_stock_destroy(struct stock_state *state);
/**
* Process a command to list all stocks, printing to cgc_stdout.
*
* @param state The stock state struct
* @return 0 on success, -1 on failure
*/
int cgc_cmd_list_stocks(struct stock_state *state);
/**
* Process a command to list all orders for a stock, printing to cgc_stdout.
*
* @param state The stock state struct
* @param name The name of the stock to examine
* @return 0 on success, -1 on failure
*/
int cgc_cmd_list_orders(const struct stock_state *state, const char *name);
/**
* Process a command to place an order
*
* @param state The stock state struct
* @param name The name of the stock to place an order for
* @param type The type of the order (zero for buy, non-zero for sell)
* @param quantity The quantity to order
* @param price The price for each unit of the order
* @return id of new order on success, -1 on failure
*/
// int cgc_cmd_place_order(struct stock_state *state, const char *name, int type,
long cgc_cmd_place_order(struct stock_state *state, const char *name, int type,
unsigned int quantity, unsigned int price);
/**
* Process a command to check the status of an order, printing to cgc_stdout.
*
* @param state The stock state struct
* @param id The id of the order
* @return 0 on success, -1 on failure
*/
// int cgc_cmd_check_order(const struct stock_state *state, unsigned int id);
int cgc_cmd_check_order(const struct stock_state *state, unsigned long id);
/**
* Process a command to cancel an order.
*
* @param state The stock state struct
* @param id The id of the order
* @return 0 on success, -1 on failure
*/
// int cgc_cmd_cancel_order(struct stock_state *state, unsigned int id);
int cgc_cmd_cancel_order(struct stock_state *state, unsigned long id);
#endif /* STOCK_H_ */
| [
"pansilu.17@cse.mrt.ac.lk"
] | pansilu.17@cse.mrt.ac.lk |
87f524a3529452c750202781a01e7e99d945efdc | 5ccaeb278ef69bf41d803f9bf339101c39bf2136 | /framework/peripheral/eth/processor/eth_p32mx320f128h.h | 374ad80c3e0c367b080f694c89c191bca956dcbc | [] | no_license | Mytrex/Harmony | 6de69d5ebbb8cb7769a9ee7bd0330264c1d6ed3a | 32dceb018139e59a12c26044b9f0252d1c0d67c9 | refs/heads/master | 2021-03-16T09:42:26.915713 | 2016-11-02T08:25:20 | 2016-11-02T08:25:20 | 71,403,438 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 27,672 | h | /* Created by plibgen $Revision: 1.31 $ */
#ifndef _ETH_P32MX320F128H_H
#define _ETH_P32MX320F128H_H
/* Section 1 - Enumerate instances, define constants, VREGs */
#include <xc.h>
#include <stdbool.h>
#include "peripheral/peripheral_common_32bit.h"
/* Default definition used for all API dispatch functions */
#ifndef PLIB_INLINE_API
#define PLIB_INLINE_API extern inline
#endif
/* Default definition used for all other functions */
#ifndef PLIB_INLINE
#define PLIB_INLINE extern inline
#endif
typedef enum {
ETH_NUMBER_OF_MODULES = 0
} ETH_MODULE_ID;
/* Section 2 - Feature variant inclusion */
#define PLIB_TEMPLATE PLIB_INLINE
/* Section 3 - PLIB dispatch function definitions */
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PauseTimerSet(ETH_MODULE_ID index, uint16_t PauseTimerValue)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_PauseTimerGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsPauseTimer(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_Enable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_Disable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_IsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsEnable(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_StopInIdleEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_StopInIdleDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_StopInIdleIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsStopInIdle(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxRTSEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxRTSDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_TxRTSIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsTransmitRTS(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_RxIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsRxEnable(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_AutoFlowControlEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_AutoFlowControlDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_AutoFlowControlIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsAutoFlowControl(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ManualFlowControlEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ManualFlowControlDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_ManualFlowControlIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsManualFlowControl(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxBufferCountDecrement(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsRxBufferCountDecrement(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_ReceiveBufferSizeGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ReceiveBufferSizeSet(ETH_MODULE_ID index, uint8_t ReceiveBufferSize)
{
}
PLIB_INLINE_API int _PLIB_UNSUPPORTED PLIB_ETH_RxSetBufferSize(ETH_MODULE_ID index, int rxBuffSize)
{
return (int)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsReceiveBufferSize(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxPacketDescAddrSet(ETH_MODULE_ID index, uint8_t* txPacketDescStartAddr)
{
}
PLIB_INLINE_API uint8_t* _PLIB_UNSUPPORTED PLIB_ETH_TxPacketDescAddrGet(ETH_MODULE_ID index)
{
return (uint8_t*)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsTxPacketDescriptorAddress(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxPacketDescAddrSet(ETH_MODULE_ID index, uint8_t* rxPacketDescStartAddr)
{
}
PLIB_INLINE_API uint8_t* _PLIB_UNSUPPORTED PLIB_ETH_RxPacketDescAddrGet(ETH_MODULE_ID index)
{
return (uint8_t*)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsRxPacketDescriptorAddress(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_HashTableSet(ETH_MODULE_ID index, uint64_t hashTableValue)
{
}
PLIB_INLINE_API uint32_t _PLIB_UNSUPPORTED PLIB_ETH_HashTableGet(ETH_MODULE_ID index)
{
return (uint32_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFiltersHTSet(ETH_MODULE_ID index, uint64_t htable)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsHashTable(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchSet(ETH_MODULE_ID index, uint64_t patternMatchMaskValue)
{
}
PLIB_INLINE_API uint64_t _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchGet(ETH_MODULE_ID index)
{
return (uint64_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchChecksumSet(ETH_MODULE_ID index, uint16_t PatternMatchChecksumValue)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchChecksumGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchOffsetSet(ETH_MODULE_ID index, uint16_t PatternMatchOffsetValue)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchOffsetGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchModeSet(ETH_MODULE_ID index, ETH_PATTERN_MATCH_MODE modeSel)
{
}
PLIB_INLINE_API ETH_PATTERN_MATCH_MODE _PLIB_UNSUPPORTED PLIB_ETH_PatternMatchModeGet(ETH_MODULE_ID index)
{
return (ETH_PATTERN_MATCH_MODE)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFiltersPMClr(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsPatternMatch(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFiltersPMSet(ETH_MODULE_ID index, ETH_PMATCH_MODE mode, uint64_t matchMask, uint32_t matchOffs, uint32_t matchChecksum)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsRxFiltersPMSet(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ReceiveFilterEnable(ETH_MODULE_ID index, ETH_RECEIVE_FILTER filter)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ReceiveFilterDisable(ETH_MODULE_ID index, ETH_RECEIVE_FILTER filter)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_ReceiveFilterIsEnable(ETH_MODULE_ID index, ETH_RECEIVE_FILTER filter)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFiltersSet(ETH_MODULE_ID index, ETH_RX_FILTERS rxFilters)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFiltersClr(ETH_MODULE_ID index, ETH_RX_FILTERS rxFilters)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFiltersWrite(ETH_MODULE_ID index, ETH_RX_FILTERS rxFilters)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsReceiveFilters(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFullWmarkSet(ETH_MODULE_ID index, uint8_t watermarkValue)
{
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_RxFullWmarkGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxEmptyWmarkSet(ETH_MODULE_ID index, uint8_t watermarkValue)
{
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_RxEmptyWmarkGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsReceiveWmarks(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_InterruptSourceEnable(ETH_MODULE_ID index, ETH_INTERRUPT_SOURCES intmask)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_InterruptSourceDisable(ETH_MODULE_ID index, ETH_INTERRUPT_SOURCES intmask)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_InterruptSourceIsEnabled(ETH_MODULE_ID index, ETH_INTERRUPT_SOURCES intmask)
{
return (bool)0;
}
PLIB_INLINE_API ETH_INTERRUPT_SOURCES _PLIB_UNSUPPORTED PLIB_ETH_InterruptSourcesGet(ETH_MODULE_ID index)
{
return (ETH_INTERRUPT_SOURCES)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_InterruptSet(ETH_MODULE_ID index, ETH_INTERRUPT_SOURCES intmask)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_InterruptClear(ETH_MODULE_ID index, ETH_INTERRUPT_SOURCES intmask)
{
}
PLIB_INLINE_API ETH_INTERRUPT_SOURCES _PLIB_UNSUPPORTED PLIB_ETH_InterruptsGet(ETH_MODULE_ID index)
{
return (ETH_INTERRUPT_SOURCES)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_InterruptStatusGet(ETH_MODULE_ID index, ETH_INTERRUPT_SOURCES intmask)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_EventsEnableSet(ETH_MODULE_ID index, PLIB_ETH_EVENTS eEvents)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_EventsEnableClr(ETH_MODULE_ID index, PLIB_ETH_EVENTS eEvents)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_EventsEnableWrite(ETH_MODULE_ID index, PLIB_ETH_EVENTS eEvents)
{
}
PLIB_INLINE_API PLIB_ETH_EVENTS _PLIB_UNSUPPORTED PLIB_ETH_EventsEnableGet(ETH_MODULE_ID index)
{
return (PLIB_ETH_EVENTS)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_EventsClr(ETH_MODULE_ID index, PLIB_ETH_EVENTS eEvents)
{
}
PLIB_INLINE_API PLIB_ETH_EVENTS _PLIB_UNSUPPORTED PLIB_ETH_EventsGet(ETH_MODULE_ID index)
{
return (PLIB_ETH_EVENTS)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsInterrupt(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_RxPacketCountGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_EthernetIsBusy(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_TransmitIsBusy(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_ReceiveIsBusy(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsEthernetControllerStatus(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxOverflowCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_RxOverflowCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsReceiveOverflowCount(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FramesTxdOkCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_FramesTxdOkCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsFramesTransmittedOK(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_SingleCollisionCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_SingleCollisionCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MultipleCollisionCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_MultipleCollisionCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsCollisionCounts(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FramesRxdOkCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_FramesRxdOkCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsFramexReceivedOK(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FCSErrorCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_FCSErrorCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsFCSErrorCount(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_AlignErrorCountClear(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_AlignErrorCountGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsAlignmentErrorCount(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_SimResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_SimResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_SimResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MCSRxResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MCSRxResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MCSRxResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFuncResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxFuncResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_RxFuncResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MCSTxResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MCSTxResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MCSTxResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxFuncResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxFuncResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_TxFuncResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMAC_Resets(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_LoopbackEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_LoopbackDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_LoopbackIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxPauseEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TxPauseDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_TxPauseIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxPauseEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RxPauseDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_RxPauseIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PassAllEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PassAllDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_PassAllIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ReceiveEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ReceiveDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_ReceiveIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ExcessDeferEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ExcessDeferDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_ExcessDeferIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_BackPresNoBackoffEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_BackPresNoBackoffDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_BackPresNoBackoffIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_NoBackoffEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_NoBackoffDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_NoBackoffIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_LongPreambleEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_LongPreambleDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_LongPreambleIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PurePreambleEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PurePreambleDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_PurePreambleIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API ETH_AUTOPAD_OPTION _PLIB_UNSUPPORTED PLIB_ETH_AutoDetectPadGet(ETH_MODULE_ID index)
{
return (ETH_AUTOPAD_OPTION)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_AutoDetectPadSet(ETH_MODULE_ID index, ETH_AUTOPAD_OPTION option)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_AutoDetectPadClear(ETH_MODULE_ID index, ETH_AUTOPAD_OPTION option)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_CRCEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_CRCDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_CRCIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_DelayedCRCEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_DelayedCRCDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_DelayedCRCIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_HugeFrameEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_HugeFrameDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_HugeFrameIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FrameLengthCheckEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FrameLengthCheckDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_FrameLengthCheckIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FullDuplexEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_FullDuplexDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_FullDuplexIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMAC_Configuration(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_BackToBackIPGGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_BackToBackIPGSet(ETH_MODULE_ID index, uint8_t backToBackIPGValue)
{
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_NonBackToBackIPG1Get(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_NonBackToBackIPG1Set(ETH_MODULE_ID index, uint8_t nonBackToBackIPGValue)
{
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_NonBackToBackIPG2Get(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_NonBackToBackIPG2Set(ETH_MODULE_ID index, uint8_t nonBackToBackIPGValue)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsInterPacketGaps(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_CollisionWindowGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_CollisionWindowSet(ETH_MODULE_ID index, uint8_t collisionWindowValue)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsCollisionWindow(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_ReTxMaxGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ReTxMaxSet(ETH_MODULE_ID index, uint16_t retransmitMax)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsRetransmissionMaximum(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_MaxFrameLengthGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MaxFrameLengthSet(ETH_MODULE_ID index, uint16_t MaxFrameLength)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MACSetMaxFrame(ETH_MODULE_ID index, uint16_t maxFrmSz)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMaxFrameLength(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RMIIResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RMIIResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_RMIIResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API ETH_RMII_SPEED _PLIB_UNSUPPORTED PLIB_ETH_RMIISpeedGet(ETH_MODULE_ID index)
{
return (ETH_RMII_SPEED)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RMIISpeedSet(ETH_MODULE_ID index, ETH_RMII_SPEED RMIISpeed)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsRMII_Support(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TestBackPressEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TestBackPressDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_TestBackPressIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TestPauseEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_TestPauseDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_TestPauseIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ShortcutQuantaEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_ShortcutQuantaDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_ShortcutQuantaIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMAC_Testing(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMResetEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMResetDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIMResetIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API ETH_MIIM_CLK _PLIB_UNSUPPORTED PLIB_ETH_MIIMClockGet(ETH_MODULE_ID index)
{
return (ETH_MIIM_CLK)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMClockSet(ETH_MODULE_ID index, ETH_MIIM_CLK MIIMClock)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMNoPreEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMNoPreDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIMNoPreIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMScanIncrEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMScanIncrDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIMScanIncrIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMIIM_Config(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMScanModeEnable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMScanModeDisable(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIMScanModeIsEnabled(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMIIMScanMode(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMReadStart(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMWriteStart(ETH_MODULE_ID index)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMIIMReadWrite(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_PHYAddressGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_PHYAddressSet(ETH_MODULE_ID index, uint8_t phyAddr)
{
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_RegisterAddressGet(ETH_MODULE_ID index)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_RegisterAddressSet(ETH_MODULE_ID index, uint8_t regAddr)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMIIMAddresses(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MIIMWriteDataSet(ETH_MODULE_ID index, uint16_t writeData)
{
}
PLIB_INLINE_API uint16_t _PLIB_UNSUPPORTED PLIB_ETH_MIIMReadDataGet(ETH_MODULE_ID index)
{
return (uint16_t)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMIIWriteReadData(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_LinkHasFailed(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_DataNotValid(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIMIsScanning(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool _PLIB_UNSUPPORTED PLIB_ETH_MIIMIsBusy(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API bool PLIB_ETH_ExistsMIIM_Indicators(ETH_MODULE_ID index)
{
return (bool)0;
}
PLIB_INLINE_API uint8_t _PLIB_UNSUPPORTED PLIB_ETH_StationAddressGet(ETH_MODULE_ID index, uint8_t which)
{
return (uint8_t)0;
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_StationAddressSet(ETH_MODULE_ID index, uint8_t which, uint8_t stationAddress)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MACSetAddress(ETH_MODULE_ID index, uint8_t* bAddress)
{
}
PLIB_INLINE_API void _PLIB_UNSUPPORTED PLIB_ETH_MACGetAddress(ETH_MODULE_ID index, uint8_t* bAddress)
{
}
PLIB_INLINE_API bool PLIB_ETH_ExistsStationAddress(ETH_MODULE_ID index)
{
return (bool)0;
}
#endif
| [
"jared@mytrexinc.com"
] | jared@mytrexinc.com |
d3e778ee3e85634511a5fd3bf3f1ebb443199e75 | d0dc556f8b1d18ecbadef182bafd97b632dd3104 | /common/esp-idf-lib/components/ads111x/ads111x.c | 0919600ec7269ef5883c40d4dccf36ba36ee4fad | [
"BSD-2-Clause",
"MIT"
] | permissive | PacktPublishing/Internet-of-Things-with-ESP32 | da3f2c57e2bd871b134b22841fd275c51f88d487 | 3ada8b905e53961940511636991a839059de7cd1 | refs/heads/main | 2023-02-08T13:58:32.585403 | 2023-01-30T10:03:23 | 2023-01-30T10:03:23 | 315,618,086 | 114 | 36 | null | null | null | null | UTF-8 | C | false | false | 8,016 | c | /**
* @file ads111x.c
*
* ESP-IDF driver for ADS1113/ADS1114/ADS1115, ADS1013/ADS1014/ADS1015 I2C ADC
*
* Ported from esp-open-rtos
*
* Copyright (C) 2016, 2018 Ruslan V. Uss <unclerus@gmail.com>
* Copyright (C) 2020 Lucio Tarantino (https://github.com/dianlight)
*
* BSD Licensed as described in the file LICENSE
*/
#include <esp_log.h>
#include <esp_idf_lib_helpers.h>
#include "ads111x.h"
#define I2C_FREQ_HZ 1000000 // Max 1MHz for esp32
#define REG_CONVERSION 0
#define REG_CONFIG 1
#define REG_THRESH_L 2
#define REG_THRESH_H 3
#define COMP_QUE_OFFSET 1
#define COMP_QUE_MASK 0x03
#define COMP_LAT_OFFSET 2
#define COMP_LAT_MASK 0x01
#define COMP_POL_OFFSET 3
#define COMP_POL_MASK 0x01
#define COMP_MODE_OFFSET 4
#define COMP_MODE_MASK 0x01
#define DR_OFFSET 5
#define DR_MASK 0x07
#define MODE_OFFSET 8
#define MODE_MASK 0x01
#define PGA_OFFSET 9
#define PGA_MASK 0x07
#define MUX_OFFSET 12
#define MUX_MASK 0x07
#define OS_OFFSET 15
#define OS_MASK 0x01
#define CHECK(x) do { esp_err_t __; if ((__ = x) != ESP_OK) return __; } while (0)
#define CHECK_ARG(VAL) do { if (!(VAL)) return ESP_ERR_INVALID_ARG; } while (0)
static const char *TAG = "ADS111x";
const float ads111x_gain_values[] = {
[ADS111X_GAIN_6V144] = 6.144,
[ADS111X_GAIN_4V096] = 4.096,
[ADS111X_GAIN_2V048] = 2.048,
[ADS111X_GAIN_1V024] = 1.024,
[ADS111X_GAIN_0V512] = 0.512,
[ADS111X_GAIN_0V256] = 0.256,
[ADS111X_GAIN_0V256_2] = 0.256,
[ADS111X_GAIN_0V256_3] = 0.256
};
static esp_err_t read_reg(i2c_dev_t *dev, uint8_t reg, uint16_t *val)
{
uint8_t buf[2];
esp_err_t res;
if ((res = i2c_dev_read_reg(dev, reg, buf, 2)) != ESP_OK)
{
ESP_LOGE(TAG, "Could not read from register 0x%02x", reg);
return res;
}
*val = (buf[0] << 8) | buf[1];
return ESP_OK;
}
static esp_err_t write_reg(i2c_dev_t *dev, uint8_t reg, uint16_t val)
{
uint8_t buf[2] = { val >> 8, val };
esp_err_t res;
if ((res = i2c_dev_write_reg(dev, reg, buf, 2)) != ESP_OK)
{
ESP_LOGE(TAG, "Could not write 0x%04x to register 0x%02x", val, reg);
return res;
}
return ESP_OK;
}
static esp_err_t read_conf_bits(i2c_dev_t *dev, uint8_t offs, uint16_t mask,
uint16_t *bits)
{
CHECK_ARG(dev);
uint16_t val;
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, read_reg(dev, REG_CONFIG, &val));
I2C_DEV_GIVE_MUTEX(dev);
ESP_LOGD(TAG, "Got config value: 0x%04x", val);
*bits = (val >> offs) & mask;
return ESP_OK;
}
static esp_err_t write_conf_bits(i2c_dev_t *dev, uint16_t val, uint8_t offs,
uint16_t mask)
{
CHECK_ARG(dev);
uint16_t old;
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, read_reg(dev, REG_CONFIG, &old));
I2C_DEV_CHECK(dev, write_reg(dev, REG_CONFIG, (old & ~(mask << offs)) | (val << offs)));
I2C_DEV_GIVE_MUTEX(dev);
return ESP_OK;
}
#define READ_CONFIG(OFFS, MASK, VAR) do { \
CHECK_ARG(VAR); \
uint16_t bits; \
CHECK(read_conf_bits(dev, OFFS, MASK, &bits)); \
*VAR = bits; \
return ESP_OK; \
} while(0)
///////////////////////////////////////////////////////////////////////////////
esp_err_t ads111x_init_desc(i2c_dev_t *dev, uint8_t addr, i2c_port_t port,
gpio_num_t sda_gpio, gpio_num_t scl_gpio)
{
CHECK_ARG(dev);
if (addr != ADS111X_ADDR_GND && addr != ADS111X_ADDR_VCC
&& addr != ADS111X_ADDR_SDA && addr != ADS111X_ADDR_SCL)
{
ESP_LOGE(TAG, "Invalid I2C address");
return ESP_ERR_INVALID_ARG;
}
dev->port = port;
dev->addr = addr;
dev->cfg.sda_io_num = sda_gpio;
dev->cfg.scl_io_num = scl_gpio;
#if HELPER_TARGET_IS_ESP32
dev->cfg.master.clk_speed = I2C_FREQ_HZ;
#endif
return i2c_dev_create_mutex(dev);
}
esp_err_t ads111x_free_desc(i2c_dev_t *dev)
{
CHECK_ARG(dev);
return i2c_dev_delete_mutex(dev);
}
esp_err_t ads111x_is_busy(i2c_dev_t *dev, bool *busy)
{
READ_CONFIG(OS_OFFSET, OS_MASK, busy);
}
esp_err_t ads111x_start_conversion(i2c_dev_t *dev)
{
return write_conf_bits(dev, 1, OS_OFFSET, OS_MASK);
}
esp_err_t ads111x_get_value(i2c_dev_t *dev, int16_t *value)
{
CHECK_ARG(dev && value);
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, read_reg(dev, REG_CONVERSION, (uint16_t *)value));
I2C_DEV_GIVE_MUTEX(dev);
return ESP_OK;
}
esp_err_t ads101x_get_value(i2c_dev_t *dev, int16_t *value)
{
CHECK_ARG(dev && value);
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, read_reg(dev, REG_CONVERSION, (uint16_t *)value));
I2C_DEV_GIVE_MUTEX(dev);
*value = *value >> 4;
if (*value > 0x07FF)
{
// negative number - extend the sign to 16th bit
*value |= 0xF000;
}
return ESP_OK;
}
esp_err_t ads111x_get_gain(i2c_dev_t *dev, ads111x_gain_t *gain)
{
READ_CONFIG(PGA_OFFSET, PGA_MASK, gain);
}
esp_err_t ads111x_set_gain(i2c_dev_t *dev, ads111x_gain_t gain)
{
return write_conf_bits(dev, gain, PGA_OFFSET, PGA_MASK);
}
esp_err_t ads111x_get_input_mux(i2c_dev_t *dev, ads111x_mux_t *mux)
{
READ_CONFIG(MUX_OFFSET, MUX_MASK, mux);
}
esp_err_t ads111x_set_input_mux(i2c_dev_t *dev, ads111x_mux_t mux)
{
return write_conf_bits(dev, mux, MUX_OFFSET, MUX_MASK);
}
esp_err_t ads111x_get_mode(i2c_dev_t *dev, ads111x_mode_t *mode)
{
READ_CONFIG(MODE_OFFSET, MODE_MASK, mode);
}
esp_err_t ads111x_set_mode(i2c_dev_t *dev, ads111x_mode_t mode)
{
return write_conf_bits(dev, mode, MODE_OFFSET, MODE_MASK);
}
esp_err_t ads111x_get_data_rate(i2c_dev_t *dev, ads111x_data_rate_t *rate)
{
READ_CONFIG(DR_OFFSET, DR_MASK, rate);
}
esp_err_t ads111x_set_data_rate(i2c_dev_t *dev, ads111x_data_rate_t rate)
{
return write_conf_bits(dev, rate, DR_OFFSET, DR_MASK);
}
esp_err_t ads111x_get_comp_mode(i2c_dev_t *dev, ads111x_comp_mode_t *mode)
{
READ_CONFIG(COMP_MODE_OFFSET, COMP_MODE_MASK, mode);
}
esp_err_t ads111x_set_comp_mode(i2c_dev_t *dev, ads111x_comp_mode_t mode)
{
return write_conf_bits(dev, mode, COMP_MODE_OFFSET, COMP_MODE_MASK);
}
esp_err_t ads111x_get_comp_polarity(i2c_dev_t *dev, ads111x_comp_polarity_t *polarity)
{
READ_CONFIG(COMP_POL_OFFSET, COMP_POL_MASK, polarity);
}
esp_err_t ads111x_set_comp_polarity(i2c_dev_t *dev, ads111x_comp_polarity_t polarity)
{
return write_conf_bits(dev, polarity, COMP_POL_OFFSET, COMP_POL_MASK);
}
esp_err_t ads111x_get_comp_latch(i2c_dev_t *dev, ads111x_comp_latch_t *latch)
{
READ_CONFIG(COMP_LAT_OFFSET, COMP_LAT_MASK, latch);
}
esp_err_t ads111x_set_comp_latch(i2c_dev_t *dev, ads111x_comp_latch_t latch)
{
return write_conf_bits(dev, latch, COMP_LAT_OFFSET, COMP_LAT_MASK);
}
esp_err_t ads111x_get_comp_queue(i2c_dev_t *dev, ads111x_comp_queue_t *queue)
{
READ_CONFIG(COMP_QUE_OFFSET, COMP_QUE_MASK, queue);
}
esp_err_t ads111x_set_comp_queue(i2c_dev_t *dev, ads111x_comp_queue_t queue)
{
return write_conf_bits(dev, queue, COMP_QUE_OFFSET, COMP_QUE_MASK);
}
esp_err_t ads111x_get_comp_low_thresh(i2c_dev_t *dev, int16_t *th)
{
CHECK_ARG(dev && th);
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, read_reg(dev, REG_THRESH_L, (uint16_t *)th));
I2C_DEV_GIVE_MUTEX(dev);
return ESP_OK;
}
esp_err_t ads111x_set_comp_low_thresh(i2c_dev_t *dev, int16_t th)
{
CHECK_ARG(dev);
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, write_reg(dev, REG_THRESH_L, th));
I2C_DEV_GIVE_MUTEX(dev);
return ESP_OK;
}
esp_err_t ads111x_get_comp_high_thresh(i2c_dev_t *dev, int16_t *th)
{
CHECK_ARG(dev && th);
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, read_reg(dev, REG_THRESH_H, (uint16_t *)th));
I2C_DEV_GIVE_MUTEX(dev);
return ESP_OK;
}
esp_err_t ads111x_set_comp_high_thresh(i2c_dev_t *dev, int16_t th)
{
CHECK_ARG(dev);
I2C_DEV_TAKE_MUTEX(dev);
I2C_DEV_CHECK(dev, write_reg(dev, REG_THRESH_H, th));
I2C_DEV_GIVE_MUTEX(dev);
return ESP_OK;
}
| [
"ozan.oner@gmail.com"
] | ozan.oner@gmail.com |
095e0f445c755d426964e4a109e13e8f112ba480 | 2495db693562415afcd03588383bca0855ee48b3 | /sdk/boards/lpcxpresso54608/usb_examples/usb_device_msc_ramdisk/bm/disk.c | 623764d736b8dfc746a899afa82284a14f5aaeab | [] | no_license | Goodjamp/HIDVideoStream | 2653291606bf6cb3a7f135c682d77bee10392df7 | 89aa109f875ba5a931b3d04429463876f2be8c77 | refs/heads/master | 2021-09-29T14:48:46.727591 | 2018-11-08T16:15:35 | 2018-11-08T16:15:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 16,441 | c | /*
* The Clear BSD License
* Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
* Copyright 2016 - 2017 NXP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted (subject to the limitations in the disclaimer below) provided
* that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "usb_device_config.h"
#include "usb.h"
#include "usb_device.h"
#include "usb_device_class.h"
#include "usb_device_msc.h"
#include "usb_device_ch9.h"
#include "usb_device_descriptor.h"
#include "disk.h"
#include "fsl_device_registers.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_debug_console.h"
#include <stdio.h>
#include <stdlib.h>
#if (defined(FSL_FEATURE_SOC_SYSMPU_COUNT) && (FSL_FEATURE_SOC_SYSMPU_COUNT > 0U))
#include "fsl_sysmpu.h"
#endif /* FSL_FEATURE_SOC_SYSMPU_COUNT */
#if defined(USB_DEVICE_CONFIG_EHCI) && (USB_DEVICE_CONFIG_EHCI > 0)
#include "usb_phy.h"
#endif
#include "pin_mux.h"
#include <stdbool.h>
#include "fsl_power.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Prototypes
******************************************************************************/
void BOARD_InitHardware(void);
void USB_DeviceClockInit(void);
void USB_DeviceIsrEnable(void);
#if USB_DEVICE_CONFIG_USE_TASK
void USB_DeviceTaskFn(void *deviceHandle);
#endif
/*******************************************************************************
* Variables
******************************************************************************/
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
usb_device_inquiry_data_fromat_struct_t g_InquiryInfo = {
(USB_DEVICE_MSC_UFI_PERIPHERAL_QUALIFIER << USB_DEVICE_MSC_UFI_PERIPHERAL_QUALIFIER_SHIFT) |
USB_DEVICE_MSC_UFI_PERIPHERAL_DEVICE_TYPE,
(uint8_t)(USB_DEVICE_MSC_UFI_REMOVABLE_MEDIUM_BIT << USB_DEVICE_MSC_UFI_REMOVABLE_MEDIUM_BIT_SHIFT),
USB_DEVICE_MSC_UFI_VERSIONS,
0x02,
USB_DEVICE_MSC_UFI_ADDITIONAL_LENGTH,
{0x00, 0x00, 0x00},
{'N', 'X', 'P', ' ', 'S', 'E', 'M', 'I'},
{'N', 'X', 'P', ' ', 'M', 'A', 'S', 'S', ' ', 'S', 'T', 'O', 'R', 'A', 'G', 'E'},
{'0', '0', '0', '1'}};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
usb_device_mode_parameters_header_struct_t g_ModeParametersHeader = {
/*refer to ufi spec mode parameter header*/
0x0000, /*!< Mode Data Length*/
0x00, /*!<Default medium type (current mounted medium type)*/
0x00, /*!MODE SENSE command, a Write Protected bit of zero indicates the medium is write enabled*/
{0x00, 0x00, 0x00, 0x00} /*!<This bit should be set to zero*/
};
/* Data structure of msc device, store the information ,such as class handle */
USB_DMA_NONINIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE) static uint8_t s_StorageDisk[DISK_SIZE_NORMAL];
usb_msc_struct_t g_msc;
/*******************************************************************************
* Code
******************************************************************************/
#if (defined(USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS > 0U))
void USB0_IRQHandler(void)
{
USB_DeviceLpcIp3511IsrFunction(g_msc.deviceHandle);
}
#endif
#if (defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U))
void USB1_IRQHandler(void)
{
USB_DeviceLpcIp3511IsrFunction(g_msc.deviceHandle);
}
#endif
void USB_DeviceClockInit(void)
{
#if defined(USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS > 0U)
/* enable USB IP clock */
CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbSrcFro, CLOCK_GetFroHfFreq());
#if defined(FSL_FEATURE_USB_USB_RAM) && (FSL_FEATURE_USB_USB_RAM)
for (int i = 0; i < FSL_FEATURE_USB_USB_RAM; i++)
{
((uint8_t *)FSL_FEATURE_USB_USB_RAM_BASE_ADDRESS)[i] = 0x00U;
}
#endif
#endif
#if defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U)
/* enable USB IP clock */
CLOCK_EnableUsbhs0DeviceClock(kCLOCK_UsbSrcUsbPll, 0U);
#if defined(FSL_FEATURE_USBHSD_USB_RAM) && (FSL_FEATURE_USBHSD_USB_RAM)
for (int i = 0; i < FSL_FEATURE_USBHSD_USB_RAM; i++)
{
((uint8_t *)FSL_FEATURE_USBHSD_USB_RAM_BASE_ADDRESS)[i] = 0x00U;
}
#endif
#endif
}
void USB_DeviceIsrEnable(void)
{
uint8_t irqNumber;
#if defined(USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS > 0U)
uint8_t usbDeviceIP3511Irq[] = USB_IRQS;
irqNumber = usbDeviceIP3511Irq[CONTROLLER_ID - kUSB_ControllerLpcIp3511Fs0];
#endif
#if defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U)
uint8_t usbDeviceIP3511Irq[] = USBHSD_IRQS;
irqNumber = usbDeviceIP3511Irq[CONTROLLER_ID - kUSB_ControllerLpcIp3511Hs0];
#endif
/* Install isr, set priority, and enable IRQ. */
#if defined(__GIC_PRIO_BITS)
GIC_SetPriority((IRQn_Type)irqNumber, USB_DEVICE_INTERRUPT_PRIORITY);
#else
NVIC_SetPriority((IRQn_Type)irqNumber, USB_DEVICE_INTERRUPT_PRIORITY);
#endif
EnableIRQ((IRQn_Type)irqNumber);
}
#if USB_DEVICE_CONFIG_USE_TASK
void USB_DeviceTaskFn(void *deviceHandle)
{
#if defined(USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS > 0U)
USB_DeviceLpcIp3511TaskFunction(deviceHandle);
#endif
#if defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U)
USB_DeviceLpcIp3511TaskFunction(deviceHandle);
#endif
}
#endif
/*!
* @brief device msc callback function.
*
* This function handle the disk class specified event.
* @param handle The USB class handle.
* @param event The USB device event type.
* @param param The parameter of the class specific event.
* @return kStatus_USB_Success or error.
*/
usb_status_t USB_DeviceMscCallback(class_handle_t handle, uint32_t event, void *param)
{
usb_status_t error = kStatus_USB_Error;
usb_device_lba_information_struct_t *lbaInformationStructure;
usb_device_lba_app_struct_t *lbaData;
usb_device_ufi_app_struct_t *ufi;
switch (event)
{
case kUSB_DeviceMscEventReadResponse:
lbaData = (usb_device_lba_app_struct_t *)param;
break;
case kUSB_DeviceMscEventWriteResponse:
lbaData = (usb_device_lba_app_struct_t *)param;
break;
case kUSB_DeviceMscEventWriteRequest:
lbaData = (usb_device_lba_app_struct_t *)param;
/*offset is the write start address get from write command, refer to class driver*/
lbaData->buffer = g_msc.storageDisk + lbaData->offset * LENGTH_OF_EACH_LBA;
break;
case kUSB_DeviceMscEventReadRequest:
lbaData = (usb_device_lba_app_struct_t *)param;
/*offset is the read start address get from read command, refer to class driver*/
lbaData->buffer = g_msc.storageDisk + lbaData->offset * LENGTH_OF_EACH_LBA;
break;
case kUSB_DeviceMscEventGetLbaInformation:
lbaInformationStructure = (usb_device_lba_information_struct_t *)param;
lbaInformationStructure->lengthOfEachLba = LENGTH_OF_EACH_LBA;
lbaInformationStructure->totalLbaNumberSupports = TOTAL_LOGICAL_ADDRESS_BLOCKS_NORMAL;
lbaInformationStructure->logicalUnitNumberSupported = LOGICAL_UNIT_SUPPORTED;
lbaInformationStructure->bulkInBufferSize = DISK_SIZE_NORMAL;
lbaInformationStructure->bulkOutBufferSize = DISK_SIZE_NORMAL;
break;
case kUSB_DeviceMscEventTestUnitReady:
/*change the test unit ready command's sense data if need, be careful to modify*/
ufi = (usb_device_ufi_app_struct_t *)param;
break;
case kUSB_DeviceMscEventInquiry:
ufi = (usb_device_ufi_app_struct_t *)param;
ufi->size = sizeof(usb_device_inquiry_data_fromat_struct_t);
ufi->buffer = (uint8_t *)&g_InquiryInfo;
break;
case kUSB_DeviceMscEventModeSense:
ufi = (usb_device_ufi_app_struct_t *)param;
ufi->size = sizeof(usb_device_mode_parameters_header_struct_t);
ufi->buffer = (uint8_t *)&g_ModeParametersHeader;
break;
case kUSB_DeviceMscEventModeSelect:
break;
case kUSB_DeviceMscEventModeSelectResponse:
ufi = (usb_device_ufi_app_struct_t *)param;
break;
case kUSB_DeviceMscEventFormatComplete:
break;
case kUSB_DeviceMscEventRemovalRequest:
break;
default:
break;
}
return error;
}
/*!
* @brief device callback function.
*
* This function handle the usb standard event. more information, please refer to usb spec chapter 9.
* @param handle The USB device handle.
* @param event The USB device event type.
* @param param The parameter of the device specific request.
* @return kStatus_USB_Success or error.
*/
usb_status_t USB_DeviceCallback(usb_device_handle handle, uint32_t event, void *param)
{
usb_status_t error = kStatus_USB_Error;
uint16_t *temp16 = (uint16_t *)param;
uint8_t *temp8 = (uint8_t *)param;
switch (event)
{
case kUSB_DeviceEventBusReset:
{
g_msc.attach = 0;
error = kStatus_USB_Success;
#if (defined(USB_DEVICE_CONFIG_EHCI) && (USB_DEVICE_CONFIG_EHCI > 0U)) || \
(defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U))
/* Get USB speed to configure the device, including max packet size and interval of the endpoints. */
if (kStatus_USB_Success == USB_DeviceClassGetSpeed(CONTROLLER_ID, &g_msc.speed))
{
USB_DeviceSetSpeed(handle, g_msc.speed);
}
#endif
}
break;
case kUSB_DeviceEventSetConfiguration:
if (param)
{
g_msc.attach = 1;
g_msc.currentConfiguration = *temp8;
}
break;
case kUSB_DeviceEventSetInterface:
if (g_msc.attach)
{
uint8_t interface = (uint8_t)((*temp16 & 0xFF00U) >> 0x08U);
uint8_t alternateSetting = (uint8_t)(*temp16 & 0x00FFU);
if (interface < USB_MSC_INTERFACE_COUNT)
{
g_msc.currentInterfaceAlternateSetting[interface] = alternateSetting;
}
}
break;
case kUSB_DeviceEventGetConfiguration:
if (param)
{
*temp8 = g_msc.currentConfiguration;
error = kStatus_USB_Success;
}
break;
case kUSB_DeviceEventGetInterface:
if (param)
{
uint8_t interface = (uint8_t)((*temp16 & 0xFF00U) >> 0x08U);
if (interface < USB_INTERFACE_COUNT)
{
*temp16 = (*temp16 & 0xFF00U) | g_msc.currentInterfaceAlternateSetting[interface];
error = kStatus_USB_Success;
}
else
{
error = kStatus_USB_InvalidRequest;
}
}
break;
case kUSB_DeviceEventGetDeviceDescriptor:
if (param)
{
error = USB_DeviceGetDeviceDescriptor(handle, (usb_device_get_device_descriptor_struct_t *)param);
}
break;
case kUSB_DeviceEventGetConfigurationDescriptor:
if (param)
{
error = USB_DeviceGetConfigurationDescriptor(handle,
(usb_device_get_configuration_descriptor_struct_t *)param);
}
break;
#if (defined(USB_DEVICE_CONFIG_CV_TEST) && (USB_DEVICE_CONFIG_CV_TEST > 0U))
case kUSB_DeviceEventGetDeviceQualifierDescriptor:
if (param)
{
/* Get Qualifier descriptor request */
error = USB_DeviceGetDeviceQualifierDescriptor(
handle, (usb_device_get_device_qualifier_descriptor_struct_t *)param);
}
break;
#endif
case kUSB_DeviceEventGetStringDescriptor:
if (param)
{
error = USB_DeviceGetStringDescriptor(handle, (usb_device_get_string_descriptor_struct_t *)param);
}
break;
default:
break;
}
return error;
}
/* USB device class information */
usb_device_class_config_struct_t msc_config[1] = {{
USB_DeviceMscCallback, 0, &g_UsbDeviceMscConfig,
}};
/* USB device class configuration information */
usb_device_class_config_list_struct_t msc_config_list = {
msc_config, USB_DeviceCallback, 1,
};
/*!
* @brief device application init function.
*
* This function init the usb stack and sdhc driver.
*
* @return None.
*/
void USB_DeviceApplicationInit(void)
{
USB_DeviceClockInit();
#if (defined(FSL_FEATURE_SOC_SYSMPU_COUNT) && (FSL_FEATURE_SOC_SYSMPU_COUNT > 0U))
SYSMPU_Enable(SYSMPU, 0);
#endif /* FSL_FEATURE_SOC_SYSMPU_COUNT */
g_msc.speed = USB_SPEED_FULL;
g_msc.attach = 0;
g_msc.mscHandle = (class_handle_t)NULL;
g_msc.deviceHandle = NULL;
g_msc.storageDisk = &s_StorageDisk[0];
if (kStatus_USB_Success != USB_DeviceClassInit(CONTROLLER_ID, &msc_config_list, &g_msc.deviceHandle))
{
usb_echo("USB device init failed\r\n");
}
else
{
usb_echo("USB device mass storage demo\r\n");
g_msc.mscHandle = msc_config_list.config->classHandle;
}
USB_DeviceIsrEnable();
USB_DeviceRun(g_msc.deviceHandle);
}
#if defined(__CC_ARM) || defined(__GNUC__)
int main(void)
#else
void main(void)
#endif
{
/* attach 12 MHz clock to FLEXCOMM0 (debug console) */
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
BOARD_InitPins();
BOARD_BootClockFROHF96M();
BOARD_InitDebugConsole();
#if (defined USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS)
POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY);
/* enable usb1 host clock */
CLOCK_EnableClock(kCLOCK_Usbh1);
*((uint32_t *)(USBHSH_BASE + 0x50)) |= USBHSH_PORTMODE_DEV_ENABLE_MASK;
/* enable usb1 host clock */
CLOCK_DisableClock(kCLOCK_Usbh1);
#endif
#if (defined USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS)
POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*< Turn on USB Phy */
CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);
CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);
/* enable usb0 host clock */
CLOCK_EnableClock(kCLOCK_Usbhsl0);
*((uint32_t *)(USBFSH_BASE + 0x5C)) |= USBFSH_PORTMODE_DEV_ENABLE_MASK;
/* disable usb0 host clock */
CLOCK_DisableClock(kCLOCK_Usbhsl0);
#endif
USB_DeviceApplicationInit();
while (1)
{
#if USB_DEVICE_CONFIG_USE_TASK
USB_DeviceTaskFn(g_msc.deviceHandle);
#endif
}
}
| [
"aleksandr.gerasimchuk@developex.org"
] | aleksandr.gerasimchuk@developex.org |
572e67945ec63f23f5881481ff0411433a970275 | f24a05833acfd0234eddb4aa478a1f3dc473436c | /micro_quadrotor/ANO_Settler_V2/ANO_Settler/ANO_CTRL.h | 038c8b94feb973b0f3df3e0a7dc97faa0b78ea08 | [] | no_license | MinhDinhTran/PID-Car-Control | ad22895b1904b715f77820cebfd6690c87005ddc | 87cd34eb3adae7e3b24145de1ea780854ec1c60d | refs/heads/master | 2021-12-24T05:58:25.074811 | 2016-09-03T03:23:03 | 2016-09-03T03:23:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,804 | h | #ifndef __ANO_CTRL_H
#define __ANO_CTRL_H
#include "stm32f10x.h"
#include "ANO_PID.h"
#include "filter.h"
/*========================================================================
飞机控制参数
=========================================================================*/
#define MAX_ZSPEED_UP 5000 //最大控制上升速度(mm/s)
#define MAX_ZSPEED_DN 3000 //最大控制下降速度(mm/s)
#define MAX_ROL_ANGLE 35 //最大控制横滚角误差(度)
#define MAX_PIT_ANGLE 35 //最大控制俯仰角误差(度)
#define MAX_YAW_ANGLE 180 //最大控制偏航角误差(度)
#define MAX_ROL_SPEED 300 //最大控制横滚角速率(度/s)
#define MAX_PIT_SPEED 300 //最大控制俯仰角速率(度/s)
#define MAX_YAW_SPEED 200 //最大控制偏航角速率(度/s)
#define MAX_THR 80 //最大控制油门(百分比)
// 防止积分饱和采用积分限幅的方式
#define CTRL_1_INTER_LIMIT 200 //角速度积分幅度限制
#define CTRL_2_INTER_LIMIT 5 //角度积分幅度限制
/*===========================================================================
===========================================================================*/
typedef struct
{
float exp_rol;
float exp_pit;
float exp_yaw;
float exp_yaw_i_comp;
float fb_rol;
float fb_pit;
float fb_yaw;
float out_rol;
float out_pit;
float out_yaw;
}_copter_ctrl_st;
void CTRL_Duty(float ch1,float ch2,float ch3,float ch4);
void CTRL_2_PID_Init(void);
void CTRL_1_PID_Init(void);
void CTRL_0_PID_Init(void);
void pid_init(void);
void motor_ctrl(float dT,s16 ct_val_rol,s16 ct_val_pit,s16 ct_val_yaw,s16 ct_val_thr);
extern s16 motor[];
extern _copter_ctrl_st ctrl_1;
extern _copter_ctrl_st ctrl_2;
#endif
| [
"815128388@qq.com"
] | 815128388@qq.com |
565f1f35c5dad564570503a0adc7eb0af606dba9 | 52c8ed39b32ccc7c0673278c1adea3638797c9ff | /src/arch/arm32/mach-rv1106/driver/clk-rv1106-mux.c | ba69990f1b5c4cc7a7a20b199b310ed070333491 | [
"MIT"
] | permissive | xboot/xboot | 0cab7b440b612aa0a4c366025598a53a7ec3adf1 | 6d6b93947b7fcb8c3924fedb0715c23877eedd5e | refs/heads/master | 2023-08-20T05:56:25.149388 | 2023-07-12T07:38:29 | 2023-07-12T07:38:29 | 471,539 | 765 | 296 | MIT | 2023-05-25T09:39:01 | 2010-01-14T08:25:12 | C | UTF-8 | C | false | false | 5,752 | c | /*
* driver/clk-rv1106-mux.c
*
* Copyright(c) 2007-2023 Jianjun Jiang <8192542@qq.com>
* Official site: http://xboot.org
* Mobile phone: +86-18665388956
* QQ: 8192542
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
#include <xboot.h>
#include <clk/clk.h>
struct clk_rv1106_mux_parent_t {
char * name;
int value;
};
struct clk_rv1106_mux_pdata_t {
virtual_addr_t virt;
struct clk_rv1106_mux_parent_t * parent;
int nparent;
int shift;
int width;
};
static void clk_rv1106_mux_set_parent(struct clk_t * clk, const char * pname)
{
struct clk_rv1106_mux_pdata_t * pdat = (struct clk_rv1106_mux_pdata_t *)clk->priv;
u32_t val;
int i;
for(i = 0; i < pdat->nparent; i++)
{
if(strcmp(pdat->parent[i].name, pname) == 0)
{
val = pdat->parent[i].value << pdat->shift;
val |= ((1 << pdat->width) - 1) << (pdat->shift + 16);
write32(pdat->virt, val);
break;
}
}
}
static const char * clk_rv1106_mux_get_parent(struct clk_t * clk)
{
struct clk_rv1106_mux_pdata_t * pdat = (struct clk_rv1106_mux_pdata_t *)clk->priv;
int val = (read32(pdat->virt) >> pdat->shift) & ((1 << pdat->width) - 1);
int i;
for(i = 0; i < pdat->nparent; i++)
{
if(pdat->parent[i].value == val)
return pdat->parent[i].name;
}
return NULL;
}
static void clk_rv1106_mux_set_enable(struct clk_t * clk, bool_t enable)
{
}
static bool_t clk_rv1106_mux_get_enable(struct clk_t * clk)
{
return TRUE;
}
static void clk_rv1106_mux_set_rate(struct clk_t * clk, u64_t prate, u64_t rate)
{
}
static u64_t clk_rv1106_mux_get_rate(struct clk_t * clk, u64_t prate)
{
return prate;
}
static struct device_t * clk_rv1106_mux_probe(struct driver_t * drv, struct dtnode_t * n)
{
struct clk_rv1106_mux_pdata_t * pdat;
struct clk_rv1106_mux_parent_t * parent;
struct clk_t * clk;
struct device_t * dev;
struct dtnode_t o;
virtual_addr_t virt = phys_to_virt(dt_read_address(n));
char * name = dt_read_string(n, "name", NULL);
int nparent = dt_read_array_length(n, "parent");
int shift = dt_read_int(n, "shift", -1);
int width = dt_read_int(n, "width", -1);
int i;
if(!name || (nparent <= 0) || (shift < 0) || (width <= 0))
return NULL;
if(search_clk(name))
return NULL;
pdat = malloc(sizeof(struct clk_rv1106_mux_pdata_t));
if(!pdat)
return NULL;
parent = malloc(sizeof(struct clk_rv1106_mux_parent_t) * nparent);
if(!parent)
{
free(pdat);
return NULL;
}
clk = malloc(sizeof(struct clk_t));
if(!clk)
{
free(pdat);
free(parent);
return NULL;
}
for(i = 0; i < nparent; i++)
{
dt_read_array_object(n, "parent", i, &o);
parent[i].name = strdup(dt_read_string(&o, "name", NULL));
parent[i].value = dt_read_int(&o, "value", 0);
}
pdat->virt = virt;
pdat->parent = parent;
pdat->nparent = nparent;
pdat->shift = shift;
pdat->width = width;
clk->name = strdup(name);
clk->count = 0;
clk->set_parent = clk_rv1106_mux_set_parent;
clk->get_parent = clk_rv1106_mux_get_parent;
clk->set_enable = clk_rv1106_mux_set_enable;
clk->get_enable = clk_rv1106_mux_get_enable;
clk->set_rate = clk_rv1106_mux_set_rate;
clk->get_rate = clk_rv1106_mux_get_rate;
clk->priv = pdat;
if(!(dev = register_clk(clk, drv)))
{
for(i = 0; i < pdat->nparent; i++)
free(pdat->parent[i].name);
free(pdat->parent);
free(clk->name);
free(clk->priv);
free(clk);
return NULL;
}
if(dt_read_object(n, "default", &o))
{
char * c = clk->name;
char * p;
u64_t r;
int e;
if((p = dt_read_string(&o, "parent", NULL)) && search_clk(p))
clk_set_parent(c, p);
if((r = (u64_t)dt_read_long(&o, "rate", 0)) > 0)
clk_set_rate(c, r);
if((e = dt_read_bool(&o, "enable", -1)) != -1)
{
if(e > 0)
clk_enable(c);
else
clk_disable(c);
}
}
return dev;
}
static void clk_rv1106_mux_remove(struct device_t * dev)
{
struct clk_t * clk = (struct clk_t *)dev->priv;
struct clk_rv1106_mux_pdata_t * pdat = (struct clk_rv1106_mux_pdata_t *)clk->priv;
int i;
if(clk)
{
unregister_clk(clk);
for(i = 0; i < pdat->nparent; i++)
free(pdat->parent[i].name);
free(pdat->parent);
free(clk->name);
free(clk->priv);
free(clk);
}
}
static void clk_rv1106_mux_suspend(struct device_t * dev)
{
}
static void clk_rv1106_mux_resume(struct device_t * dev)
{
}
static struct driver_t clk_rv1106_mux = {
.name = "clk-rv1106-mux",
.probe = clk_rv1106_mux_probe,
.remove = clk_rv1106_mux_remove,
.suspend = clk_rv1106_mux_suspend,
.resume = clk_rv1106_mux_resume,
};
static __init void clk_rv1106_mux_driver_init(void)
{
register_driver(&clk_rv1106_mux);
}
static __exit void clk_rv1106_mux_driver_exit(void)
{
unregister_driver(&clk_rv1106_mux);
}
driver_initcall(clk_rv1106_mux_driver_init);
driver_exitcall(clk_rv1106_mux_driver_exit);
| [
"8192542@qq.com"
] | 8192542@qq.com |
9ed70218c022f4baeeaa73a09216668f1676ece6 | f81da1e8b67c9f7012ae0b62eac6b2c9de3785f4 | /hk3.h | d6097ccf3809f719e26b1d2f14b2fb93f1aaa534 | [] | no_license | SimonWagenknecht/QR_SNW | 23ea62a2198a2a731b8abfc237802f55de5dae15 | cd63e663caecfea64ada31c23d7822a111b076a5 | refs/heads/master | 2020-03-19T13:46:16.208532 | 2018-06-29T11:13:26 | 2018-06-29T11:13:26 | 136,594,438 | 0 | 0 | null | null | null | null | ISO-8859-1 | C | false | false | 26,896 | h | /*------------------------------ Heizkreis 3 -------------------------------------------*/
const Pgrup hk3[] = {
//-------------------
{"_**:"," HEIZKREIS 1 "," ", P&hkd[HK3].raumname, ASCII_FORM, 0, P&vis, V1, 0, 0},
{"*01:"," VORLAUF TVHK1 "," C ", P&TVS[HK3], ANA_FORMP, 1, P&vis, V1, 0, 0},
{"*01:"," VORLAUF TVHK1 "," C ", P&TVS[HK3], ANA_FORMP, 0x81, P&kom, E1, FUEHLER, 0},
#if TRLBEG_HK3==1
{"*02:"," RUECKL TRHK1 "," C ", P&TRS[HK3], ANA_FORMP, 1, P&vis, V1, 0, 0},
{"*02:"," RUECKLAUFTRHK1 "," C ", P&TRS[HK3], ANA_FORMP, 0x81, P&kom, E1, FUEHLER, 0},
#endif
#if TRAUMK_HK3==1
{"*03:"," RAUM IST "," C ", P&TI[HK3], ANA_FORMP, 1, P&vis, V1, 0, 0},
{"*03:"," RAUM IST "," C ", P&TI[HK3], ANA_FORMP, 0x81, P&kom, E1, FUEHLER, 0},
#endif
// #if BEDARF_HK3==1 && BEDRAUM_HK3==1
// {"*04:"," RAUM-EXT. IST "," C ", P&hkd[HK3].tibed, S_INT, 1, P&vis, V1, 0, 0},
// #else
// {" 04:"," raum-ext. ist "," C ", P&hkd[HK3].tibed, S_INT, 1, P&hid2, V0, 0, 0},
// #endif
{" 06;"," SO/WI HK-EXTRA "," 1=JA ", P&hks[HK3].SoWiExtra, US_CHAR, 0, P&hid1, V1, 0, 0},
{" 07;"," Ta-WINTER [EIN]"," C ", P&hks[HK3].Tae, US_INT, 1, P&hid1, V1, 0, 0},
{" 08;"," Ta-SOMMER [AUS]"," C ", P&hks[HK3].Taa, US_INT, 1, P&hid1, V1, 0, 0},
{"*09;"," SOMMER ? "," ", P&hkd[HK3].sowi, JANEIN_FORM, 0, P&hid1, V1, 0, 0},
{" 10:"," STEIGUNG "," ", P&hks[HK3].Anst, US_INT, 2, P&vis, V1, 0, 0},
{" 11:"," NIVEAU "," C ", P&hks[HK3].Tvpa, US_INT, 1, P&vis, V1, 0, 0},
{" 12:"," VORLAUF MAX "," C ", P&hks[HK3].Tvma, US_INT, 1, P&vis, V1, 0, 0},
{" 13:"," VORLAUF MIN "," C ", P&hks[HK3].Tvmi, US_INT, 1, P&vis, V1, 0, 0},
// #if TRAUMK_HK3==1
// {" 14:"," RAUM SOLL "," C ", P&hks[HK3].Tiso, US_INT, 1, P&vis, V1, 0, 0},
// #else
// {" 14:"," raum soll "," C ", P&hks[HK3].Tiso, US_INT, 1, P&hid2, V0, 0, 0},
// #endif
//
// #if BEDARF_HK3==1 && BEDRAUM_HK3==1
// {"*14:"," RAUM-EXT. SOLL "," C ", P&hkd[HK3].tisobed, US_INT, 1, P&vis, V1, 0, 0},
// #else
// {" 14:"," raum-ext. soll "," C ", P&hkd[HK3].tisobed, US_INT, 1, P&hid2, V0, 0, 0},
// #endif
//
// #if TRAUMK_HK3==1
// {" 15:"," RAUM MIN "," C ", P&hks[HK3].Timi, US_INT, 1, P&vis, V1, 0, 0},
// #else
// {" 15:"," raum min "," C ", P&hks[HK3].Timi, US_INT, 1, P&hid2, V0, 0, 0},
// #endif
//
// #if TRAUMK_HK3==1 || (BEDARF_HK3==1 && BEDRAUM_HK3==1)
// {" ->;"," RAUM MIN HYST. "," K ", P&hks[HK3].TimiHyst, US_INT, 1, P&hid1, V0, 0, 0},
// #else
// {" ->;"," raum min hyst. "," K ", P&hks[HK3].TimiHyst, US_INT, 1, P&hid2, V0, 0, 0},
// #endif
//
// #if TRAUMK_HK3==1 || (BEDARF_HK3==1 && BEDRAUM_HK3==1)
// {" 16;"," KASK.SOLL MAX "," C ", P&hks[HK3].KaskBegr, US_INT, 1, P&hid1, V0, 0, 0},
// #else
// {" 16;"," kask.soll max "," C ", P&hks[HK3].KaskBegr, US_INT, 1, P&hid2, V0, 0, 0},
// #endif
//
// #if (BEDARF_HK3==1 && BEDRAUM_HK3==1) || TRAUMK_HK3==1
// {" 17:"," Xp-RAUM KASKADE"," ", P&hks[HK3].Kpk, US_INT, 2, P&vis, V1, 0, 0},
// #else
// {" 17;"," xp-raum kaskade"," ", P&hks[HK3].Kpk, US_INT, 2, P&hid2, V0, 0, 0},
// #endif
#if TRLBEG_HK3==1
{" 18:"," RUECKLAUF MAX "," C ", P&hks[HK3].Trma, US_INT, 1, P&vis, V1, 0, 0},
{" 19:"," Xp-RUECKL.BEGR."," ", P&hks[HK3].Kpr, US_INT, 2, P&vis, V1, 0, 0},
#endif
{"*20:"," VORLAUF BERECHN"," C ", P&hkd[HK3].tvsb, US_INT, 1, P&vis, V1, 0, 0},
{"*->:"," vorlauf ber.hkl"," C ", P&hkd[HK3].tvsb_hkl, US_INT, 1, P&hid2, V0, 0, 0},
//{"*->:"," korrektur adapt"," K ", P&hkd[HK3].adaptKorr, S_INT, 1, P&hid2, V0, 0, 0},
//{"*->:"," korrektur kaska"," K ", P&hkd[HK3].kaskaKorr, S_INT, 1, P&hid2, V0, 0, 0},
{"*->:"," korrektur wwvor"," K ", P&hkd[HK3].wwvorKorr, S_INT, 1, P&hid2, V0, 0, 0},
{" ->:"," vorlauf filt.zk"," s ", P&hks[HK3].Fzk, US_INT, 1, P&hid2, V0, 0, 0},
#if LEIBEGR_HK3 == 1
{"*21:"," ABSENK.LEI.BEGR"," K ", P&hkd[HK3].leistBegrAbsenk,US_INT,1, P&vis, V0, 0, 0},
#endif
#if FBH_HK3==1
{" 25;"," ESTR.-PR.START "," ", P&hks[HK3].StartAufheiz, DATE_FORM, 1, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG1 "," C ", P&hks[HK3].EstrichTemp[0], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG2 "," C ", P&hks[HK3].EstrichTemp[1], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG3 "," C ", P&hks[HK3].EstrichTemp[2], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG4 "," C ", P&hks[HK3].EstrichTemp[3], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG5 "," C ", P&hks[HK3].EstrichTemp[4], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG6 "," C ", P&hks[HK3].EstrichTemp[5], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG7 "," C ", P&hks[HK3].EstrichTemp[6], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG8 "," C ", P&hks[HK3].EstrichTemp[7], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG9 "," C ", P&hks[HK3].EstrichTemp[8], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG10"," C ", P&hks[HK3].EstrichTemp[9], US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG11"," C ", P&hks[HK3].EstrichTemp[10],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG12"," C ", P&hks[HK3].EstrichTemp[11],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG13"," C ", P&hks[HK3].EstrichTemp[12],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG14"," C ", P&hks[HK3].EstrichTemp[13],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG15"," C ", P&hks[HK3].EstrichTemp[14],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG16"," C ", P&hks[HK3].EstrichTemp[15],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG17"," C ", P&hks[HK3].EstrichTemp[16],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG18"," C ", P&hks[HK3].EstrichTemp[17],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG19"," C ", P&hks[HK3].EstrichTemp[18],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG20"," C ", P&hks[HK3].EstrichTemp[19],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG21"," C ", P&hks[HK3].EstrichTemp[20],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG22"," C ", P&hks[HK3].EstrichTemp[21],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG23"," C ", P&hks[HK3].EstrichTemp[22],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG24"," C ", P&hks[HK3].EstrichTemp[23],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG25"," C ", P&hks[HK3].EstrichTemp[24],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG26"," C ", P&hks[HK3].EstrichTemp[25],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG27"," C ", P&hks[HK3].EstrichTemp[26],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG28"," C ", P&hks[HK3].EstrichTemp[27],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG29"," C ", P&hks[HK3].EstrichTemp[28],US_CHAR, 0, P&hid1, V0, 0, 0},
{" ->;"," ESTR.TEMP.TAG30"," C ", P&hks[HK3].EstrichTemp[29],US_CHAR, 0, P&hid1, V0, 0, 0},
{"*26:"," ESTRICH-PROGR.?"," ", P&hkd[HK3].estrichProg,JANEIN_FORM, 0, P&vis, V0, STANDARD, 0},
{"*27;"," ESTRICH AKT.TAG"," ", P&hkd[HK3].estrichTag, US_CHAR, 0, P&hid1, V0, 0, 0},
{"*27;"," ESTR.AKT.SOLLT."," C ", P&hkd[HK3].estrichTemp, US_INT, 0, P&hid1, V0, 0, 0},
#endif
#if ( ANFORD > 0 || NTANZ > 0 || KEANZ > 0 )
{" 28:"," ANFORD.ANHEBUNG"," K ", P&hks[HK3].TvpAnh, US_INT, 1, P&vis, V1, 0, 0},
#endif
#if BEDARF_HK3==1
{" 29:"," VORRANG ZEITABS"," 1=JA ", P&hks[HK3].VorrangZeitabsenkung, US_CHAR, 0, P&vis, V1, 0, 0},
#endif
{" 30:"," ABSENK-BEGIN WO"," h:min ", P&abs_tab[HK3][0].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" 31:"," ABSENK-DAUER WO"," h ", P&abs_tab[HK3][0].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" 32:"," ABSENK-WERT WO"," K ", P&abs_tab[HK3][0].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 34:"," GANZE WOCHE SET"," 1=JA ", P&setwoche[HK3], US_CHAR, 0, P&vis, V0, 0, 0},
{" 35:"," ABSENK-BEGIN Mo"," h:min ", P&abs_tab[HK3][1].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER Mo"," h ", P&abs_tab[HK3][1].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT Mo"," K ", P&abs_tab[HK3][1].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 36:"," ABSENK-BEGIN Di"," h:min ", P&abs_tab[HK3][2].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER Di"," h ", P&abs_tab[HK3][2].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT Di"," K ", P&abs_tab[HK3][2].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 37:"," ABSENK-BEGIN Mi"," h:min ", P&abs_tab[HK3][3].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER Mi"," h ", P&abs_tab[HK3][3].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT Mi"," K ", P&abs_tab[HK3][3].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 38:"," ABSENK-BEGIN Do"," h:min ", P&abs_tab[HK3][4].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER Do"," h ", P&abs_tab[HK3][4].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT Do"," K ", P&abs_tab[HK3][4].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 39:"," ABSENK-BEGIN Fr"," h:min ", P&abs_tab[HK3][5].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER Fr"," h ", P&abs_tab[HK3][5].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT Fr"," K ", P&abs_tab[HK3][5].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 40:"," ABSENK-BEGIN Sa"," h:min ", P&abs_tab[HK3][6].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER Sa"," h ", P&abs_tab[HK3][6].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT Sa"," K ", P&abs_tab[HK3][6].abwert, US_INT, 1, P&vis, V0, 0, 0},
{" 41:"," ABSENK-BEGIN So"," h:min ", P&abs_tab[HK3][7].begin,ZEIT_FORM,0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-DAUER So"," h ", P&abs_tab[HK3][7].dauer, US_CHAR, 0, P&vis, V0, 0, 0},
{" ->:"," ABSENK-WERT So"," K ", P&abs_tab[HK3][7].abwert, US_INT, 1, P&vis, V0, 0, 0},
{"*->;"," ZEITABSENKPHASE"," ", P&abs_ram[HK3].absen, JANEIN_FORM, 0, P&hid1,V0, 0, 0},
//#####ulsch : Ferienautomatik #####
#if FER == 1
{" 42:"," FERIENAUTOMATIK"," JA=1 ", P&hks[HK3].FerienAutom, US_CHAR, 0, P&vis, V1, 0, 0},
{" 43:"," FER.ABSENK-WERT"," K ", P&hks[HK3].FerienAbsenk, US_INT, 1, P&vis, V1, 0, 0},
{"*->;"," ferienbetrieb ?"," ", P&hkd[HK3].absenFerien, JANEIN_FORM, 0, P&hid2, V0, 0, 0},
#endif
#if BEDARF_HK3==1
{" 44:"," BEDARFS-ABSENK."," K ", P&hks[HK3].Beabs, US_INT, 1, P&vis, V1, 0, 0},
#else
{" ->;"," bedarfs-absenk."," K ", P&hks[HK3].Beabs, US_INT, 1, P&hid2, V0, 0, 0},
#endif
#if BEDRAUM_HK3 == 1
{" 45:"," RAUMABSCHALTUNG"," JA=1 ", P&hks[HK3].AbschRaumanf, US_CHAR, 0, P&vis, V1, 0, 0},
{" 46:"," VENTILE AUSWERT"," JA=1 ", P&hks[HK3].VentilAuswert, US_CHAR, 0, P&vis, V1, 0, 0},
{" 47:"," VENT_AUF ABSCH."," % ", P&hks[HK3].VentOffenMax, US_CHAR, 0, P&vis, V1, 0, 0},
{"*->;"," ventile offen "," ", P&hkd[HK3].ventOffen, US_INT, 0, P&hid2,V0, 0, 0},
{"*->;"," ventile gesamt "," ", P&hkd[HK3].ventGesamt, US_INT, 0, P&hid2,V0, 0, 0},
{"*48:"," VENTILE OFFEN "," % ", P&hkd[HK3].ventOffenBer, US_CHAR, 0, P&vis, V1, 0, 0},
{"*49:"," RAUMABSCHALTG.?"," ", P&hkd[HK3].raumAbsch, JAFRAGE_FORM, 0, P&vis, V1, 0, 0},
#endif
{" 50:"," HEIZ-TaGRENZE "," C ", P&hks[HK3].TaHeizgrenze, S_INT, 1, P&vis, V1, 0, 0},
{" 51:"," FROST-TaGRENZE "," C ", P&hks[HK3].TaFrostgrenze, S_INT, 1, P&vis, V1, 0, 0},
{" 52:"," ABSCH-ZEITKONST"," h/K ", P&hks[HK3].AbschZeitKonst, US_INT, 1, P&vis, V1, 0, 0},
#if ( BEDRAUM_HK3==1 || TRAUMK_HK3==1 )
{" 53;"," KASKADE-MODUS "," ", P&hks[HK3].KaskMode, US_CHAR, 0, P&hid1,V1, 0, 0},
#endif
#if LEIBEGR_HK3 == 1
{" 55;"," Xp LEIST.-BEGR."," K/% ", P&hks[HK3].XpLeistBegr, US_INT, 2, P&hid1, V1, 0, 0},
#endif
#if BEDRAUM_HK3 == 1
{" 56;"," VL MAX SOMMER "," C ", P&hks[HK3].VorlaufMaxSommer, US_INT, 1, P&hid1, V1, 0, 0},
#else
{" ->;"," vl max sommer "," C ", P&hks[HK3].VorlaufMaxSommer, US_INT, 1, P&hid2, V0, 0, 0},
#endif
// Freitags-Ventilöffnung
#if ( BEDRAUM_HK3 == 1 && FBH_HK3 == 0 )
{" 57;"," HZG-ABSENK-TAGE"," Mo=1..", P&hks[HK3].VentiloeffngTag, GWOTAG2_FORM, 0, P&hid1, V0, 0, 0},
{" 57;"," ABSENKBEGINN "," h:min ", P&hks[HK3].VentiloeffngBeg, ZEIT_FORM, 0, P&hid1, V0, 0, 0},
{" 57;"," ABSENKENDE "," h:min ", P&hks[HK3].VentiloeffngEnd, ZEIT_FORM, 0, P&hid1, V0, 0, 0},
{" 58;"," ABSENKWERT "," K ", P&hks[HK3].VentiloeffngAbs, US_INT, 1, P&hid1, V0, 0, 0},
{" 59;"," ABSCHALT-TaGRNZ"," C ", P&hks[HK3].GrenztempAbschalten, S_INT, 1, P&hid1, V0, 0, 0},
{"*->;"," absenken vo ? "," ", P&hkd[HK3].ventiloeffng, JANEIN_FORM, 0, P&hid2, V0, 0, 0},
#endif
// Schwerin: wenn Druck Rücklauf sekundär (0..10 V) aufgeschaltet ist
// {" 58:"," HZG AUS SM DRU."," JA=1 ", P&hks[HK3].HzgAusSMDruck, US_CHAR, 0, P&vis, V1, 0, 0},
{" 60:"," SCHNELLAUFHEIZ."," JA=1 ", P&hks[HK3].Sauf, US_CHAR, 0, P&vis, V0, 0, 0},
{" 61:"," SO/WI-AUTOMATIK"," JA=1 ", P&hks[HK3].Swhk, US_CHAR, 0, P&vis, V1, 0, 0},
#if SWAUS_HK3 == 1 // Anlagenschalter für HK-Nichtnutzung
{" 64:"," HKAUS-ABSENKW. "," K ", P&hks[HK3].SchalterAbsenk,US_INT, 1, P&vis, V1, 0, 0},
#endif
#if TRLBEG_HK3==1
{" ->;"," r-begr.prim/sek"," PRIM=1", P&hks[HK3].Psbegr, US_CHAR, 0, P&hid2, V0, 0, 0},
#endif
#if FRG_HK3 == 1
{"*66:"," ANFORDERUNG ? "," ", P&FRGHK[HK3], JANEIN_FORMIP, 0, P&vis, V1, 0, 0},
#endif
{" 68;"," TDIFF.ALARM EIN"," K ", P&hks[HK3].TabwMax, US_CHAR, 1, P&hid1, V0, 0, 0},
{" 69;"," ZVERZ.ALARM EIN"," min ", P&hks[HK3].TabwZeit, US_CHAR, 0, P&hid1, V0, 0, 0},
#if BEDARF_HK3==1
{"*70:"," HEIZ-BEDARF ? "," ", P&hkd[HK3].bedarf, JAFRAGE_FORM, 0, P&vis, V1, 0, 0},
#endif
{" ->:"," bedarf "," 1J 2N ", P&hkd[HK3].bedarf, US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->:"," vorheiz_bed "," ", P&hkd[HK3].vorheiz_bed, US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->:"," ticopy "," ", P&hkd[HK3].ticopy, US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->:"," CountDown "," ", P&hkd[HK3].CountDown, US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->;"," vorrang bedarf "," ", P&hkd[HK3].vorra_bed, US_CHAR, 0, P&hid2, V0, 0, 0},
#if ( PU_BUS_HK3 == 0 || PULZ_HK3 == 1 ) // also auch wenn Schalten der Pumpe über Ausgang und Bus vorgesehen
#if STRPU_HK3 == 0 // keine Strahlpumpe
#if PUDO_HK3 == 1 // Doppelpumpe
{"*72:"," PU HK1 EIN ? "," ", P&PU[HK3], JANEIN_FORMOP, 0, P&vis, V1, 0, 0},
{"*72:"," PU HK1 EIN ? "," ", P&PUD[HK3], JANEIN_FORMOP, 0, P&vis, V1, 0, 0},
#if PULZ_HK3 == 1
{"*73;"," PUHK1-LAUFZEIT "," h ", P&hkd[HK3].puLz, US_INT, 0, P&hid1, V1, 0, 0},
{" ->;"," pu1-lz minctr "," min*5 ", P&hkd[HK3].pu1min, US_CHAR, 0, P&hid2, V0, 0, 0},
{"*73;"," PU2-LAUFZEIT "," h ", P&hkd[HK3].pudLz, US_INT, 0, P&hid1, V1, 0, 0},
{" ->;"," pu2-lz minctr "," min*5 ", P&hkd[HK3].pu2min, US_CHAR, 0, P&hid2, V0, 0, 0},
#endif
#else // keine Doppelpumpe
{"*72:"," PU HK1 EIN ? "," ", P&PU[HK3], JANEIN_FORMOP, 0, P&vis, V1, 0, 0},
#if PULZ_HK3 == 1
{"*73;"," PU HK1 LAUFZEIT"," h ", P&hkd[HK3].puLz, US_INT, 0, P&hid1, V1, 0, 0},
#endif
#endif
#if PUBM_HK3 == 1 // Betriebsmeldung Pumpe vorhanden
{"*74:"," BM PU HK1 EIN? "," ", P&BMPU[HK3], JANEIN_FORMIP, 0, P&vis, V1, 0, 0},
//{" 74;"," WARTEN BM PUMPE"," min ", P&hks[HK3].PuBmVerz, US_CHAR, 0, P&hid1, V1, 0, 0},
{" ->:"," puBmVerz Ctr "," min/2 ", P&hkd[HK3].puBmVerz, US_INT, 0, P&hid2, V0, 0, 0},
#endif
#endif
#if PUDO_HK3 == 1
{" 75:"," FUEHR.-PU.AKT. "," ", P&hks[HK3].FuehrPu, US_CHAR, 0, P&vis, V1, 0, 0},
{" 75;"," FUEHR.-PU WECHS"," h ", P&hks[HK3].PuWechseln, US_INT, 0, P&hid1, V1, 0, 0},
{" 75;"," FUEHR.-PU.FEST "," ", P&hks[HK3].FuehrPuFest, US_CHAR, 0, P&hid1, V1, 0, 0},
#endif
#endif
#if PU_BUS_HK3 > 0 // Bus-Pumpe
{"*72:"," BUS-PUMPE EIN ?"," ", P&hkd[HK3].busPuEin, JANEIN_FORM, 0, P&vis, V1, 0, 0},
{" 73;"," PU-SOLL NORMAL "," % ", P&hks[HK3].BusPuSollwert, US_INT, 1, P&hid1, V1, 0, 0},
{" 74;"," PU-SOLL ABSENK "," % ", P&hks[HK3].BusPuSollwertAbsenk, US_INT, 1, P&hid1, V1, 0, 0},
#endif
#if ( PULZ_HK3 == 1 || PU_BUS_HK3 > 0 )
{" 76;"," PU-NACHLAUFZEIT"," min ", P&hks[HK3].Puna, US_CHAR, 0, P&hid1, V1, 0, 0},
{" ->;"," pu-nachlauf cnt"," min/2 ", P&hkd[HK3].zpu, US_INT, 0, P&hid2, V0, 0, 0},
#endif
#if SWAUS_HK3 == 1 // Anlagenschalter für HK-Nichtnutzung
{"*78:"," SCHALT.HK-AUS ?"," ", P&HKAUS[HK3], JANEIN_FORMIP, 0, P&vis, E1, EREIGNIS, 0},
#endif
{"*80:"," BETRIEBS-REGIE "," ", P&hkd[HK3].regie_txt, DYN_ASCII_FORM, 0, P&vis, V1, 0, 0},
{"*81:"," ABSENKPHASE ? "," ", P&hkd[HK3].absen, JANEIN_FORM, 0, P&vis, V0, 0, 0},
{"*->:"," ABSCHALTPHASE ?"," ", P&hkd[HK3].absch, JANEIN_FORM, 0, P&vis, V0, 0, 0},
#if TRAUMK_HK3==1 || BEDRAUM_HK3==1
{"*->:"," STUETZBETRIEB ?"," ", P&hkd[HK3].stuetz, JANEIN_FORM, 0, P&vis, V1, 0, 0},
#endif
{"*->:"," FROSTBETRIEB ? "," ", P&hkd[HK3].frost, JANEIN_FORM, 0, P&vis, V1, 0, 0},
{"*82:"," AUFHEIZPHASE ? "," ", P&hkd[HK3].aufhe, JANEIN_FORM, 0, P&vis, V1, 0, 0},
{"*83:"," SOMMERBETRIEB ?"," ", P&hkd[HK3].somme, JANEIN_FORM, 0, P&vis, V1, 0, 0},
{" ->:"," absenkwert abs "," K ", P&abs_ram[HK3].tvab, US_INT, 1, P&hid2, V0, 0, 0},
{" ->:"," absenkzeit abs "," s/10 ", P&abs_ram[HK3].zasd, US_INT, 0, P&hid2, V0, 0, 0},
{" ->:"," abschalt abs "," s/10 ", P&abs_ram[HK3].zAbsch, US_INT, 0, P&hid2, V0, 0, 0},
{" ->:"," aufheiz abs "," s/10 ", P&abs_ram[HK3].zahd, US_INT, 0, P&hid2, V0, 0, 0},
{" ->:"," absenkwert bed "," K ", P&abs_bed[HK3].tvab, US_INT, 1, P&hid2, V0, 0, 0},
{" ->:"," absenkzeit bed "," s/10 ", P&abs_bed[HK3].zasd, US_INT, 0, P&hid2, V0, 0, 0},
{" ->:"," abschalt bed "," s/10 ", P&abs_bed[HK3].zAbsch, US_INT, 0, P&hid2, V0, 0, 0},
{" ->:"," aufheiz bed "," s/10 ", P&abs_bed[HK3].zahd, US_INT, 0, P&hid2, V0, 0, 0},
#if WWANZ > 0
{"*84:"," WW-VORRANG ? "," ", P&hkd[HK3].vorra, JANEIN_FORM, 0, P&vis, V0, 0, 0},
#else
{" ->:"," ww-vorrang ? "," ", P&hkd[HK3].vorra, JANEIN_FORM, 0, P&hid2, V0, 0, 0},
#endif
#if TRLBEG_HK3==1
{"*85:"," RUECKL.BEGR. ? "," ", P&hkd[HK3].rlbegr, JANEIN_FORM, 0, P&vis, V1, 0, 0},
#endif
{"*86:"," SM REGELABW.? "," ", P&hkd[HK3].abwAlarm, JANEIN_FORM, 0, P&vis, A1, EINZEL, 0},
#if STW_HK3==1
{"*87:"," SM STW ? "," ", P&STWHK[HK3], JANEIN_FORMIP, 0, P&vis, A1, EINZEL, 0},
#endif
#if PUAL_HK3 == 1 // Störmeldung Pumpe vorhanden
#if PUDO_HK3 == 1
{"*88:"," SM PUMPE 1 ? "," ", P&PUAL[HK3], JANEIN_FORMIP, 0, P&vis, A1, EINZEL, 0},
{"*88:"," SM PUMPE 2 ? "," ", P&PUDAL[HK3], JANEIN_FORMIP, 0, P&vis, A1, EINZEL, 0},
#else
{"*88:"," SM PU HK1 ? "," ", P&PUAL[HK3], JANEIN_FORMIP, 0, P&vis, A1, EINZEL, 0},
#endif
#endif
#if PUBM_HK3 == 1 // Betriebsmeldung Pumpe vorhanden
{"*88:"," SM BM-PU HK1 ? "," ", P&hkd[HK3].puBm, JANEIN_FORM, 0, P&vis, E1, STANDARD, 0},
#endif
#if PU_BUS_HK3 > 0
{"*88:"," SM BUS PUMPE ? "," ", P&hkd[HK3].busPuSm, JANEIN_FORM, 0, P&vis, A1, EINZEL, 0},
#endif
{"*89:"," HANDBETRIEB ? "," ", P&hks[HK3].Haut, JANEIN_FORM, 0, P&vis, E1, EREIGNIS, 0},
{" 90;"," P-VERSTAERKUNG "," %/K ", P&hks[HK3].Kp, US_INT, 2, P&hid1, V1, 0, 0},
{" 91;"," D-VERSTAERKUNG "," ", P&hks[HK3].Kd, US_INT, 2, P&hid1, V1, 0, 0},
{" 92;"," TASTZEIT "," s ", P&hks[HK3].Ts, US_INT, 1, P&hid1, V1, 0, 0},
{" 93;"," NACHSTELLZEIT "," s ", P&hks[HK3].Tn, US_INT, 1, P&hid1, V1, 0, 0},
#if DREIP_HK3==1
{" 94;"," VENTILHUB MAX "," mm ", P&hks[HK3].Hub, US_CHAR, 0, P&hid1, V1, 0, 0},
{" 95;"," STELLGESCHWIND."," mm/min", P&hks[HK3].Vst, US_CHAR, 0, P&hid1, V1, 0, 0},
{"*->:"," stellzeit ber. "," s ", P&hkd[HK3].stellzeit, S_INT, 2, P&hid2, V0, 0, 0},
{"*->:"," stellsumme "," s ", P&hkd[HK3].stellsum, S_INT, 2, P&hid2, V0, 0, 0},
{"*->:"," fahrzeit "," s ", P&hkd[HK3].fahren, S_INT, 0, P&hid2, V0, 0, 0},
#else
{" 94;"," VENTILSTELL.MIN"," % ", P&hks[HK3].Y_rel_min, US_INT, 1, P&hid1, V1, 0, 0},
{" 95;"," OEFFNUNGSBEGINN"," % ", P&hks[HK3].Y_rel_beg, US_INT, 1, P&hid1, V1, 0, 0},
#endif
{"*96;"," SOLLWERT "," C ", P&hkd[HK3].tsol, US_INT, 1, P&hid1, V1, 0, 0},
{"*97;"," REGELABWEICHUNG"," K ", P&hkd[HK3].ei, S_INT, 1, P&hid1, V1, 0, 0},
{"*->;"," dy_rel "," ", P&hkd[HK3].dy_rel, S_INT, 3, P&hid2, V0, 0, 0},
#if DREIP_HK3==0
{"*98;"," Stellung RV HK1"," % ", P&RVENT[HK3], AOUT_FORMP, 1, P&hid1, V1, 0, 0},
{"*->;"," pid-stellgroess"," % ", P&hkd[HK3].si_y_rel, S_INT, 1, P&hid2, V0, 0, 0},
{" ->;"," pid-windup "," % ", P&hks[HK3].Wup, US_INT, 1, P&hid2, V0, 0, 0},
#endif
//-------------------------------------------------------------------------------------------------
{" 99;"," HAND/AUTOMATIK "," HAND=1", P&hks[HK3].Haut, US_CHAR, 0, P&hid1, V1, 0, 0},
#if ( PU_BUS_HK3 == 0 || PULZ_HK3 == 1 )
#if STRPU_HK3 == 0
#if PUDO_HK3 == 1
{" ->:"," PUMPE 1 EIN/AUS"," EIN=1 ", P&hks[HK3].Puea, US_CHAR, 0, P&hid1, V1, 0, 0},
{" ->:"," PUMPE 2 EIN/AUS"," EIN=1 ", P&hks[HK3].Pu2ea, US_CHAR, 0, P&hid1, V1, 0, 0},
#else
{" ->:"," PU HK1 EIN/AUS "," EIN=1 ", P&hks[HK3].Puea, US_CHAR, 0, P&hid1, V1, 0, 0},
#endif
#endif
#endif
#if DREIP_HK3==1
{" ->:"," VENTIL ZUFAHREN"," s ", P&hkd[HK3].vzu, US_CHAR, 0, P&hid1, V1, 0, 0},
{" ->:"," VENTIL AUFFAHRN"," s ", P&hkd[HK3].vauf, US_CHAR, 0, P&hid1, V1, 0, 0},
#else
{" ->:"," RV HK1 STELLEN "," % ", P&hks[HK3].Vstell, US_INT, 1, P&hid1, V1, 0, 0},
#endif
};
/*------------------------------ Heizkurven-Adaption ----------------------------------------------*/
#if ADAP_STAT_HK3 > 0
const Pgrup ad3[] = {
{"***:"," ADAPTION HK3 "," ", P&Leer15, ASCII_FORM, 0, P&vis, V1, 0, 0},
{"*00:"," ADAPT.-MELDUNG "," ", P&AdaptMeldg[HK3][0], DYN_ASCII_FORM, 0, P&vis, V1, 0, 0},
#if ADAP_QU_HK3 == 0
#if ADAP_STAT_HK3 == 1
{" ->;"," R50-Anford.Rx "," V ", P&mwAdapt[HK3][0], US_CHAR, 0, P&hid2, V0, 0, 0},
#else
#if ADAP_STAT_HK3 > 1
{" ->;"," 1.R50-Anford.Rx"," V ", P&mwAdapt[HK3][0], US_CHAR, 0, P&hid2, V0, 0, 0},
#endif
#endif
#if ADAP_STAT_HK3 > 1
{" ->;"," 2.R50-Anford.Rx"," V ", P&mwAdapt[HK3][1], US_CHAR, 0, P&hid2, V0, 0, 0},
#endif
#if ADAP_STAT_HK3 > 2
{" ->;"," 3.R50-Anford.Rx"," V ", P&mwAdapt[HK3][2], US_CHAR, 0, P&hid2, V0, 0, 0},
#endif
#if ADAP_STAT_HK3 > 3
{" ->;"," 4.R50-Anford.Rx"," V ", P&mwAdapt[HK3][3], US_CHAR, 0, P&hid2, V0, 0, 0},
#endif
//### josch
{" ->;"," adapt_countdown"," min ", P&adapt_countdown[HK3], US_CHAR, 0, P&hid2, V0, 0, 0},
#if ADAP_STAT_HK3 == 1
{"*01:"," R50-ANFORD. "," V ", P&mwAdaption[HK3][0], ANA_FORM, 1, P&vis, V1, 0, 0},
{"*01:"," R50-ANFORD. "," V ", P&mwAdaption[HK3][0], ANA_FORM, 0x81, P&kom, E1, FUEHLER, 0},
#else
#if ADAP_STAT_HK3 > 1
{"*01:"," 1.R50-ANFORD. "," V ", P&mwAdaption[HK3][0], ANA_FORM, 1, P&vis, V1, 0, 0},
{"*01:"," 1.R50-ANFORD. "," V ", P&mwAdaption[HK3][0], ANA_FORM, 0x81, P&kom, E1, FUEHLER, 0},
#endif
#endif
#if ADAP_STAT_HK3 > 1
{"*02:"," 2.R50-ANFORD. "," V ", P&mwAdaption[HK3][1], ANA_FORM, 1, P&vis, V1, 0, 0},
{"*02:"," 2.R50-ANFORD. "," V ", P&mwAdaption[HK3][1], ANA_FORM, 0x81, P&kom, E1, FUEHLER, 0},
#endif
#if ADAP_STAT_HK3 > 2
{"*03:"," 3.R50-ANFORD. "," V ", P&mwAdaption[HK3][2], ANA_FORM, 1, P&vis, V1, 0, 0},
{"*03:"," 3.R50-ANFORD. "," V ", P&mwAdaption[HK3][2], ANA_FORM, 0x81, P&kom, E1, FUEHLER, 0},
#endif
#if ADAP_STAT_HK3 > 3
{"*04:"," 4.R50-ANFORD. "," V ", P&mwAdaption[HK3][3], ANA_FORM, 1, P&vis, V1, 0, 0},
{"*04:"," 4.R50-ANFORD. "," V ", P&mwAdaption[HK3][3], ANA_FORM, 0x81, P&kom, E1, FUEHLER, 0},
#endif
#else
{"*->;"," Anforderung ana"," V ", P&ADAPT[HK3], ANA_FORMP, 2, P&hid2, V0, 0, 0},
{"*->;"," Anford.bin tief"," ", P&ADAPT_T[HK3], JANEIN_FORMIP, 0, P&hid2, V0, 0, 0},
{"*->;"," Anford.bin hoch"," ", P&ADAPT_H[HK3], JANEIN_FORMIP, 0, P&hid2, V0, 0, 0},
{"*01:"," ANFORDERUNG "," V ", P&mwAdaption[HK3][0], ANA_FORM, 1, P&vis, V1, 0, 0},
{"*01:"," ANFORDERUNG "," V ", P&mwAdaption[HK3][0], ANA_FORM, 0x81, P&kom, E1, FUEHLER, 0},
#endif
{" 10:"," MESSBEGINN "," Uhr ", P&hks[HK3].MessBeginn, US_CHAR, 0, P&vis, V1, 0, 0},
{" 11:"," ADAPTIONS-WERT "," K ", P&hks[HK3].AdaptWert, US_CHAR, 1, P&vis, V1, 0, 0},
{" 12:"," REGELABW.-GRENZ"," K ", P&hks[HK3].EiMaxAdapt, US_CHAR, 1, P&vis, V1, 0, 0},
{" ->;"," Vorlauf zu tief"," ", P&tvsLow[HK3], US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->;"," Vorlauf normal "," ", P&tvsNormal[HK3], US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->;"," Vorlauf zu hoch"," ", P&tvsHigh[HK3], US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->;"," Leistg. zu tief"," ", P&leistgLow[HK3], US_CHAR, 0, P&hid2, V0, 0, 0},
{" ->;"," Leistg. zu hoch"," ", P&leistgHigh[HK3], US_CHAR, 0, P&hid2, V0, 0, 0},
{"*20;"," ADAPT.Ta=-25C "," K ", P&AdaptKorr[HK3][0], S_INT, 1, P&hid1, V1, 0, 0},
{"*21;"," ADAPT.Ta=-20C "," K ", P&AdaptKorr[HK3][1], S_INT, 1, P&hid1, V1, 0, 0},
{"*22;"," ADAPT.Ta=-15C "," K ", P&AdaptKorr[HK3][2], S_INT, 1, P&hid1, V1, 0, 0},
{"*23;"," ADAPT.Ta=-10C "," K ", P&AdaptKorr[HK3][3], S_INT, 1, P&hid1, V1, 0, 0},
{"*24;"," ADAPT.Ta=-5C "," K ", P&AdaptKorr[HK3][4], S_INT, 1, P&hid1, V1, 0, 0},
{"*25;"," ADAPT.Ta=0C "," K ", P&AdaptKorr[HK3][5], S_INT, 1, P&hid1, V1, 0, 0},
{"*26;"," ADAPT.Ta=5C "," K ", P&AdaptKorr[HK3][6], S_INT, 1, P&hid1, V1, 0, 0},
{"*27;"," ADAPT.Ta=10C "," K ", P&AdaptKorr[HK3][7], S_INT, 1, P&hid1, V1, 0, 0},
{"*28;"," ADAPT.Ta=15C "," K ", P&AdaptKorr[HK3][8], S_INT, 1, P&hid1, V1, 0, 0},
{"*29;"," ADAPT.Ta=20C "," K ", P&AdaptKorr[HK3][9], S_INT, 1, P&hid1, V1, 0, 0},
};
#endif
| [
"s.wagenknecht@parabel-energiesysteme.de"
] | s.wagenknecht@parabel-energiesysteme.de |
6ac3e66356e5fdb9d0725dd234387bd11bb4ce6e | 7652abbfe9b9a4d39ef3760a68a0e3425ad99c52 | /Past Classes/CSO/Recitations/Before Midterm/pointers_and_arrays.c | 81703b85ecc4e3139608ae8f62de1f9c2b8d6a13 | [] | no_license | shrinaparikh/nyu | c0613e9c59887c7f4210d8f821d32cad2dfd1a0a | b3680fa0267860ba65b81381bf5560fd3f4338ae | refs/heads/master | 2021-06-20T09:43:40.660685 | 2020-12-23T01:43:38 | 2020-12-23T01:43:38 | 151,174,863 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 289 | c | #include <stdio.h>
int main()
{
int i, x[6], sum = 0;
printf("Enter 6 numbers: ");
for(i = 0; i < 6; ++i)
{
// Equivalent to scanf("%d", &x[i]);
scanf("%d", x+i);
// Equivalent to sum += x[i]
sum += *(x+i);
}
printf("Sum = %d", sum);
return 0;
} | [
"sp4681@nyu.edu"
] | sp4681@nyu.edu |
c68c97267afce6522ad653cd7afeec7b66305d9c | 882e579d0b9abea069fb9573f1c376ff3f5f7055 | /v3_TMTDyn_hll_MORSE2019/Samples/Fabric/1. Passive/eom/codegen/mex/sprdmpF41/sprdmpF41_types.h | 08d3efaee6aa58d8e377e010b32d498e9b7e8bde | [
"BSD-2-Clause"
] | permissive | LenhartYang/TMTDyn | f92d12d9d913a25eadac309670953ab302ffcfa2 | 134d89b156bdc078f6426561d1de76271f07259e | refs/heads/master | 2023-03-27T12:34:16.250684 | 2021-03-25T13:40:01 | 2021-03-25T13:40:01 | 374,253,641 | 1 | 0 | NOASSERTION | 2021-06-06T02:47:07 | 2021-06-06T02:47:06 | null | UTF-8 | C | false | false | 434 | h | /*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* sprdmpF41_types.h
*
* Code generation for function 'sprdmpF41'
*
*/
#ifndef SPRDMPF41_TYPES_H
#define SPRDMPF41_TYPES_H
/* Include files */
#include "rtwtypes.h"
#endif
/* End of code generation (sprdmpF41_types.h) */
| [
"m.hadi.sadati@gmail.com"
] | m.hadi.sadati@gmail.com |
d45527cb6219516ed29303410e0471576b8ff7ef | 2bf306691f7ab52099cc957d673ce210bf19ab6a | /3.SemanticCheck/symbolTable.c | f2fd9ff0480c34d83d228d0302fef457d68d1059 | [] | no_license | b06902062/C---compiler | 2260b750403e608bea5ba63cef4bae8d1c3eddff | 394473f91435d4ea582772bc0a31997f07a76099 | refs/heads/main | 2023-03-31T18:32:42.975294 | 2021-04-03T16:37:03 | 2021-04-03T16:37:03 | 354,327,945 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 8,607 | c | #include "symbolTable.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
// This file is for reference only, you are not required to follow the implementation. //
int HASH(char * str) {
int idx=0;
while (*str){
idx = idx << 1;
idx+=*str;
str++;
}
return (idx & (HASH_TABLE_SIZE-1));
}
SymbolTable symbolTable;
SymbolTableEntry* newSymbolTableEntry(int nestingLevel)
{
SymbolTableEntry* symbolTableEntry = (SymbolTableEntry*)malloc(sizeof(SymbolTableEntry));
symbolTableEntry->nextInHashChain = NULL;
symbolTableEntry->prevInHashChain = NULL;
symbolTableEntry->nextInSameLevel = NULL;
symbolTableEntry->sameNameInOuterLevel = NULL;
symbolTableEntry->attribute = NULL;
symbolTableEntry->name = NULL;
symbolTableEntry->nestingLevel = nestingLevel;
return symbolTableEntry;
}
void removeFromHashTrain(int hashIndex, SymbolTableEntry* entry)
{
if(entry->prevInHashChain) //not head
entry->prevInHashChain->nextInHashChain = entry->nextInHashChain;
else //head
symbolTable.hashTable[hashIndex] = entry->nextInHashChain;
if(entry->nextInHashChain) //not tail
entry->nextInHashChain->prevInHashChain = entry->prevInHashChain;
entry->nextInHashChain = NULL;
entry->prevInHashChain = NULL;
}
void enterIntoHashTrain(int hashIndex, SymbolTableEntry* entry)
{
SymbolTableEntry* tmp = symbolTable.hashTable[hashIndex];
if(tmp){ //the chain has entries
tmp->prevInHashChain = entry;
entry->nextInHashChain = tmp;
}
symbolTable.hashTable[hashIndex] = entry;
}
void initializeSymbolTable()
{
symbolTable.currentLevel = 0;
symbolTable.scopeDisplayElementCount = 16;
symbolTable.scopeDisplay = (SymbolTableEntry**)malloc(symbolTable.scopeDisplayElementCount * sizeof(SymbolTableEntry*));
for(int i = 0; i < HASH_TABLE_SIZE; ++i)
symbolTable.hashTable[i] = NULL;
for(int i = 0; i < symbolTable.scopeDisplayElementCount; ++i)
symbolTable.scopeDisplay[i] = NULL;
//reserved words
SymbolAttribute* voidAttr = (SymbolAttribute*)malloc(sizeof(SymbolAttribute));
voidAttr->attributeKind = TYPE_ATTRIBUTE;
voidAttr->attr.typeDescriptor = (TypeDescriptor*)malloc(sizeof(TypeDescriptor));
voidAttr->attr.typeDescriptor->kind = SCALAR_TYPE_DESCRIPTOR;
voidAttr->attr.typeDescriptor->properties.dataType = VOID_TYPE;
enterSymbol(SYMBOL_TABLE_VOID_NAME, voidAttr);
SymbolAttribute* intAttr = (SymbolAttribute*)malloc(sizeof(SymbolAttribute));
intAttr->attributeKind = TYPE_ATTRIBUTE;
intAttr->attr.typeDescriptor = (TypeDescriptor*)malloc(sizeof(TypeDescriptor));
intAttr->attr.typeDescriptor->kind = SCALAR_TYPE_DESCRIPTOR;
intAttr->attr.typeDescriptor->properties.dataType = INT_TYPE;
enterSymbol(SYMBOL_TABLE_INT_NAME, intAttr);
SymbolAttribute* floatAttr = (SymbolAttribute*)malloc(sizeof(SymbolAttribute));
floatAttr->attributeKind = TYPE_ATTRIBUTE;
floatAttr->attr.typeDescriptor = (TypeDescriptor*)malloc(sizeof(TypeDescriptor));
floatAttr->attr.typeDescriptor->kind = SCALAR_TYPE_DESCRIPTOR;
floatAttr->attr.typeDescriptor->properties.dataType = FLOAT_TYPE;
enterSymbol(SYMBOL_TABLE_FLOAT_NAME, floatAttr);
SymbolAttribute* readAttr = NULL;
readAttr = (SymbolAttribute*)malloc(sizeof(SymbolAttribute));
readAttr->attributeKind = FUNCTION_SIGNATURE;
readAttr->attr.functionSignature = (FunctionSignature*)malloc(sizeof(FunctionSignature));
readAttr->attr.functionSignature->returnType = INT_TYPE;
readAttr->attr.functionSignature->parameterList = NULL;
readAttr->attr.functionSignature->parametersCount = 0;
enterSymbol(SYMBOL_TABLE_SYS_LIB_READ, readAttr);
SymbolAttribute* freadAttr = NULL;
freadAttr = (SymbolAttribute*)malloc(sizeof(SymbolAttribute));
freadAttr->attributeKind = FUNCTION_SIGNATURE;
freadAttr->attr.functionSignature = (FunctionSignature*)malloc(sizeof(FunctionSignature));
freadAttr->attr.functionSignature->returnType = FLOAT_TYPE;
freadAttr->attr.functionSignature->parameterList = NULL;
freadAttr->attr.functionSignature->parametersCount = 0;
enterSymbol(SYMBOL_TABLE_SYS_LIB_FREAD, freadAttr);
}
void symbolTableEnd()
{
// do nothing
}
SymbolTableEntry* retrieveSymbol(char* symbolName)
{
SymbolTableEntry* tmp = symbolTable.hashTable[HASH(symbolName)];
while(tmp){
if(!strcmp(tmp->name, symbolName))
return tmp;
else
tmp = tmp->nextInHashChain;
}
return NULL;
}
SymbolTableEntry* enterSymbol(char* symbolName, SymbolAttribute* attribute)
{
SymbolTableEntry* newEntry = newSymbolTableEntry(symbolTable.currentLevel);
newEntry->attribute = attribute;
newEntry->name = symbolName;
int hashIndex = HASH(symbolName);
SymbolTableEntry* tmp = symbolTable.hashTable[hashIndex];
while(tmp){
if(!strcmp(tmp->name, symbolName)){
//different level -> make branch
removeFromHashTrain(hashIndex, tmp);
newEntry->sameNameInOuterLevel = tmp;
break;
}
else {
tmp = tmp->nextInHashChain;
}
}
enterIntoHashTrain(hashIndex, newEntry);
newEntry->nextInSameLevel = symbolTable.scopeDisplay[symbolTable.currentLevel];
symbolTable.scopeDisplay[symbolTable.currentLevel] = newEntry;
return newEntry;
}
//remove the symbol from the current scope
void removeSymbol(char* symbolName)
{
int hashIndex = HASH(symbolName);
SymbolTableEntry* tmp = symbolTable.hashTable[hashIndex];
while(tmp){
if(!strcmp(tmp->name, symbolName)){
if(tmp->nestingLevel != symbolTable.currentLevel){
printf("[DEBUG] Invalid removeSymbol(): name \'%s\' found in one of the outer scopes.\n", symbolName);
return;
}
else{
removeFromHashTrain(hashIndex, tmp);
if(tmp->sameNameInOuterLevel)
enterIntoHashTrain(hashIndex, tmp->sameNameInOuterLevel);
break;
}
}
else
tmp = tmp->nextInHashChain;
}
if(!tmp){
printf("[DEBUG] Invalid removeSymbol(): name \'%s\' not found in symbol table.\n", symbolName);
return;
}
SymbolTableEntry* PrevChainElement = NULL;
SymbolTableEntry* scopeChain = symbolTable.scopeDisplay[symbolTable.currentLevel];
while(scopeChain){
if(!strcmp(scopeChain->name, symbolName)){
if(PrevChainElement)
PrevChainElement->nextInSameLevel = scopeChain->nextInSameLevel;
else
symbolTable.scopeDisplay[symbolTable.currentLevel] = scopeChain->nextInSameLevel;
free(scopeChain);
break;
}
else{
PrevChainElement = scopeChain;
scopeChain = scopeChain->nextInSameLevel;
}
}
}
int declaredLocally(char* symbolName)
{
SymbolTableEntry* tmp = symbolTable.hashTable[HASH(symbolName)];
while(tmp){
if(!strcmp(tmp->name, symbolName)){
return (tmp->nestingLevel == symbolTable.currentLevel)? 1 : 0;
}
tmp = tmp->nextInHashChain;
}
return 0;
}
void openScope()
{
symbolTable.currentLevel++;
if (symbolTable.currentLevel >= symbolTable.scopeDisplayElementCount) {
SymbolTableEntry **origScopeDisplay = symbolTable.scopeDisplay;
symbolTable.scopeDisplay = (SymbolTableEntry **)malloc(
2 * symbolTable.scopeDisplayElementCount * sizeof(SymbolTableEntry *)
);
for (int i = 0; i < symbolTable.scopeDisplayElementCount; i++) {
symbolTable.scopeDisplay[i] = origScopeDisplay[i];
symbolTable.scopeDisplay[i + symbolTable.scopeDisplayElementCount] = NULL;
}
free(origScopeDisplay);
symbolTable.scopeDisplayElementCount *= 2;
}
}
void closeScope()
{
if(symbolTable.currentLevel < 0){
printf("[DEBUG] Invalid closeScope(): currentLevel < 0.\n");
return;
}
SymbolTableEntry* scopeChain = symbolTable.scopeDisplay[symbolTable.currentLevel];
while(scopeChain){
int hashIndex = HASH(scopeChain->name);
removeFromHashTrain(hashIndex, scopeChain);
if(scopeChain->sameNameInOuterLevel)
enterIntoHashTrain(hashIndex, scopeChain->sameNameInOuterLevel);
scopeChain = scopeChain->nextInSameLevel;
}
symbolTable.scopeDisplay[symbolTable.currentLevel] = NULL;
symbolTable.currentLevel--;
}
| [
"ht94001@gmail.com"
] | ht94001@gmail.com |
626a39c0bec2f85d475aab39db86de1d246141b8 | acefb9032383e694cf7a93f0a4a0638d75a8a1e4 | /selfdrive/common/version.h | 348ff45913417a25ef42936026818a4afce97091 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | UVA-DSA/OpenpilotWithVision | f577aebe43445dad58e73b4fadd59ced42d626c9 | 1dfc73c305107dac09e056e4ea750e2be1b9abef | refs/heads/master | 2020-03-13T05:09:53.354395 | 2018-04-25T08:29:51 | 2018-04-25T08:29:51 | 130,977,280 | 1 | 0 | null | 2018-04-25T08:46:51 | 2018-04-25T08:46:50 | null | UTF-8 | C | false | false | 40 | h | #define COMMA_VERSION "0.4.2-openpilot"
| [
"hrubaiyat@gmail.com"
] | hrubaiyat@gmail.com |
0665e5f6a916c4aaff355c76eee8001ae5acd903 | 559770fbf0654bc0aecc0f8eb33843cbfb5834d9 | /haina/codes/beluga/client/moblie/3rdParty/libxml2-2.6.19/testHTML.c | c5da07eee59152e4426e7960f8b9077499a53ee6 | [
"MIT",
"LicenseRef-scancode-x11-xconsortium-veillard"
] | permissive | CMGeorge/haina | 21126c70c8c143ca78b576e1ddf352c3d73ad525 | c68565d4bf43415c4542963cfcbd58922157c51a | refs/heads/master | 2021-01-11T07:07:16.089036 | 2010-08-18T09:25:07 | 2010-08-18T09:25:07 | 49,005,284 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 21,130 | c | /*
* testHTML.c : a small tester program for HTML input.
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#include "libxml.h"
#ifdef LIBXML_HTML_ENABLED
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <libxml/xmlmemory.h>
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#include <libxml/debugXML.h>
#include <libxml/xmlerror.h>
#include <libxml/globals.h>
#ifdef LIBXML_DEBUG_ENABLED
static int debug = 0;
#endif
static int copy = 0;
static int sax = 0;
static int repeat = 0;
static int noout = 0;
#ifdef LIBXML_PUSH_ENABLED
static int push = 0;
#endif /* LIBXML_PUSH_ENABLED */
static char *encoding = NULL;
static int options = 0;
xmlSAXHandler emptySAXHandlerStruct = {
NULL, /* internalSubset */
NULL, /* isStandalone */
NULL, /* hasInternalSubset */
NULL, /* hasExternalSubset */
NULL, /* resolveEntity */
NULL, /* getEntity */
NULL, /* entityDecl */
NULL, /* notationDecl */
NULL, /* attributeDecl */
NULL, /* elementDecl */
NULL, /* unparsedEntityDecl */
NULL, /* setDocumentLocator */
NULL, /* startDocument */
NULL, /* endDocument */
NULL, /* startElement */
NULL, /* endElement */
NULL, /* reference */
NULL, /* characters */
NULL, /* ignorableWhitespace */
NULL, /* processingInstruction */
NULL, /* comment */
NULL, /* xmlParserWarning */
NULL, /* xmlParserError */
NULL, /* xmlParserError */
NULL, /* getParameterEntity */
NULL, /* cdataBlock */
NULL, /* externalSubset */
1, /* initialized */
NULL, /* private */
NULL, /* startElementNsSAX2Func */
NULL, /* endElementNsSAX2Func */
NULL /* xmlStructuredErrorFunc */
};
xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
extern xmlSAXHandlerPtr debugSAXHandler;
/************************************************************************
* *
* Debug Handlers *
* *
************************************************************************/
/**
* isStandaloneDebug:
* @ctxt: An XML parser context
*
* Is this document tagged standalone ?
*
* Returns 1 if true
*/
static int
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.isStandalone()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*
* Returns 1 if true
*/
static int
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.hasInternalSubset()\n");
return(0);
}
/**
* hasExternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an external subset
*
* Returns 1 if true
*/
static int
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.hasExternalSubset()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*/
static void
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
fprintf(stdout, "SAX.internalSubset(%s,", name);
if (ExternalID == NULL)
fprintf(stdout, " ,");
else
fprintf(stdout, " %s,", ExternalID);
if (SystemID == NULL)
fprintf(stdout, " )\n");
else
fprintf(stdout, " %s)\n", SystemID);
}
/**
* resolveEntityDebug:
* @ctxt: An XML parser context
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
* The default behaviour is to NOT resolve the entities, in that case
* the ENTITY_REF nodes are built in the structure (and the parameter
* values).
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
{
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
fprintf(stdout, "SAX.resolveEntity(");
if (publicId != NULL)
fprintf(stdout, "%s", (char *)publicId);
else
fprintf(stdout, " ");
if (systemId != NULL)
fprintf(stdout, ", %s)\n", (char *)systemId);
else
fprintf(stdout, ", )\n");
/*********
if (systemId != NULL) {
return(xmlNewInputFromFile(ctxt, (char *) systemId));
}
*********/
return(NULL);
}
/**
* getEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get an entity by name
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.getEntity(%s)\n", name);
return(NULL);
}
/**
* getParameterEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get a parameter entity by name
*
* Returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
return(NULL);
}
/**
* entityDeclDebug:
* @ctxt: An XML parser context
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
*
* An entity definition has been parsed
*/
static void
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
name, type, publicId, systemId, content);
}
/**
* attributeDeclDebug:
* @ctxt: An XML parser context
* @name: the attribute name
* @type: the attribute type
*
* An attribute definition has been parsed
*/
static void
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlChar *name,
int type, int def, const xmlChar *defaultValue,
xmlEnumerationPtr tree ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
elem, name, type, def, defaultValue);
}
/**
* elementDeclDebug:
* @ctxt: An XML parser context
* @name: the element name
* @type: the element type
* @content: the element value (without processing).
*
* An element definition has been parsed
*/
static void
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
xmlElementContentPtr content ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
name, type);
}
/**
* notationDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
static void
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId)
{
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId);
}
/**
* unparsedEntityDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
static void
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName)
{
fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId,
(char *) notationName);
}
/**
* setDocumentLocatorDebug:
* @ctxt: An XML parser context
* @loc: A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
*/
static void
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.setDocumentLocator()\n");
}
/**
* startDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document start being processed.
*/
static void
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.startDocument()\n");
}
/**
* endDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document end has been detected.
*/
static void
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.endDocument()\n");
}
/**
* startElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when an opening tag has been processed.
*/
static void
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
{
int i;
fprintf(stdout, "SAX.startElement(%s", (char *) name);
if (atts != NULL) {
for (i = 0;(atts[i] != NULL);i++) {
fprintf(stdout, ", %s", atts[i++]);
if (atts[i] != NULL) {
unsigned char output[40];
const unsigned char *att = atts[i];
int outlen, attlen;
fprintf(stdout, "='");
while ((attlen = strlen((char*)att)) > 0) {
outlen = sizeof output - 1;
htmlEncodeEntities(output, &outlen, att, &attlen, '\'');
output[outlen] = 0;
fprintf(stdout, "%s", (char *) output);
att += attlen;
}
fprintf(stdout, "'");
}
}
}
fprintf(stdout, ")\n");
}
/**
* endElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when the end of an element has been detected.
*/
static void
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
}
/**
* charactersDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
*/
static void
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
unsigned char output[40];
int inlen = len, outlen = 30;
htmlEncodeEntities(output, &outlen, ch, &inlen, 0);
output[outlen] = 0;
fprintf(stdout, "SAX.characters(%s, %d)\n", output, len);
}
/**
* cdataDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
*
* receiving some cdata chars from the parser.
* Question: how much at a time ???
*/
static void
cdataDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
unsigned char output[40];
int inlen = len, outlen = 30;
htmlEncodeEntities(output, &outlen, ch, &inlen, 0);
output[outlen] = 0;
fprintf(stdout, "SAX.cdata(%s, %d)\n", output, len);
}
/**
* referenceDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* called when an entity reference is detected.
*/
static void
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.reference(%s)\n", name);
}
/**
* ignorableWhitespaceDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @start: the first char in the string
* @len: the number of xmlChar
*
* receiving some ignorable whitespaces from the parser.
* Question: how much at a time ???
*/
static void
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
char output[40];
int i;
for (i = 0;(i<len) && (i < 30);i++)
output[i] = ch[i];
output[i] = 0;
fprintf(stdout, "SAX.ignorableWhitespace(%s, %d)\n", output, len);
}
/**
* processingInstructionDebug:
* @ctxt: An XML parser context
* @target: the target name
* @data: the PI data's
* @len: the number of xmlChar
*
* A processing instruction has been parsed.
*/
static void
processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
const xmlChar *data)
{
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
(char *) target, (char *) data);
}
/**
* commentDebug:
* @ctxt: An XML parser context
* @value: the comment content
*
* A comment has been parsed.
*/
static void
commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
{
fprintf(stdout, "SAX.comment(%s)\n", value);
}
/**
* warningDebug:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a warning messages, gives file, line, position and
* extra parameters.
*/
static void
warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
{
va_list args;
va_start(args, msg);
fprintf(stdout, "SAX.warning: ");
vfprintf(stdout, msg, args);
va_end(args);
}
/**
* errorDebug:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a error messages, gives file, line, position and
* extra parameters.
*/
static void
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
{
va_list args;
va_start(args, msg);
fprintf(stdout, "SAX.error: ");
vfprintf(stdout, msg, args);
va_end(args);
}
/**
* fatalErrorDebug:
* @ctxt: An XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a fatalError messages, gives file, line, position and
* extra parameters.
*/
static void
fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
{
va_list args;
va_start(args, msg);
fprintf(stdout, "SAX.fatalError: ");
vfprintf(stdout, msg, args);
va_end(args);
}
xmlSAXHandler debugSAXHandlerStruct = {
internalSubsetDebug,
isStandaloneDebug,
hasInternalSubsetDebug,
hasExternalSubsetDebug,
resolveEntityDebug,
getEntityDebug,
entityDeclDebug,
notationDeclDebug,
attributeDeclDebug,
elementDeclDebug,
unparsedEntityDeclDebug,
setDocumentLocatorDebug,
startDocumentDebug,
endDocumentDebug,
startElementDebug,
endElementDebug,
referenceDebug,
charactersDebug,
ignorableWhitespaceDebug,
processingInstructionDebug,
commentDebug,
warningDebug,
errorDebug,
fatalErrorDebug,
getParameterEntityDebug,
cdataDebug,
NULL,
1,
NULL,
NULL,
NULL,
NULL
};
xmlSAXHandlerPtr debugSAXHandler = &debugSAXHandlerStruct;
/************************************************************************
* *
* Debug *
* *
************************************************************************/
static void
parseSAXFile(char *filename) {
htmlDocPtr doc = NULL;
/*
* Empty callbacks for checking
*/
#ifdef LIBXML_PUSH_ENABLED
if (push) {
FILE *f;
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
htmlParserCtxtPtr ctxt;
/* if (repeat) */
size = 4096;
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(emptySAXHandler, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
fclose(f);
}
if (!noout) {
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
htmlParserCtxtPtr ctxt;
/* if (repeat) */
size = 4096;
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(debugSAXHandler, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
fclose(f);
}
}
} else {
#endif /* LIBXML_PUSH_ENABLED */
doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL);
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
if (!noout) {
/*
* Debug callback
*/
doc = htmlSAXParseFile(filename, NULL, debugSAXHandler, NULL);
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
}
#ifdef LIBXML_PUSH_ENABLED
}
#endif /* LIBXML_PUSH_ENABLED */
}
static void
parseAndPrintFile(char *filename) {
htmlDocPtr doc = NULL;
/*
* build an HTML tree from a string;
*/
#ifdef LIBXML_PUSH_ENABLED
if (push) {
FILE *f;
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
htmlParserCtxtPtr ctxt;
/* if (repeat) */
size = 4096;
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
fclose(f);
}
} else {
doc = htmlReadFile(filename, NULL, options);
}
#else
doc = htmlReadFile(filename,NULL,options);
#endif
if (doc == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Could not parse %s\n", filename);
}
#ifdef LIBXML_TREE_ENABLED
/*
* test intermediate copy if needed.
*/
if (copy) {
htmlDocPtr tmp;
tmp = doc;
doc = xmlCopyDoc(doc, 1);
xmlFreeDoc(tmp);
}
#endif
#ifdef LIBXML_OUTPUT_ENABLED
/*
* print it.
*/
if (!noout) {
#ifdef LIBXML_DEBUG_ENABLED
if (!debug) {
if (encoding)
htmlSaveFileEnc("-", doc, encoding);
else
htmlDocDump(stdout, doc);
} else
xmlDebugDumpDocument(stdout, doc);
#else
if (encoding)
htmlSaveFileEnc("-", doc, encoding);
else
htmlDocDump(stdout, doc);
#endif
}
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* free it.
*/
xmlFreeDoc(doc);
}
int main(int argc, char **argv) {
int i, count;
int files = 0;
for (i = 1; i < argc ; i++) {
#ifdef LIBXML_DEBUG_ENABLED
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;
else
#endif
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
copy++;
#ifdef LIBXML_PUSH_ENABLED
else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push")))
push++;
#endif /* LIBXML_PUSH_ENABLED */
else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax")))
sax++;
else if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout")))
noout++;
else if ((!strcmp(argv[i], "-repeat")) ||
(!strcmp(argv[i], "--repeat")))
repeat++;
else if ((!strcmp(argv[i], "-encode")) ||
(!strcmp(argv[i], "--encode"))) {
i++;
encoding = argv[i];
}
}
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-encode")) ||
(!strcmp(argv[i], "--encode"))) {
i++;
continue;
}
if (argv[i][0] != '-') {
if (repeat) {
for (count = 0;count < 100 * repeat;count++) {
if (sax)
parseSAXFile(argv[i]);
else
parseAndPrintFile(argv[i]);
}
} else {
if (sax)
parseSAXFile(argv[i]);
else
parseAndPrintFile(argv[i]);
}
files ++;
}
}
if (files == 0) {
printf("Usage : %s [--debug] [--copy] [--copy] HTMLfiles ...\n",
argv[0]);
printf("\tParse the HTML files and output the result of the parsing\n");
#ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n");
#endif
printf("\t--copy : used to test the internal copy implementation\n");
printf("\t--sax : debug the sequence of SAX callbacks\n");
printf("\t--repeat : parse the file 100 times, for timing\n");
printf("\t--noout : do not print the result\n");
#ifdef LIBXML_PUSH_ENABLED
printf("\t--push : use the push mode parser\n");
#endif /* LIBXML_PUSH_ENABLED */
printf("\t--encode encoding : output in the given encoding\n");
}
xmlCleanupParser();
xmlMemoryDump();
return(0);
}
#else /* !LIBXML_HTML_ENABLED */
#include <stdio.h>
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : HTML support not compiled in\n", argv[0]);
return(0);
}
#endif
| [
"shaochuan.yang@6c45ac76-16e4-11de-9d52-39b120432c5d"
] | shaochuan.yang@6c45ac76-16e4-11de-9d52-39b120432c5d |
563013fb77e55a3c6e5061b8a7997006ffa8fd06 | c5cb98ad5c3fa37ce761cb9b430b69e29a33141f | /clone/cloth/pink_cloth.c | e847a17b1305627f77319c1d4e672ee536980d4c | [] | no_license | cao777/mudylfy | 92669b53216a520a48cf2cca49ea08d4df4999c5 | 266685aa486ecf0e3616db87b5bf7ad5ea4e57e4 | refs/heads/master | 2023-03-16T20:58:21.877729 | 2019-12-13T07:39:24 | 2019-12-13T07:39:24 | null | 0 | 0 | null | null | null | null | GB18030 | C | false | false | 483 | c | // pink_cloth.c
#include <armor.h>
#include <ansi.h>
inherit CLOTH;
void create()
{
set_name(MAG"粉红绸衫"NOR, ({ "pink cloth", "cloth" }) );
set_weight(1000);
if( clonep() )
set_default_object(__FILE__);
else {
set("long", "这件粉红色的绸衫上面绣着几只黄鹊,闻起来还有一股淡香。\n");
set("unit", "件");
set("material", "cloth");
set("armor_prop/armor", 1);
set("armor_prop/personality", 3);
set("female_only", 1);
}
setup();
}
| [
"i@chenxuefeng.cn"
] | i@chenxuefeng.cn |
987d258ff2b9b566aea45d0891a320f38ae69953 | 83b818c992ff787678365930a17b3da9c9f74596 | /includes/philo_one.h | 2efa1171e4e6f8f1279a103e67ec35c32a690ed0 | [] | no_license | axesthump/philo | d859b5c05e530818348670b0900c31403caecf2d | ddaec66ded74dcb83e361765db408cabfa56f738 | refs/heads/master | 2023-01-08T17:14:30.657429 | 2020-11-13T17:19:26 | 2020-11-13T17:19:26 | 312,639,267 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,426 | h | //
// Created by Cave Submarine on 11/11/20.
//
#ifndef PHILO_PHILO_ONE_H
#define PHILO_PHILO_ONE_H
#include <unistd.h>
#include <sys/time.h>
#include <pthread.h>
#include <stdlib.h>
typedef struct s_args
{
int num_philo;
int time_to_die;
int time_to_eat;
int time_to_sleep;
int num_of_times_each_philo_must_eat;
} t_args;
typedef struct s_philo
{
int id;
pthread_t thread;
pthread_mutex_t *left;
pthread_mutex_t *right;
struct s_table *table;
long last_eat;
long start_sim;
int must_eat;
} t_philo;
typedef struct s_table
{
t_philo *philos;
pthread_mutex_t *forks;
t_args *args;
pthread_mutex_t change_die;
pthread_mutex_t try_get_time;
pthread_mutex_t try_print;
int some_one_die;
} t_table;
int validate_and_parse(char **argv, int argc, t_args *args);
int print_error(int err);
int init_table(t_table *table, t_args *args);
int ft_isdigit(int c);
int ft_atoi(const char *nptr);
void *life_simulation(void *t);
void ft_putstr_fd(char *s, int fd);
void ft_putchar_fd(char c, int fd);
size_t ft_strlen(const char *str);
size_t ft_strlcpy(char *dst, const char *src, size_t size);
size_t ft_strlcat(char *dst, const char *s, size_t size);
char *ft_strjoin(char const *s1, char const *s2, char const *s3,
char const *s4);
char *ft_itoa(long n);
long get_time(void);
#endif //PHILO_PHILO_ONE_H
| [
"casubmar@si-f1.kzn.21-school.ru"
] | casubmar@si-f1.kzn.21-school.ru |
a06a6f1a7d3fa6c9eb333d688c0591542fcf4cc7 | 8272157dbc691b84498feebeaf55264fbba3ae00 | /getproclibstatic/getproclib.h | 3b3699b7c05cb99b24a6ff38952abefca188eca3 | [
"MIT"
] | permissive | ExpLife0011/getproclib | cc297dda64a83c7b50b806005708a484b8b13b96 | 43ad96e65b9f9485f02cc2f3c2c7e4b1effc5877 | refs/heads/master | 2020-03-10T13:44:52.972996 | 2015-07-29T13:15:47 | 2015-07-29T13:15:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,653 | h | /*
MIT License
Copyright (c) <2015> <David Reguera Garcia aka Dreg - dreg@fr33project.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef GETPROCLIB_EXPORTS // when building DLL, target project defines this macro
#define GETPROCLIB_API __declspec(dllexport)
#elif defined(GETPROCLIB_IMPORTS) // when using DLL, client project defines this macro
#define GETPROCLIB_API __declspec(dllimport)
#else // when building or using target static library, or whatever: define it as nothing
#define GETPROCLIB_API
#endif
#ifndef _GET_PROC_LIB_H__
#define _GET_PROC_LIB_H__
#include <stdlib.h>
#include <windows.h>
#include "prepos.h"
#define CONCAT(x, y) x ## y
#define CONCAT2(x, y) CONCAT(x, y)
#define FUNC_NAME(name) CONCAT2(START_FUNC, CONCAT2(name, END_FUNC))
#define FUNC_TYPEF(name) CONCAT2(START_TYPDEF_FUNC, CONCAT2(name, END_TYPDEF_FUNC))
#define FUNC_DEC_PRE_DEF(returnf, typef, name, pre_def, ...) \
typedef returnf (typef * FUNC_TYPEF(name)) ( __VA_ARGS__); \
pre_def FUNC_TYPEF(name) FUNC_NAME(name);
#define FUNC_DEC(returnf, typef, name, ...) \
typedef returnf (typef * FUNC_TYPEF(name)) ( __VA_ARGS__); \
FUNC_TYPEF(name) FUNC_NAME(name);
#define SET_PTR_FUNC_VALUE(name, value) FUNC_NAME(name) = (FUNC_TYPEF(name)) value;
#define FUNC_DEC_VALUE(returnf, typef, name, value, ...) \
typedef returnf (typef * FUNC_TYPEF(name)) ( __VA_ARGS__); \
FUNC_TYPEF(name) SET_PTR_FUNC_VALUE(name, value);
#define FUNC_DEC_VALUE_PRE_DEF(returnf, typef, name, pre_def, value, ...) \
typedef returnf (typef * FUNC_TYPEF(name)) ( __VA_ARGS__); \
pre_def FUNC_TYPEF(name) SET_PTR_FUNC_VALUE(name, value);
#define API_TAB_ENTRY_END {NULL, NULL, 0, NULL, 0, true}
typedef struct
{
void * api_addr;
char * api_name;
bool need_resolv;
void ** func_ptr;
bool optional;
bool end;
} API_TAB_t;
#define LIB_API_TAB_CREATE_t(type_lib_name, endt) typedef struct \
{ \
type_lib_name lib_name; \
bool load_library; \
API_TAB_t * api_table; \
bool optional; \
bool end; \
bool ignore; \
} CONCAT2(LIB_API_TAB_, endt) ## _t;
#define LIB_API_TAB_ENTRY_END {NULL, 0, NULL, 0, true, false}
LIB_API_TAB_CREATE_t(LPCWSTR, W)
LIB_API_TAB_CREATE_t(char *, A)
#ifdef UNICODE
#define LIB_API_TAB_t CONCAT2(LIB_API_TAB_, W) ## _t
#else
#define LIB_API_TAB_t CONCAT2(LIB_API_TAB_, A) ## _t
#endif // !UNICODE
#define LIB_API_TAB_GEN(typef, name, ...) typef name [] = { \
__VA_ARGS__ ,\
LIB_API_TAB_ENTRY_END \
};
#define LIB_API_TAB(name_table, ...) LIB_API_TAB_GEN(LIB_API_TAB_t, name_table, __VA_ARGS__)
#define LIB_API_TAB_A(name_table, ...) LIB_API_TAB_GEN(LIB_API_TAB_A_t, name_table, __VA_ARGS__)
#define LIB_API_TAB_W(name_table, ...) LIB_API_TAB_GEN(LIB_API_TAB_W_t, name_table, __VA_ARGS__)
#define API_TAB(name_table, ...) API_TAB_t name_table [] = { \
__VA_ARGS__ ,\
API_TAB_ENTRY_END \
};
#define API_TAB_ASSERT(ct, name_table, ...) API_TAB(name_table, __VA_ARGS__) \
static_assert(ct == ARRAYSIZE(name_table) - 1, "The table nr elements and ct must be the same");
typedef enum
{
GP_RET_ERR = -1,
GP_RET_OK = 0,
GP_RET_ERR_MEMALLOC,
GP_RET_ERR_CONVUNICODE,
GP_RET_ERR_GETADDRLIB,
GP_RET_ERR_GETADDRFUNC
} GP_RET_t;
typedef struct
{
union
{
DWORD last_ERR;
};
} GP_EXT_ERR_t;
GETPROCLIB_API GP_RET_t GetProcW(
_In_ LIB_API_TAB_W_t * lib_api_tabs,
_Inout_opt_ int * lib_i,
_Inout_opt_ int * api_i,
_Inout_opt_ GP_EXT_ERR_t * ext_err
);
GETPROCLIB_API GP_RET_t GetProcA(
_In_ LIB_API_TAB_A_t * lib_api_tabs,
_Inout_opt_ int * lib_i,
_Inout_opt_ int * api_i,
_Inout_opt_ GP_EXT_ERR_t * ext_err
);
#ifdef UNICODE
#define GetProc GetProcW
#else
#define GetProc GetProcA
#endif // !UNICODE
#endif /* _GET_PROC_LIB_H__ */ | [
"dreguera@buguroo.com"
] | dreguera@buguroo.com |
d9a464c1969f33eca6322feade78c72469d8ec67 | 5d3fcc6d8f3e5d0e97e20e8551726f546daa9e41 | /core/udp.c | b5e472d6a11bbacc36ce3eb821fe7af09f80f993 | [] | no_license | w545029118/Autosar-Ethernet-stack- | 5491bc01203b956188b25af16273708b7b39fa3c | a0150b4ba3985724911aeb976cd283e1878c93bc | refs/heads/main | 2023-01-25T00:25:38.201220 | 2020-12-08T14:52:36 | 2020-12-08T14:52:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 36,808 | c | /**
* @file
* User Datagram Protocol module
*
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
/* udp.c
*
* The code for the User Datagram Protocol UDP & UDPLite (RFC 3828).
*
*/
/* @todo Check the use of '(struct udp_pcb).chksum_len_rx'!
*/
#include "lwip/opt.h"
#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */
#include "lwip/udp.h"
#include "lwip/def.h"
#include "lwip/memp.h"
#include "lwip/inet_chksum.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#include "lwip/icmp.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "arch/perf.h"
#include "lwip/dhcp.h"
#include <string.h>
extern void
UARTprintf(const char *pcString, ...);
#ifndef UDP_LOCAL_PORT_RANGE_START
/* From http://www.iana.org/assignments/port-numbers:
"The Dynamic and/or Private Ports are those from 49152 through 65535" */
#define UDP_LOCAL_PORT_RANGE_START 0xc000
#define UDP_LOCAL_PORT_RANGE_END 0xffff
#define UDP_ENSURE_LOCAL_PORT_RANGE(port) (((port) & ~UDP_LOCAL_PORT_RANGE_START) + UDP_LOCAL_PORT_RANGE_START)
#endif
/* last local UDP port */
static u16_t udp_port = UDP_LOCAL_PORT_RANGE_START;
/* The list of UDP PCBs */
/* exported in udp.h (was static) */
struct udp_pcb *udp_pcbs;
/**
* Initialize this module.
*/
void
udp_init(void)
{
#if LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND)
udp_port = UDP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND());
#endif /* LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS && defined(LWIP_RAND) */
}
/**
* Allocate a new local UDP port.
*
* @return a new (free) local UDP port number
*/
static u16_t
udp_new_port(void)
{
u16_t n = 0;
struct udp_pcb *pcb;
again:
if (udp_port++ == UDP_LOCAL_PORT_RANGE_END) {
udp_port = UDP_LOCAL_PORT_RANGE_START;
}
/* Check all PCBs. */
for(pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
if (pcb->local_port == udp_port) {
if (++n > (UDP_LOCAL_PORT_RANGE_END - UDP_LOCAL_PORT_RANGE_START)) {
return 0;
}
goto again;
}
}
return udp_port;
#if 0
struct udp_pcb *ipcb = udp_pcbs;
while ((ipcb != NULL) && (udp_port != UDP_LOCAL_PORT_RANGE_END)) {
if (ipcb->local_port == udp_port) {
/* port is already used by another udp_pcb */
udp_port++;
/* restart scanning all udp pcbs */
ipcb = udp_pcbs;
} else {
/* go on with next udp pcb */
ipcb = ipcb->next;
}
}
if (ipcb != NULL) {
return 0;
}
return udp_port;
#endif
}
/**
* Process an incoming UDP datagram.
*
* Given an incoming UDP datagram (as a chain of pbufs) this function
* finds a corresponding UDP PCB and hands over the pbuf to the pcbs
* recv function. If no pcb is found or the datagram is incorrect, the
* pbuf is freed.
*
* @param p pbuf to be demultiplexed to a UDP PCB.
* @param inp network interface on which the datagram was received.
*
*/
void
udp_input(struct pbuf *p, struct netif *inp)
{
struct udp_hdr *udphdr;
struct udp_pcb *pcb, *prev;
struct udp_pcb *uncon_pcb;
struct ip_hdr *iphdr;
u16_t src, dest;
u8_t local_match;
u8_t broadcast;
PERF_START;
UDP_STATS_INC(udp.recv);
iphdr = (struct ip_hdr *)p->payload;
/* Check minimum length (IP header + UDP header)
* and move payload pointer to UDP header */
if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
/* drop short packets */
LWIP_DEBUGF(UDP_DEBUG,
("udp_input: short UDP datagram (%"U16_F" bytes) discarded\n", p->tot_len));
UDP_STATS_INC(udp.lenerr);
UDP_STATS_INC(udp.drop);
snmp_inc_udpinerrors();
pbuf_free(p);
goto end;
}
udphdr = (struct udp_hdr *)p->payload;
/* is broadcast packet ? */
broadcast = ip_addr_isbroadcast(¤t_iphdr_dest, inp);
LWIP_DEBUGF(UDP_DEBUG, ("udp_input: received datagram of length %"U16_F"\n", p->tot_len));
/* convert src and dest ports to host byte order */
src = ntohs(udphdr->src);
dest = ntohs(udphdr->dest);
udp_debug_print(udphdr);
/* print the UDP source and destination */
LWIP_DEBUGF(UDP_DEBUG,
("udp (%"U16_F".%"U16_F".%"U16_F".%"U16_F", %"U16_F") <-- "
"(%"U16_F".%"U16_F".%"U16_F".%"U16_F", %"U16_F")\n",
ip4_addr1_16(&iphdr->dest), ip4_addr2_16(&iphdr->dest),
ip4_addr3_16(&iphdr->dest), ip4_addr4_16(&iphdr->dest), ntohs(udphdr->dest),
ip4_addr1_16(&iphdr->src), ip4_addr2_16(&iphdr->src),
ip4_addr3_16(&iphdr->src), ip4_addr4_16(&iphdr->src), ntohs(udphdr->src)));
#if LWIP_DHCP
pcb = NULL;
/* when LWIP_DHCP is active, packets to DHCP_CLIENT_PORT may only be processed by
the dhcp module, no other UDP pcb may use the local UDP port DHCP_CLIENT_PORT */
if (dest == DHCP_CLIENT_PORT) {
/* all packets for DHCP_CLIENT_PORT not coming from DHCP_SERVER_PORT are dropped! */
if (src == DHCP_SERVER_PORT) {
if ((inp->dhcp != NULL) && (inp->dhcp->pcb != NULL)) {
/* accept the packe if
(- broadcast or directed to us) -> DHCP is link-layer-addressed, local ip is always ANY!
- inp->dhcp->pcb->remote == ANY or iphdr->src */
if ((ip_addr_isany(&inp->dhcp->pcb->remote_ip) ||
ip_addr_cmp(&(inp->dhcp->pcb->remote_ip), ¤t_iphdr_src))) {
pcb = inp->dhcp->pcb;
}
}
}
} else
#endif /* LWIP_DHCP */
{
prev = NULL;
local_match = 0;
uncon_pcb = NULL;
/* Iterate through the UDP pcb list for a matching pcb.
* 'Perfect match' pcbs (connected to the remote port & ip address) are
* preferred. If no perfect match is found, the first unconnected pcb that
* matches the local port and ip address gets the datagram. */
for (pcb = udp_pcbs; pcb != NULL; pcb = pcb->next) {
local_match = 0;
/* print the PCB local and remote address */
LWIP_DEBUGF(UDP_DEBUG,
("pcb (%"U16_F".%"U16_F".%"U16_F".%"U16_F", %"U16_F") --- "
"(%"U16_F".%"U16_F".%"U16_F".%"U16_F", %"U16_F")\n",
ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip), pcb->local_port,
ip4_addr1_16(&pcb->remote_ip), ip4_addr2_16(&pcb->remote_ip),
ip4_addr3_16(&pcb->remote_ip), ip4_addr4_16(&pcb->remote_ip), pcb->remote_port));
/* compare PCB local addr+port to UDP destination addr+port */
if (pcb->local_port == dest) {
if (
(!broadcast && ip_addr_isany(&pcb->local_ip)) ||
ip_addr_cmp(&(pcb->local_ip), ¤t_iphdr_dest) ||
#if LWIP_IGMP
ip_addr_ismulticast(¤t_iphdr_dest) ||
#endif /* LWIP_IGMP */
#if IP_SOF_BROADCAST_RECV
(broadcast && ip_get_option(pcb, SOF_BROADCAST) &&
(ip_addr_isany(&pcb->local_ip) ||
ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
#else /* IP_SOF_BROADCAST_RECV */
(broadcast &&
(ip_addr_isany(&pcb->local_ip) ||
ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask)))) {
#endif /* IP_SOF_BROADCAST_RECV */
local_match = 1;
if ((uncon_pcb == NULL) &&
((pcb->flags & UDP_FLAGS_CONNECTED) == 0)) {
/* the first unconnected matching PCB */
uncon_pcb = pcb;
}
}
}
/* compare PCB remote addr+port to UDP source addr+port */
if ((local_match != 0) &&
(pcb->remote_port == src) &&
(ip_addr_isany(&pcb->remote_ip) ||
ip_addr_cmp(&(pcb->remote_ip), ¤t_iphdr_src))) {
/* the first fully matching PCB */
if (prev != NULL) {
/* move the pcb to the front of udp_pcbs so that is
found faster next time */
prev->next = pcb->next;
pcb->next = udp_pcbs;
udp_pcbs = pcb;
} else {
UDP_STATS_INC(udp.cachehit);
}
break;
}
prev = pcb;
}
/* no fully matching pcb found? then look for an unconnected pcb */
if (pcb == NULL) {
pcb = uncon_pcb;
}
}
/* Check checksum if this is a match or if it was directed at us. */
if (pcb != NULL || ip_addr_cmp(&inp->ip_addr, ¤t_iphdr_dest)) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: calculating checksum\n"));
#if LWIP_UDPLITE
if (IPH_PROTO(iphdr) == IP_PROTO_UDPLITE) {
/* Do the UDP Lite checksum */
#if CHECKSUM_CHECK_UDP
u16_t chklen = ntohs(udphdr->len);
if (chklen < sizeof(struct udp_hdr)) {
if (chklen == 0) {
/* For UDP-Lite, checksum length of 0 means checksum
over the complete packet (See RFC 3828 chap. 3.1) */
chklen = p->tot_len;
} else {
/* At least the UDP-Lite header must be covered by the
checksum! (Again, see RFC 3828 chap. 3.1) */
UDP_STATS_INC(udp.chkerr);
UDP_STATS_INC(udp.drop);
snmp_inc_udpinerrors();
pbuf_free(p);
goto end;
}
}
if (inet_chksum_pseudo_partial(p, ¤t_iphdr_src, ¤t_iphdr_dest,
IP_PROTO_UDPLITE, p->tot_len, chklen) != 0) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
("udp_input: UDP Lite datagram discarded due to failing checksum\n"));
UDP_STATS_INC(udp.chkerr);
UDP_STATS_INC(udp.drop);
snmp_inc_udpinerrors();
pbuf_free(p);
goto end;
}
#endif /* CHECKSUM_CHECK_UDP */
} else
#endif /* LWIP_UDPLITE */
{
#if CHECKSUM_CHECK_UDP
if (udphdr->chksum != 0) {
if (inet_chksum_pseudo(p, ip_current_src_addr(), ip_current_dest_addr(),
IP_PROTO_UDP, p->tot_len) != 0) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
("udp_input: UDP datagram discarded due to failing checksum\n"));
UDP_STATS_INC(udp.chkerr);
UDP_STATS_INC(udp.drop);
snmp_inc_udpinerrors();
pbuf_free(p);
goto end;
}
}
#endif /* CHECKSUM_CHECK_UDP */
}
if(pbuf_header(p, -UDP_HLEN)) {
/* Can we cope with this failing? Just assert for now */
LWIP_ASSERT("pbuf_header failed\n", 0);
UDP_STATS_INC(udp.drop);
snmp_inc_udpinerrors();
pbuf_free(p);
goto end;
}
if (pcb != NULL) {
snmp_inc_udpindatagrams();
#if SO_REUSE && SO_REUSE_RXTOALL
if ((broadcast || ip_addr_ismulticast(¤t_iphdr_dest)) &&
ip_get_option(pcb, SOF_REUSEADDR)) {
/* pass broadcast- or multicast packets to all multicast pcbs
if SOF_REUSEADDR is set on the first match */
struct udp_pcb *mpcb;
u8_t p_header_changed = 0;
for (mpcb = udp_pcbs; mpcb != NULL; mpcb = mpcb->next) {
if (mpcb != pcb) {
/* compare PCB local addr+port to UDP destination addr+port */
if ((mpcb->local_port == dest) &&
((!broadcast && ip_addr_isany(&mpcb->local_ip)) ||
ip_addr_cmp(&(mpcb->local_ip), ¤t_iphdr_dest) ||
#if LWIP_IGMP
ip_addr_ismulticast(¤t_iphdr_dest) ||
#endif /* LWIP_IGMP */
#if IP_SOF_BROADCAST_RECV
(broadcast && ip_get_option(mpcb, SOF_BROADCAST)))) {
#else /* IP_SOF_BROADCAST_RECV */
(broadcast))) {
#endif /* IP_SOF_BROADCAST_RECV */
/* pass a copy of the packet to all local matches */
if (mpcb->recv != NULL) {
struct pbuf *q;
/* for that, move payload to IP header again */
if (p_header_changed == 0) {
pbuf_header(p, (s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
p_header_changed = 1;
}
q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
if (q != NULL) {
err_t err = pbuf_copy(q, p);
if (err == ERR_OK) {
/* move payload to UDP data */
pbuf_header(q, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
mpcb->recv(mpcb->recv_arg, mpcb, q, ip_current_src_addr(), src);
}
}
}
}
}
}
if (p_header_changed) {
/* and move payload to UDP data again */
pbuf_header(p, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
}
}
#endif /* SO_REUSE && SO_REUSE_RXTOALL */
/* callback */
if (pcb->recv != NULL) {
/* now the recv function is responsible for freeing p */
pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr(), src);
UARTprintf("\n");
UARTprintf("UDP Received >> src = %d ,dest = %d , len = %d \n", ntohs(udphdr->src) , ntohs(udphdr->dest) , p->tot_len );
UARTprintf("\n");
} else {
/* no recv function registered? then we have to free the pbuf! */
pbuf_free(p);
goto end;
}
} else {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_input: not for us.\n"));
#if LWIP_ICMP
/* No match was found, send ICMP destination port unreachable unless
destination address was broadcast/multicast. */
if (!broadcast &&
!ip_addr_ismulticast(¤t_iphdr_dest)) {
/* move payload pointer back to ip header */
pbuf_header(p, (IPH_HL(iphdr) * 4) + UDP_HLEN);
LWIP_ASSERT("p->payload == iphdr", (p->payload == iphdr));
icmp_dest_unreach(p, ICMP_DUR_PORT);
}
#endif /* LWIP_ICMP */
UDP_STATS_INC(udp.proterr);
UDP_STATS_INC(udp.drop);
snmp_inc_udpnoports();
pbuf_free(p);
}
} else {
pbuf_free(p);
}
end:
PERF_STOP("udp_input");
}
/**
* Send data using UDP.
*
* @param pcb UDP PCB used to send the data.
* @param p chain of pbuf's to be sent.
*
* The datagram will be sent to the current remote_ip & remote_port
* stored in pcb. If the pcb is not bound to a port, it will
* automatically be bound to a random port.
*
* @return lwIP error code.
* - ERR_OK. Successful. No error occured.
* - ERR_MEM. Out of memory.
* - ERR_RTE. Could not find route to destination address.
* - More errors could be returned by lower protocol layers.
*
* @see udp_disconnect() udp_sendto()
*/
//err_t
//udp_send(struct udp_pcb *pcb, struct pbuf *p)
//{
// /* send to the packet using remote ip and port stored in the pcb */
// return udp_sendto(pcb, p, &pcb->remote_ip, pcb->remote_port);
//}
err_t udp_send(struct udp_pcb *pcb, void * data, u16_t len, ip_addr_t *dst_ip, u16_t dst_port)
{
struct udp_hdr *udphdr;
ip_addr_t *src_ip;
err_t err;
struct pbuf *p;
if (pcb->local_port == 0) /* if the PCB is not yet bound to a port, bind it here */
{
err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
if (err != ERR_OK)
{return err;}
} //q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
if ( (p = pbuf_alloc(PBUF_udp, len,PBUF_RAM) )== NULL) { return ERR_MEM;} /* not enough space */ // Length of data only and payload point to the start of data
memcpy(p->payload,(u8_t*)data ,len);
pbuf_header(p, UDP_HLEN);
udphdr = (struct udp_hdr *)p->payload;
udphdr->src = htons(pcb->local_port);
udphdr->dest = htons(dst_port);
udphdr->chksum = 0x0000;
src_ip = &(pcb->local_ip);
udphdr->len = htons(p->tot_len);
u16_t udpchksum = inet_chksum_pseudo(p, src_ip, dst_ip, IP_PROTO_UDP, p->tot_len);/* calculate checksum */
if (udpchksum == 0x0000) /* chksum zero must become 0xffff, as zero means 'no checksum' */
{udpchksum = 0xffff; }
udphdr->chksum = udpchksum;
p->free_buffer =1;
UARTprintf("\n");
UARTprintf("UDP Transmit >> src = %d ,dest = %d , len = %d \n", ntohs(udphdr->src) , ntohs(udphdr->dest) , ntohs(udphdr->len) - 8 );
UARTprintf("\n");
err = ip_output(p, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP );
//pbuf_free(p);
return err;
}
#if LWIP_CHECKSUM_ON_COPY
/** Same as udp_send() but with checksum
*/
err_t
udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p,
u8_t have_chksum, u16_t chksum)
{
/* send to the packet using remote ip and port stored in the pcb */
return udp_sendto_chksum(pcb, p, &pcb->remote_ip, pcb->remote_port,
have_chksum, chksum);
}
#endif /* LWIP_CHECKSUM_ON_COPY */
/**
* Send data to a specified address using UDP.
*
* @param pcb UDP PCB used to send the data.
* @param p chain of pbuf's to be sent.
* @param dst_ip Destination IP address.
* @param dst_port Destination UDP port.
*
* dst_ip & dst_port are expected to be in the same byte order as in the pcb.
*
* If the PCB already has a remote address association, it will
* be restored after the data is sent.
*
* @return lwIP error code (@see udp_send for possible error codes)
*
* @see udp_disconnect() udp_send()
*/
err_t
udp_sendto(struct udp_pcb *pcb, struct pbuf *p,ip_addr_t *dst_ip, u16_t dst_port)
{
#if LWIP_CHECKSUM_ON_COPY
return udp_sendto_chksum(pcb, p, dst_ip, dst_port, 0, 0);
}
/** Same as udp_sendto(), but with checksum */
err_t
udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip,
u16_t dst_port, u8_t have_chksum, u16_t chksum)
{
#endif /* LWIP_CHECKSUM_ON_COPY */
struct netif *netif;
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send\n"));
/* find the outgoing network interface for this packet */
#if LWIP_IGMP
netif = ip_route((ip_addr_ismulticast(dst_ip))?(&(pcb->multicast_ip)):(dst_ip));
#else
netif = ip_route(dst_ip);
#endif /* LWIP_IGMP */
/* no outgoing network interface could be found? */
if (netif == NULL) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
ip4_addr1_16(dst_ip), ip4_addr2_16(dst_ip), ip4_addr3_16(dst_ip), ip4_addr4_16(dst_ip)));
UDP_STATS_INC(udp.rterr);
return ERR_RTE;
}
#if LWIP_CHECKSUM_ON_COPY
return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, have_chksum, chksum);
#else /* LWIP_CHECKSUM_ON_COPY */
return udp_sendto_if(pcb, p, dst_ip, dst_port, netif);
#endif /* LWIP_CHECKSUM_ON_COPY */
}
/**
* Send data to a specified address using UDP.
* The netif used for sending can be specified.
*
* This function exists mainly for DHCP, to be able to send UDP packets
* on a netif that is still down.
*
* @param pcb UDP PCB used to send the data.
* @param p chain of pbuf's to be sent.
* @param dst_ip Destination IP address.
* @param dst_port Destination UDP port.
* @param netif the netif used for sending.
*
* dst_ip & dst_port are expected to be in the same byte order as in the pcb.
*
* @return lwIP error code (@see udp_send for possible error codes)
*
* @see udp_disconnect() udp_send()
*/
err_t
udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif)
{
#if LWIP_CHECKSUM_ON_COPY
return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, 0, 0);
}
/** Same as udp_sendto_if(), but with checksum */
err_t
udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip,
u16_t dst_port, struct netif *netif, u8_t have_chksum,
u16_t chksum)
{
#endif /* LWIP_CHECKSUM_ON_COPY */
struct udp_hdr *udphdr;
ip_addr_t *src_ip;
err_t err;
struct pbuf *q; /* q will be sent down the stack */
#if IP_SOF_BROADCAST
/* broadcast filter? */
if (!ip_get_option(pcb, SOF_BROADCAST) && ip_addr_isbroadcast(dst_ip, netif)) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
("udp_sendto_if: SOF_BROADCAST not enabled on pcb %p\n", (void *)pcb));
return ERR_VAL;
}
#endif /* IP_SOF_BROADCAST */
/* if the PCB is not yet bound to a port, bind it here */
if (pcb->local_port == 0) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_send: not yet bound to a port, binding now\n"));
err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
if (err != ERR_OK) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: forced port bind failed\n"));
return err;
}
}
/* not enough space to add an UDP header to first pbuf in given p chain? */
if (pbuf_header(p, UDP_HLEN)) {
/* allocate header in a separate new pbuf */
q = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM);
/* new header pbuf could not be allocated? */
if (q == NULL) {
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("udp_send: could not allocate header\n"));
return ERR_MEM;
}
if (p->tot_len != 0) {
/* chain header q in front of given pbuf p (only if p contains data) */
pbuf_chain(q, p);
}
/* first pbuf q points to header pbuf */
LWIP_DEBUGF(UDP_DEBUG,
("udp_send: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p));
} else {
/* adding space for header within p succeeded */
/* first pbuf q equals given pbuf */
q = p;
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));
}
LWIP_ASSERT("check that first pbuf can hold struct udp_hdr",
(q->len >= sizeof(struct udp_hdr)));
/* q now represents the packet to be sent */
udphdr = (struct udp_hdr *)q->payload;
udphdr->src = htons(pcb->local_port);
udphdr->dest = htons(dst_port);
/* in UDP, 0 checksum means 'no checksum' */
udphdr->chksum = 0x0000;
/* Multicast Loop? */
#if LWIP_IGMP
if (ip_addr_ismulticast(dst_ip) && ((pcb->flags & UDP_FLAGS_MULTICAST_LOOP) != 0)) {
q->flags |= PBUF_FLAG_MCASTLOOP;
}
#endif /* LWIP_IGMP */
/* PCB local address is IP_ANY_ADDR? */
if (ip_addr_isany(&pcb->local_ip)) {
/* use outgoing network interface IP address as source address */
src_ip = &(netif->ip_addr);
} else {
/* check if UDP PCB local IP address is correct
* this could be an old address if netif->ip_addr has changed */
if (!ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {
/* local_ip doesn't match, drop the packet */
if (q != p) {
/* free the header pbuf */
pbuf_free(q);
q = NULL;
/* p is still referenced by the caller, and will live on */
}
return ERR_VAL;
}
/* use UDP PCB local IP address as source address */
src_ip = &(pcb->local_ip);
}
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: sending datagram of length %"U16_F"\n", q->tot_len));
#if LWIP_UDPLITE
/* UDP Lite protocol? */
if (pcb->flags & UDP_FLAGS_UDPLITE) {
u16_t chklen, chklen_hdr;
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE packet length %"U16_F"\n", q->tot_len));
/* set UDP message length in UDP header */
chklen_hdr = chklen = pcb->chksum_len_tx;
if ((chklen < sizeof(struct udp_hdr)) || (chklen > q->tot_len)) {
if (chklen != 0) {
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP LITE pcb->chksum_len is illegal: %"U16_F"\n", chklen));
}
/* For UDP-Lite, checksum length of 0 means checksum
over the complete packet. (See RFC 3828 chap. 3.1)
At least the UDP-Lite header must be covered by the
checksum, therefore, if chksum_len has an illegal
value, we generate the checksum over the complete
packet to be safe. */
chklen_hdr = 0;
chklen = q->tot_len;
}
udphdr->len = htons(chklen_hdr);
/* calculate checksum */
#if CHECKSUM_GEN_UDP
udphdr->chksum = inet_chksum_pseudo_partial(q, src_ip, dst_ip,
IP_PROTO_UDPLITE, q->tot_len,
#if !LWIP_CHECKSUM_ON_COPY
chklen);
#else /* !LWIP_CHECKSUM_ON_COPY */
(have_chksum ? UDP_HLEN : chklen));
if (have_chksum) {
u32_t acc;
acc = udphdr->chksum + (u16_t)~(chksum);
udphdr->chksum = FOLD_U32T(acc);
}
#endif /* !LWIP_CHECKSUM_ON_COPY */
/* chksum zero must become 0xffff, as zero means 'no checksum' */
if (udphdr->chksum == 0x0000) {
udphdr->chksum = 0xffff;
}
#endif /* CHECKSUM_GEN_UDP */
/* output to IP */
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDPLITE,)\n"));
NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint);
err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif);
NETIF_SET_HWADDRHINT(netif, NULL);
} else
#endif /* LWIP_UDPLITE */
{ /* UDP */
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));
udphdr->len = htons(q->tot_len);
/* calculate checksum */
#if CHECKSUM_GEN_UDP
if ((pcb->flags & UDP_FLAGS_NOCHKSUM) == 0) {
u16_t udpchksum;
#if LWIP_CHECKSUM_ON_COPY
if (have_chksum) {
u32_t acc;
udpchksum = inet_chksum_pseudo_partial(q, src_ip, dst_ip, IP_PROTO_UDP,
q->tot_len, UDP_HLEN);
acc = udpchksum + (u16_t)~(chksum);
udpchksum = FOLD_U32T(acc);
} else
#endif /* LWIP_CHECKSUM_ON_COPY */
{
udpchksum = inet_chksum_pseudo(q, src_ip, dst_ip, IP_PROTO_UDP, q->tot_len);
}
/* chksum zero must become 0xffff, as zero means 'no checksum' */
if (udpchksum == 0x0000) {
udpchksum = 0xffff;
}
udphdr->chksum = udpchksum;
}
#endif /* CHECKSUM_GEN_UDP */
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));
LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
/* output to IP */
NETIF_SET_HWADDRHINT(netif, &pcb->addr_hint);
err = ip_output_if(q, src_ip, dst_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);
NETIF_SET_HWADDRHINT(netif, NULL);
}
/* TODO: must this be increased even if error occured? */
snmp_inc_udpoutdatagrams();
/* did we chain a separate header pbuf earlier? */
if (q != p) {
/* free the header pbuf */
pbuf_free(q);
q = NULL;
/* p is still referenced by the caller, and will live on */
}
UDP_STATS_INC(udp.xmit);
return err;
}
/**
* Bind an UDP PCB.
*
* @param pcb UDP PCB to be bound with a local address ipaddr and port.
* @param ipaddr local IP address to bind with. Use IP_ADDR_ANY to
* bind to all local interfaces.
* @param port local UDP port to bind with. Use 0 to automatically bind
* to a random port between UDP_LOCAL_PORT_RANGE_START and
* UDP_LOCAL_PORT_RANGE_END.
*
* ipaddr & port are expected to be in the same byte order as in the pcb.
*
* @return lwIP error code.
* - ERR_OK. Successful. No error occured.
* - ERR_USE. The specified ipaddr and port are already bound to by
* another UDP PCB.
*
* @see udp_disconnect()
*/
err_t
udp_bind(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
{
struct udp_pcb *ipcb;
u8_t rebind;
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, ("udp_bind(ipaddr = "));
ip_addr_debug_print(UDP_DEBUG, ipaddr);
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE, (", port = %"U16_F")\n", port));
rebind = 0;
/* Check for double bind and rebind of the same pcb */
for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
/* is this UDP PCB already on active list? */
if (pcb == ipcb) {
/* pcb may occur at most once in active list */
LWIP_ASSERT("rebind == 0", rebind == 0);
/* pcb already in list, just rebind */
rebind = 1;
}
/* By default, we don't allow to bind to a port that any other udp
PCB is alread bound to, unless *all* PCBs with that port have tha
REUSEADDR flag set. */
#if SO_REUSE
else if (!ip_get_option(pcb, SOF_REUSEADDR) &&
!ip_get_option(ipcb, SOF_REUSEADDR)) {
#else /* SO_REUSE */
/* port matches that of PCB in list and REUSEADDR not set -> reject */
else {
#endif /* SO_REUSE */
if ((ipcb->local_port == port) &&
/* IP address matches, or one is IP_ADDR_ANY? */
(ip_addr_isany(&(ipcb->local_ip)) ||
ip_addr_isany(ipaddr) ||
ip_addr_cmp(&(ipcb->local_ip), ipaddr))) {
/* other PCB already binds to this local IP and port */
LWIP_DEBUGF(UDP_DEBUG,
("udp_bind: local port %"U16_F" already bound by another pcb\n", port));
return ERR_USE;
}
}
}
ip_addr_set(&pcb->local_ip, ipaddr);
/* no port specified? */
if (port == 0) {
port = udp_new_port();
if (port == 0) {
/* no more ports available in local range */
LWIP_DEBUGF(UDP_DEBUG, ("udp_bind: out of free UDP ports\n"));
return ERR_USE;
}
}
pcb->local_port = port;
snmp_insert_udpidx_tree(pcb);
/* pcb not active yet? */
if (rebind == 0) {
/* place the PCB on the active list if not already there */
pcb->next = udp_pcbs;
udp_pcbs = pcb;
}
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("udp_bind: bound to %"U16_F".%"U16_F".%"U16_F".%"U16_F", port %"U16_F"\n",
ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
pcb->local_port));
return ERR_OK;
}
/**
* Connect an UDP PCB.
*
* This will associate the UDP PCB with the remote address.
*
* @param pcb UDP PCB to be connected with remote address ipaddr and port.
* @param ipaddr remote IP address to connect with.
* @param port remote UDP port to connect with.
*
* @return lwIP error code
*
* ipaddr & port are expected to be in the same byte order as in the pcb.
*
* The udp pcb is bound to a random local port if not already bound.
*
* @see udp_disconnect()
*/
err_t
udp_connect(struct udp_pcb *pcb, ip_addr_t *ipaddr, u16_t port)
{
struct udp_pcb *ipcb;
if (pcb->local_port == 0) {
err_t err = udp_bind(pcb, &pcb->local_ip, pcb->local_port);
if (err != ERR_OK) {
return err;
}
}
ip_addr_set(&pcb->remote_ip, ipaddr);
pcb->remote_port = port;
pcb->flags |= UDP_FLAGS_CONNECTED;
/** TODO: this functionality belongs in upper layers */
#ifdef LWIP_UDP_TODO
/* Nail down local IP for netconn_addr()/getsockname() */
if (ip_addr_isany(&pcb->local_ip) && !ip_addr_isany(&pcb->remote_ip)) {
struct netif *netif;
if ((netif = ip_route(&(pcb->remote_ip))) == NULL) {
LWIP_DEBUGF(UDP_DEBUG, ("udp_connect: No route to 0x%lx\n", pcb->remote_ip.addr));
UDP_STATS_INC(udp.rterr);
return ERR_RTE;
}
/** TODO: this will bind the udp pcb locally, to the interface which
is used to route output packets to the remote address. However, we
might want to accept incoming packets on any interface! */
pcb->local_ip = netif->ip_addr;
} else if (ip_addr_isany(&pcb->remote_ip)) {
pcb->local_ip.addr = 0;
}
#endif
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE,
("udp_connect: connected to %"U16_F".%"U16_F".%"U16_F".%"U16_F",port %"U16_F"\n",
ip4_addr1_16(&pcb->local_ip), ip4_addr2_16(&pcb->local_ip),
ip4_addr3_16(&pcb->local_ip), ip4_addr4_16(&pcb->local_ip),
pcb->local_port));
/* Insert UDP PCB into the list of active UDP PCBs. */
for (ipcb = udp_pcbs; ipcb != NULL; ipcb = ipcb->next) {
if (pcb == ipcb) {
/* already on the list, just return */
return ERR_OK;
}
}
/* PCB not yet on the list, add PCB now */
pcb->next = udp_pcbs;
udp_pcbs = pcb;
return ERR_OK;
}
/**
* Disconnect a UDP PCB
*
* @param pcb the udp pcb to disconnect.
*/
void
udp_disconnect(struct udp_pcb *pcb)
{
/* reset remote address association */
ip_addr_set_any(&pcb->remote_ip);
pcb->remote_port = 0;
/* mark PCB as unconnected */
pcb->flags &= ~UDP_FLAGS_CONNECTED;
}
/**
* Set a receive callback for a UDP PCB
*
* This callback will be called when receiving a datagram for the pcb.
*
* @param pcb the pcb for wich to set the recv callback
* @param recv function pointer of the callback function
* @param recv_arg additional argument to pass to the callback function
*/
void
udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg)
{
/* remember recv() callback and user data */
pcb->recv = recv;
pcb->recv_arg = recv_arg;
}
/**
* Remove an UDP PCB.
*
* @param pcb UDP PCB to be removed. The PCB is removed from the list of
* UDP PCB's and the data structure is freed from memory.
*
* @see udp_new()
*/
void
udp_remove(struct udp_pcb *pcb)
{
struct udp_pcb *pcb2;
snmp_delete_udpidx_tree(pcb);
/* pcb to be removed is first in list? */
if (udp_pcbs == pcb) {
/* make list start at 2nd pcb */
udp_pcbs = udp_pcbs->next;
/* pcb not 1st in list */
} else {
for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
/* find pcb in udp_pcbs list */
if (pcb2->next != NULL && pcb2->next == pcb) {
/* remove pcb from list */
pcb2->next = pcb->next;
}
}
}
memp_free(MEMP_UDP_PCB, pcb);
}
/**
* Create a UDP PCB.
*
* @return The UDP PCB which was created. NULL if the PCB data structure
* could not be allocated.
*
* @see udp_remove()
*/
struct udp_pcb *
udp_new(void)
{
struct udp_pcb *pcb;
pcb = (struct udp_pcb *)memp_malloc(MEMP_UDP_PCB);
/* could allocate UDP PCB? */
if (pcb != NULL) {
/* UDP Lite: by initializing to all zeroes, chksum_len is set to 0
* which means checksum is generated over the whole datagram per default
* (recommended as default by RFC 3828). */
/* initialize PCB to all zeroes */
memset(pcb, 0, sizeof(struct udp_pcb));
pcb->ttl = UDP_TTL;
}
return pcb;
}
#if UDP_DEBUG
/**
* Print UDP header information for debug purposes.
*
* @param udphdr pointer to the udp header in memory.
*/
void
udp_debug_print(struct udp_hdr *udphdr)
{
LWIP_DEBUGF(UDP_DEBUG, ("UDP header:\n"));
LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n"));
LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | %5"U16_F" | (src port, dest port)\n",
ntohs(udphdr->src), ntohs(udphdr->dest)));
LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n"));
LWIP_DEBUGF(UDP_DEBUG, ("| %5"U16_F" | 0x%04"X16_F" | (len, chksum)\n",
ntohs(udphdr->len), ntohs(udphdr->chksum)));
LWIP_DEBUGF(UDP_DEBUG, ("+-------------------------------+\n"));
}
#endif /* UDP_DEBUG */
#endif /* LWIP_UDP */
| [
"noreply@github.com"
] | w545029118.noreply@github.com |
25d50ba19ce54df2cd24ac30013358530a005c46 | c84462fed944505922efe37630e5da120ede84de | /components/voice_assistant/include/aia.h | dfcc1181fec2ca7833a70daab47ebfd2b2f4bf02 | [
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | stone-tong/esp-va-sdk | 46c52195a4532fc8d2e1dfbec5a381cdd93c0e34 | d2f67dbfb127fb8d48b708612304194070cb18be | refs/heads/master | 2023-08-25T03:47:35.847499 | 2021-10-08T07:47:47 | 2021-10-08T07:47:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,038 | h | // Copyright 2018 Espressif Systems (Shanghai) PTE LTD
// All rights reserved.
#ifndef _AIA_H_
#define _AIA_H_
#include "voice_assistant.h"
#include "auth_delegate.h"
#include <mqtt_client.h>
#include <alexa_smart_home.h>
/* Once assigned by the application, these should not be freed as long as the device is working. */
typedef struct {
/* Certificate of aws root CA */
char *aws_root_ca_pem_cert;
/* Device certificate */
char *certificate_pem_crt_cert;
/* Private Key */
char *private_pem_crt_cert;
/* AWS Account ID */
char *aws_account_id;
/* AWS End Point */
char *aws_endpoint;
/* Client id used to communicate with the cloud */
char *client_id;
} device_config_t;
/** The Alexa Configuration Structure
*/
typedef struct {
char *device_serial_num;
char *product_id;
device_config_t device_config;
} aia_config_t;
/** Initialize Alexa
*
* This call must be made after the Wi-Fi connection has been established with the configured Access Point.
*
* \param[in] cfg The Alexa Configuration
*
* \return
* - 0 on Success
* - an error code otherwise
*/
int aia_init(aia_config_t *cfg);
int aia_early_init();
/** Initialise Alexa Bluetooth
*
* This enables Alexa's Bluetooth A2DP sink functionality.
*/
int alexa_bluetooth_init();
/** Enable Larger tones.
*
* This API will enable a tone which would be played if dialog is in progress and timer/alarm goes off.
* Enabling this tone would increase size of binary by around 356 KB.
*/
void alexa_tone_enable_larger_tones();
void alexa_auth_delegate_signin(auth_delegate_config_t *cfg);
void alexa_auth_delegate_signout();
void alexa_signin_handler(const char *client_id, const char *refresh_token);
void alexa_signout_handler();
/* These APIs can be called to use the existing AIS mqtt client. */
/* This api givies the status of the aws_iot connection. */
bool alexa_mqtt_is_connected();
/**
* @brief Get pointer to Alexa config
*/
aia_config_t *aia_get_cfg();
#endif /*_AIA_H_ */
| [
"chirag.atal@espressif.com"
] | chirag.atal@espressif.com |
933d2254a6de78598baa9244507c5bc2aaf4bbea | 9740d2a4a8dc1e303c8ac96dabd01d564f6237f7 | /Operations.h | 8ab5242dc802148d0f37a1df020fa3d03cb47dcd | [] | no_license | hugocbp/hotel_booking_manager | 5552f091dc902a22930e8497f2b8f17d40aa7ca7 | 27956356eb9f87e97a1a40497ae84bfda915dbcf | refs/heads/master | 2020-07-11T10:33:31.469675 | 2019-10-04T18:31:45 | 2019-10-04T18:31:45 | 204,514,802 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 335 | h | // OPTIONAL CLASS
/**
** Program Name: Hotel Manager
** File Name: Operations.h
** Purpose: Optional class to count total operations of the program
** Author: Hugo Carlos Borges Pinto (@hugocbp)
** Date: May 17, 2019
*/
#ifndef OPS_H_
#define OPS_H_
// Creates global variable to coun all loop iterations
extern long long ops;
#endif | [
"hugocbp@gmail.com"
] | hugocbp@gmail.com |
6af962de7d9545c5be67e2da3484ba9ffcdd0579 | f29184420e8feca7a341328f4d57ac88abf56f46 | /codeup 4621.c | a0f2cde07a46c9447be67416052ca3973e982702 | [] | no_license | jojunhui125/Codeup | 743c9bd5d9d68fb09002b1388365d10b2f4ee379 | 0a7e3c0763e720e8d14cb0efc3dfd40e733707e0 | refs/heads/master | 2023-06-29T19:31:14.843688 | 2021-08-03T06:01:58 | 2021-08-03T06:01:58 | 389,051,877 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 312 | c | # include <stdio.h>
int main()
{
int n, k;
int arr[10000] = { 0 };
scanf("%d %d", &n, &k);
int p = 0;
for (int i = 1; i <= n; i++)
{
if (n % i == 0)
{
arr[p] = i;
p++;
}
}
if (arr[k] == 0)
{
printf("0");
}
else
{
printf("%d", arr[k-1]);
}
return;
}
| [
"noreply@github.com"
] | jojunhui125.noreply@github.com |
8def10241ecbf68de2f9ac82bdd9a21e6241594a | fc4d607383b3d934db24102789494564b03ad105 | /selection.c | 3d660dffc5033615449521e0fde6abf6313ed810 | [] | no_license | SergiiGlad/workspace | ebd3376f9a99cbeabe2b1c7eb0ad76a8fc18c9f8 | 8278e3ee65531445f4ca815a6118f644a227b5a9 | refs/heads/master | 2021-04-25T02:04:18.537431 | 2017-12-28T09:30:21 | 2017-12-28T09:30:21 | 115,606,325 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,054 | c | #include <stdio.h>
int sortc( int array[], int size);
int main( void )
{
int array[] = { 8,0,1,3,4,9,2,5,7,6,7,9,10 };
int size;
int go;
size = sizeof(array) / sizeof(array[0]);
printf("size : %d\n", size);
printf("Before :\n");
for( int i=0; i < size; i++)
printf("%d, ", array[i]);
go = sortc( array, size);
printf("\nAfter :\n");
for( int i=0; i < size; i++)
printf("%d, ", array[i]);
printf("\nPass: %d\n", go);
}
int sortc( int array[], int size)
{
int cur;
int change;
int go = 0;
for( int i = 0; i < size; i++)
{
cur = i;
for( int j = i+1 ; j < size; j++ )
{
go++;
if ( array[j] < array[cur] )
cur = j;
}
if ( cur != i )
{
change = array[i];
array[i] = array[cur];
array[cur] = change;
}
}
return go;
} | [
"gladseo@gmail.com"
] | gladseo@gmail.com |
b5981568800c1df1992876186e894365daea1306 | e9b7d37912252e07970991d2e30849636e5191c1 | /g_serial.c | 05f86b72b8cb222f9d239d8be117e164ce31120d | [] | no_license | mirceatanase1994/gameoflife | 755c6fd4668b47b466f3c804bcb4fc7faa94900e | 6b4a9d3e92e01514df5c2c688d1aedb07d7b9009 | refs/heads/master | 2021-01-19T21:28:43.437040 | 2017-02-20T02:13:26 | 2017-02-20T02:13:26 | 82,506,394 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,627 | c | #include "stdlib.h"
#include "stdio.h"
int main(int argc, char* argv[]){
int xvecini[8] = {1,0,-1,-1,-1,0,1,1};
int yvecini[8] = {1,1,1,0,-1,-1,-1,0};
int lin,col,i,j,nrIt,k,alive,l;
char aux;
FILE* read = fopen(argv[1],"r");
FILE* write = fopen(argv[3],"w");
fscanf(read, "%d %d", &lin, &col);
//fscanf(read, "%d", &col);
char **a = malloc ((lin + 2)*sizeof(char *));
char **temp = malloc ((lin + 2)*sizeof(char *));
nrIt = atoi(argv[2]);
//alocare
for (i=0; i<lin+2; i++){
a[i]= malloc ((col + 2)*sizeof(char));
temp[i]= malloc ((col + 2)*sizeof(char));
}
//citire
fscanf(read, "%c", &aux);
for (i=1; i<=lin; i++){
for (j=1; j<=col; j++){
fscanf(read, "%c ", &aux);
a[i][j] = ((aux == 'X')? 1 : 0);
}
}
for (i = 0; i<nrIt; i++){
//(re)bordare matrice
for (j = 1; j<=lin; j++){
a[j][0] = a[j][col];
a[j][col+1] = a[j][1];
}
for (j=1; j<=col; j++){
a[0][j] = a[lin][j];
a[lin+1][j] = a[1][j];
}
//colturi
a[0][0] = a[lin][col];
a[lin+1][col+1] = a[1][1];
a[0][col+1] = a[lin][1];
a[lin+1][0] = a[1][col];
//calculare matrice noua
for (j = 1; j<=lin; j++){
for (k=1; k<=col; k++){
alive = 0;
for (l = 0; l<8; l++){
alive += a[j + yvecini[l]][k + xvecini[l]];
}
temp[j][k] = ( ((alive == 2)&&(a[j][k]==1)) || (alive == 3));
}
}
//copiere
for (j = 1; j<=lin; j++){
for (k = 1; k<=col; k++){
a[j][k] = temp[j][k];
}
}
}
//afisare
for (i = 1; i<=lin; i++){
for (j = 1; j<=col; j++){
fprintf(write, "%s", ((a[i][j]) ? "X ":". "));
}
fprintf(write, "\n");
}
fclose(read);
fclose(write);
}
| [
"mirceatanase1994@gmail.com"
] | mirceatanase1994@gmail.com |
0c94f4e819f0116261b58db9adef2950d12d9965 | a0c4ed3070ddff4503acf0593e4722140ea68026 | /source/XPOS/GDI/OPENGL/TEST/CONFORM/COVGLU/D.C | 4f98362a0cba8bffd1d416e347e5b3bb517c2152 | [] | no_license | cjacker/windows.xp.whistler | a88e464c820fbfafa64fbc66c7f359bbc43038d7 | 9f43e5fef59b44e47ba1da8c2b4197f8be4d4bc8 | refs/heads/master | 2022-12-10T06:47:33.086704 | 2020-09-19T15:06:48 | 2020-09-19T15:06:48 | 299,932,617 | 0 | 1 | null | 2020-09-30T13:43:42 | 2020-09-30T13:43:41 | null | UTF-8 | C | false | false | 1,295 | c | /*
** Copyright 2000, Silicon Graphics, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of Silicon Graphics, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
*/
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "shell.h"
void CallDeleteNurbsRenderer(void)
{
Output("gluDeleteNurbsRenderer\n");
gluDeleteNurbsRenderer(nurbObj);
Output("\n");
}
void CallDeleteQuadric(void)
{
Output("gluDeleteQuadric\n");
gluDeleteQuadric(quadObj);
Output("\n");
}
void CallDeleteTess(void)
{
Output("gluDeleteTess\n");
gluDeleteTess(tessObj);
Output("\n");
}
void CallDisk(void)
{
Output("gluDisk\n");
gluDisk(quadObj, 5.0, 10.0, 4, 5);
Output("\n");
}
| [
"71558585+window-chicken@users.noreply.github.com"
] | 71558585+window-chicken@users.noreply.github.com |
1edf0d18773bf63bc288472a3f062e7f0ca5bb88 | 38eb361bc13d4632b42ec15685391caa4c687745 | /third_party/JavaScriptCore/include/JavaScriptCore/CollectorPhase.h | 2074e2aadd6cecaa880385af65abfdcb3e1bc891 | [
"Apache-2.0"
] | permissive | adler0518/kraken | 3fdbfb6ee3e7e003e7a16e8c094bbb26890ce01a | 5ec29e552563571beb28706c253a8f9ebd67d10f | refs/heads/main | 2023-03-26T22:44:43.987541 | 2021-03-31T02:07:14 | 2021-03-31T02:07:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 48 | h | #include "JavaScriptCore/heap/CollectorPhase.h"
| [
"chenghuai.dtc@alibaba-inc.com"
] | chenghuai.dtc@alibaba-inc.com |
7b3df48e2af7fb167159dfd5eb7f69c9ecd4e613 | b01ae19d6bce9229b83d0165601719ae53ae2ed0 | /ios/versioned-react-native/ABI46_0_0/Expo/ExpoKit/Core/Api/Components/Svg/Utils/ABI46_0_0RNSVGVectorEffect.h | 3508a4fe54bd63ec0383a90d616bb4678828556e | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | Abhishek12345679/expo | 1655f4f71afbee0e8ef4680e43586168f75e1914 | 8257de135f6d333860a73676509332c9cde04ba5 | refs/heads/main | 2023-02-20T19:46:17.694860 | 2022-11-21T15:48:20 | 2022-11-21T15:48:20 | 568,898,209 | 1 | 0 | MIT | 2022-11-21T16:39:42 | 2022-11-21T16:39:41 | null | UTF-8 | C | false | false | 418 | h | /**
* Copyright (c) 2015-present, ABI46_0_0React-native-community.
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
typedef CF_ENUM(int32_t, ABI46_0_0RNSVGVectorEffect) {
kRNSVGVectorEffectDefault,
kRNSVGVectorEffectNonScalingStroke,
kRNSVGVectorEffectInherit,
kRNSVGVectorEffectUri
};
| [
"noreply@github.com"
] | Abhishek12345679.noreply@github.com |
a955acf31ef916ecf7ddca3e9fd1e76458b1d5cf | 3117dc847269535b3cb52f166cf48918c025057c | /main.c | e5fd395b5ebce1bc3f6e086b78248962d458b13f | [] | no_license | Valduz-Jose/Practica-constante | ef29fe5cee45f541e88297d435e1cbdf53e1a3d3 | f33eb4afdd5f9bae2ff99c8a427ccbbf641a53db | refs/heads/master | 2021-01-11T17:03:14.465648 | 2016-09-28T21:57:04 | 2016-09-28T21:57:04 | 69,506,896 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 784 | c | #include <stdio.h>
#include <stdlib.h>
#define constante 0.001
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
float kilobyt,bytes;
int continuar;
system("cls");
system("color F0");
fflush(stdin);
do{
printf("\t\t\t\tConvertidor de Bytes a Kilobytes\t\t\t\t");
printf("\n\n\t\tIntrodusca los bytes para llevar a kilobyte= ");
scanf("%f",&bytes);
kilobyt=bytes*constante;
printf("\n\t\tKilobytes= %.3f",kilobyt);
printf("\n\n\t\t\tIntrodusca (0) para continuar= ");
scanf("%d",&continuar);
system("cls");
}while(continuar==0);
printf("\t\t\t\tConvertidor de Bytes a Kilobytes\t\t\t\t");
printf("\n\n\t\t\tHASTA LUEGO");
return 0;
}
| [
"noreply@github.com"
] | Valduz-Jose.noreply@github.com |
274b3dec44716268f943d7e293c3c267582e56cf | e4c26866079cb06738dbceabe12e835a389eb910 | /vowel.c | 966c2268116195acaa3aefde93bd4396d5f76af8 | [] | no_license | keerthinair/keerthu | 0b76a8d6f77381d28b8acbbf65d7192895c229b9 | 7cc9895808bcf7a3313d146dc8b2c9ab6ace90e5 | refs/heads/master | 2020-04-18T17:21:14.241171 | 2017-06-08T10:35:32 | 2017-06-08T10:35:32 | 66,259,578 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 457 | c | #include <stdio.h>
int main()
{
char c
int isLowercaseVowel, isUppercaseVowel;
printf("Enter an alphabet: ");
scanf("%c",&c);
isLowercaseVowel = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
isUppercaseVowel = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');
if (isLowercaseVowel || isUppercaseVowel)
printf("%c is a vowel.", c);
else
printf("%c is a consonant.", c);
return 0;
}
| [
"noreply@github.com"
] | keerthinair.noreply@github.com |
c11b5c5c18b9bec52f8f3052e1ecbbe976ccf730 | d4b17a1dde0309ea8a1b2f6d6ae640e44a811052 | /externals/mklfpk/include/ippdefs.h | 4e8ed07f2d090b79b5e0fafd795dccd63fdac391 | [
"Apache-2.0",
"Intel"
] | permissive | h2oai/daal | c50f2b14dc4a9ffc0b7f7bcb40b599cadac6d333 | d49815df3040f3872a1fdb9dc99ee86148e4494e | refs/heads/daal_2018_beta_update1 | 2023-05-25T17:48:44.312245 | 2017-09-29T13:30:10 | 2017-09-29T13:30:10 | 96,125,165 | 2 | 3 | null | 2017-09-29T13:30:11 | 2017-07-03T15:26:26 | C++ | UTF-8 | C | false | false | 5,182 | h | /*******************************************************************************
* Copyright 1999-2017 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/*
// Intel(R) Integrated Performance Primitives
// Common Types and Macro Definitions
//
//
*/
#ifndef __IPPDEFS_H__
#define __IPPDEFS_H__
#ifdef __cplusplus
extern "C" {
#endif
#if defined( _IPP_PARALLEL_STATIC ) || defined( _IPP_PARALLEL_DYNAMIC )
#pragma message("Threaded versions of IPP libraries are deprecated and will be removed in one of the future IPP releases. Use the following link for details: https://software.intel.com/sites/products/ipp-deprecated-features-feedback/")
#endif
#if defined (_WIN64)
#define _INTEL_PLATFORM "intel64/"
#elif defined (_WIN32)
#define _INTEL_PLATFORM "ia32/"
#endif
#if !defined( IPPAPI )
#if defined( IPP_W32DLL ) && (defined( _WIN32 ) || defined( _WIN64 ))
#if defined( _MSC_VER ) || defined( __ICL )
#define IPPAPI( type,name,arg ) \
__declspec(dllimport) type __STDCALL name arg;
#else
#define IPPAPI( type,name,arg ) type __STDCALL name arg;
#endif
#else
#define IPPAPI( type,name,arg ) type __STDCALL name arg;
#endif
#endif
#if (defined( __ICL ) || defined( __ECL ) || defined(_MSC_VER)) && !defined( _PCS ) && !defined( _PCS_GENSTUBS )
#if( __INTEL_COMPILER >= 1100 ) /* icl 11.0 supports additional comment */
#if( _MSC_VER >= 1400 )
#define IPP_DEPRECATED( comment ) __declspec( deprecated ( comment ))
#else
#pragma message ("your icl version supports additional comment for deprecated functions but it can't be displayed")
#pragma message ("because internal _MSC_VER macro variable setting requires compatibility with MSVC7.1")
#pragma message ("use -Qvc8 switch for icl command line to see these additional comments")
#define IPP_DEPRECATED( comment ) __declspec( deprecated )
#endif
#elif( _MSC_FULL_VER >= 140050727 )&&( !defined( __INTEL_COMPILER )) /* VS2005 supports additional comment */
#define IPP_DEPRECATED( comment ) __declspec( deprecated ( comment ))
#elif( _MSC_VER <= 1200 )&&( !defined( __INTEL_COMPILER )) /* VS 6 doesn't support deprecation */
#define IPP_DEPRECATED( comment )
#else
#define IPP_DEPRECATED( comment ) __declspec( deprecated )
#endif
#elif (defined(__ICC) || defined(__ECC) || defined( __GNUC__ )) && !defined( _PCS ) && !defined( _PCS_GENSTUBS )
#if defined( __GNUC__ )
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 5
#define IPP_DEPRECATED( message ) __attribute__(( deprecated( message )))
#else
#define IPP_DEPRECATED( message ) __attribute__(( deprecated ))
#endif
#else
#define IPP_DEPRECATED( comment ) __attribute__(( deprecated ))
#endif
#else
#define IPP_DEPRECATED( comment )
#endif
#if (defined( __ICL ) || defined( __ECL ) || defined(_MSC_VER))
#if !defined( _IPP_NO_DEFAULT_LIB )
#if (( defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC )) || \
(!defined( _IPP_PARALLEL_DYNAMIC ) && defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC )) || \
(!defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC )) || \
(!defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && defined( _IPP_SEQUENTIAL_STATIC )))
#elif (!defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC ))
#define _IPP_NO_DEFAULT_LIB
#else
#error Illegal combination of _IPP_PARALLEL_DYNAMIC/_IPP_PARALLEL_STATIC/_IPP_SEQUENTIAL_DYNAMIC/_IPP_SEQUENTIAL_STATIC, only one definition can be defined
#endif
#endif
#else
#define _IPP_NO_DEFAULT_LIB
#if (defined( _IPP_PARALLEL_DYNAMIC ) || defined( _IPP_PARALLEL_STATIC ) || defined(_IPP_SEQUENTIAL_DYNAMIC) || defined(_IPP_SEQUENTIAL_STATIC))
#pragma message ("defines _IPP_PARALLEL_DYNAMIC/_IPP_PARALLEL_STATIC/_IPP_SEQUENTIAL_DYNAMIC/_IPP_SEQUENTIAL_STATIC do not have any effect in current configuration")
#endif
#endif
#if !defined( _IPP_NO_DEFAULT_LIB )
#if defined( _IPP_PARALLEL_STATIC )
#pragma comment( lib, "libiomp5md" )
#endif
#endif
#include "ippbase.h"
#include "ipptypes.h"
#ifdef __cplusplus
}
#endif
#endif /* __IPPDEFS_H__ */
| [
"vasily.rubtsov@intel.com"
] | vasily.rubtsov@intel.com |
9f3bb90bceaf8417f9f928e751da6e234546ee99 | 4d1614ba0104bb2b4528b32fa0a2a1e8caa3bfa3 | /code/dpdk/app/test/test_pdump.c | ad183184cee9098fc6dd67390d5e5f6b65856139 | [
"MIT",
"GPL-2.0-only",
"BSD-3-Clause"
] | permissive | Lossless-Virtual-Switching/Backdraft | c292c87f8d483a5dbd8d28009cb3b5e263e7fb36 | 4cedd1403c7c9fe5e1afc647e374173c7c5c46f0 | refs/heads/master | 2023-05-24T03:27:49.553264 | 2023-03-01T14:59:00 | 2023-03-01T14:59:00 | 455,533,889 | 11 | 4 | MIT | 2022-04-20T16:34:22 | 2022-02-04T12:09:31 | C | UTF-8 | C | false | false | 4,815 | c | /* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2018 Intel Corporation
*/
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <limits.h>
#include <rte_ethdev_driver.h>
#include <rte_pdump.h>
#include "rte_eal.h"
#include "rte_lcore.h"
#include "rte_mempool.h"
#include "rte_ring.h"
#include "sample_packet_forward.h"
#include "test.h"
#include "process.h"
#include "test_pdump.h"
#define launch_p(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)
struct rte_ring *ring_server;
uint16_t portid;
uint16_t flag_for_send_pkts = 1;
int
test_pdump_init(void)
{
int ret = 0;
ret = rte_pdump_init();
if (ret < 0) {
printf("rte_pdump_init failed\n");
return -1;
}
ret = test_ring_setup(&ring_server, &portid);
if (ret < 0) {
printf("test_ring_setup failed\n");
return -1;
}
printf("pdump_init success\n");
return ret;
}
int
run_pdump_client_tests(void)
{
int flags = RTE_PDUMP_FLAG_TX, ret = 0, itr;
char deviceid[] = "net_ring_net_ringa";
struct rte_ring *ring_client;
struct rte_mempool *mp = NULL;
struct rte_eth_dev *eth_dev = NULL;
char poolname[] = "mbuf_pool_client";
ret = test_get_mempool(&mp, poolname);
if (ret < 0)
return -1;
mp->flags = 0x0000;
ring_client = rte_ring_create("SR0", RING_SIZE, rte_socket_id(),
RING_F_SP_ENQ | RING_F_SC_DEQ);
if (ring_client == NULL) {
printf("rte_ring_create SR0 failed");
return -1;
}
eth_dev = rte_eth_dev_attach_secondary(deviceid);
if (!eth_dev) {
printf("Failed to probe %s", deviceid);
return -1;
}
rte_eth_dev_probing_finish(eth_dev);
ring_client->prod.single = 0;
ring_client->cons.single = 0;
printf("\n***** flags = RTE_PDUMP_FLAG_TX *****\n");
for (itr = 0; itr < NUM_ITR; itr++) {
ret = rte_pdump_enable(portid, QUEUE_ID, flags, ring_client,
mp, NULL);
if (ret < 0) {
printf("rte_pdump_enable failed\n");
return -1;
}
printf("pdump_enable success\n");
ret = rte_pdump_disable(portid, QUEUE_ID, flags);
if (ret < 0) {
printf("rte_pdump_disable failed\n");
return -1;
}
printf("pdump_disable success\n");
ret = rte_pdump_enable_by_deviceid(deviceid, QUEUE_ID, flags,
ring_client, mp, NULL);
if (ret < 0) {
printf("rte_pdump_enable_by_deviceid failed\n");
return -1;
}
printf("pdump_enable_by_deviceid success\n");
ret = rte_pdump_disable_by_deviceid(deviceid, QUEUE_ID, flags);
if (ret < 0) {
printf("rte_pdump_disable_by_deviceid failed\n");
return -1;
}
printf("pdump_disable_by_deviceid success\n");
if (itr == 0) {
flags = RTE_PDUMP_FLAG_RX;
printf("\n***** flags = RTE_PDUMP_FLAG_RX *****\n");
} else if (itr == 1) {
flags = RTE_PDUMP_FLAG_RXTX;
printf("\n***** flags = RTE_PDUMP_FLAG_RXTX *****\n");
}
}
if (ring_client != NULL)
test_ring_free(ring_client);
if (mp != NULL)
test_mp_free(mp);
return ret;
}
int
test_pdump_uninit(void)
{
int ret = 0;
ret = rte_pdump_uninit();
if (ret < 0) {
printf("rte_pdump_uninit failed\n");
return -1;
}
if (ring_server != NULL)
test_ring_free(ring_server);
printf("pdump_uninit success\n");
test_vdev_uninit("net_ring_net_ringa");
return ret;
}
void *
send_pkts(void *empty)
{
int ret = 0;
struct rte_mbuf *pbuf[NUM_PACKETS] = { };
struct rte_mempool *mp;
char poolname[] = "mbuf_pool_server";
ret = test_get_mbuf_from_pool(&mp, pbuf, poolname);
if (ret < 0)
printf("get_mbuf_from_pool failed\n");
do {
ret = test_packet_forward(pbuf, portid, QUEUE_ID);
if (ret < 0)
printf("send pkts Failed\n");
} while (flag_for_send_pkts);
test_put_mbuf_to_pool(mp, pbuf);
return empty;
}
/*
* This function is called in the primary i.e. main test, to spawn off secondary
* processes to run actual mp tests. Uses fork() and exec pair
*/
int
run_pdump_server_tests(void)
{
int ret = 0;
char coremask[10];
#ifdef RTE_EXEC_ENV_LINUX
char tmp[PATH_MAX] = { 0 };
char prefix[PATH_MAX] = { 0 };
get_current_prefix(tmp, sizeof(tmp));
snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#else
const char *prefix = "";
#endif
/* good case, using secondary */
const char *const argv1[] = {
prgname, "-c", coremask, "--proc-type=secondary",
prefix
};
snprintf(coremask, sizeof(coremask), "%x",
(1 << rte_get_master_lcore()));
ret = test_pdump_init();
ret |= launch_p(argv1);
ret |= test_pdump_uninit();
return ret;
}
int
test_pdump(void)
{
int ret = 0;
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
printf("IN PRIMARY PROCESS\n");
ret = run_pdump_server_tests();
if (ret < 0)
return TEST_FAILED;
} else if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
printf("IN SECONDARY PROCESS\n");
sleep(5);
ret = run_pdump_client_tests();
if (ret < 0)
return TEST_FAILED;
}
return TEST_SUCCESS;
}
REGISTER_TEST_COMMAND(pdump_autotest, test_pdump);
| [
"sarsanaee@gmail.com"
] | sarsanaee@gmail.com |
723d75edf01b0347f1b3204392b107e3933c103e | 02bf5f365ae9900bcc2234b9b329efe5915b7532 | /mqueue/mqueue_client.c | 7bd4dc824a16c73f32144c493cdd5b118108c74d | [
"MIT"
] | permissive | PARKINHYO/BlackjackGame | 70de4be7747abca5e3a2909ab515ce43faf5e472 | 0138a8b2384c77c3079dbb59cc43a2acb08e67ae | refs/heads/master | 2021-06-27T09:43:08.209954 | 2021-04-10T06:19:12 | 2021-04-10T06:19:12 | 225,603,353 | 11 | 0 | MIT | 2019-12-31T11:57:38 | 2019-12-03T11:27:28 | C | UTF-8 | C | false | false | 5,547 | c | #include "common.h"
#define KEY_VALUE_MAIN (key_t)60300
#define KEY_VALUE_MAIN2 (key_t)60301
#define PERM 0666
void* play_game();
void* set_shutdown();
void* send_msg();
void* recv_msg();
int msgid_Send_Main;
int msgid_Recv_Main;
pid_t pid;
int nwritten;
pthread_t threads[MAX_PLAYERS];
int my_sum;
int dealer_sum;
int check = 0;
int check2 = 0;
int finalcheck = 0;
// 메세지큐 해제...
void *set_shutdown()
{
printf("[SIGNAL] : Got shutdown signal\n");
msgctl(msgid_Send_Main, IPC_RMID, 0);
printf("[SIGNAL] : Message passing queue marked for deletion\n");
msgctl(msgid_Recv_Main, IPC_RMID, 0);
printf("[SIGNAL] : Message passing queue marked for deletion\n");
exit(1);
}
void* send_msg() {
msg buf;
buf.type = pid;
char buffer[BUFFER_SIZE];
int choice;
while (1) {
if(finalcheck) {break;}
if(check2 == 1){
printf("\n");
printf("1. Hit\n");
printf("2. Stand\n");
printf("Please choose 1 or 2: ");
fflush(stdout);
scanf("%d", &choice);
if (choice == 1)
{
strcpy(buffer, HIT);
printf("Sending: %s\n", buffer);
strncpy(buf.data, buffer, BUFFER_SIZE);
msgsnd(msgid_Send_Main, (void*)&buf, sizeof(msg), 0);
buffer[0]='\0';
check2 =2;
}
else if (choice == 2)
{
strcpy(buffer, STAND);
printf("Sending: %s\n", buffer);
strncpy(buf.data, buffer, BUFFER_SIZE);
msgsnd(msgid_Send_Main, (void*)&buf, sizeof(msg), 0);
buffer[0]='\0';
check2 = 0;
check = 0;
finalcheck = 1;
break;
}
else
printf("Unrecognized choice. Choose again.\n");
}
}
}
void* recv_msg() {
msg buf;
buf.type = pid;
char buffer[BUFFER_SIZE];
check =1;
int my_hand_values[20], dealer_hand_values[20];
int my_hand_suits[20], dealer_hand_suits[20];
int nmy = 0, ndealer = 0;
buf.type = pid;
while (1) {
if(check == 1){
printf("pid: %d\n\n", pid);
msgrcv(msgid_Recv_Main, (void*)&buf, sizeof(msg), pid, 0);
strncpy(buffer, buf.data, BUFFER_SIZE);
printf("%s\n", buffer);
my_hand_values[0] = get_value_id(buffer[0]);
my_hand_suits[0] = get_suit_id(buffer[1]);
my_hand_values[1] = get_value_id(buffer[2]);
my_hand_suits[1] = get_suit_id(buffer[3]);
dealer_hand_values[0] = get_value_id(buffer[4]);
dealer_hand_suits[0] = get_suit_id(buffer[5]);
nmy = 2;
ndealer = 1;
my_sum = calc_sum(my_hand_values, nmy);
printf("\n");
// 카드덱과 합산값 화면출력
printf("My Hand: ");
display_state(my_hand_values, my_hand_suits, nmy);
printf("Dealer Hand: ");
display_state(dealer_hand_values, dealer_hand_suits, ndealer);
if (my_sum > 21)
{
printf("\nI'm busted! I lose!\n");
return 0;
}
check = 0;
check2 = 1;
buffer[0]='\0';
}
if(check2 == 2){
printf("buffer: %s\n", buffer);
msgrcv(msgid_Recv_Main, (void*)&buf, sizeof(msg), pid, 0);
printf("buf.data: %s\n", buf.data);
strncpy(buffer, buf.data, BUFFER_SIZE);
printf("I received: %s\n", buffer);
my_hand_values[nmy] = get_value_id(buffer[0]);
my_hand_suits[nmy] = get_suit_id(buffer[1]);
++nmy;
printf("\n");
printf("My Hand: ");
display_state(my_hand_values, my_hand_suits, nmy);
printf("Dealer Hand: ");
display_state(dealer_hand_values, dealer_hand_suits, ndealer);
my_sum = calc_sum(my_hand_values, nmy);
if(my_sum>21){
printf("\nI'm busted! I lose!\n");
return 0;
}
check2 = 1;
}
if(finalcheck == 1){
finalcheck = 0;
unsigned i;
msgrcv(msgid_Recv_Main, (void*)&buf, sizeof(msg), pid, 0);
strncpy(buffer, buf.data, BUFFER_SIZE);
printf("I received: %s\n", buffer);
for (i = 0; i < strlen(buffer); i += 2)
{
dealer_hand_values[ndealer] = get_value_id(buffer[i]);
dealer_hand_suits[ndealer] = get_suit_id(buffer[i + 1]);
++ndealer;
}
printf("\n");
printf("My Hand: ");
display_state(my_hand_values, my_hand_suits, nmy);
printf("Dealer Hand: ");
display_state(dealer_hand_values, dealer_hand_suits, ndealer);
my_sum = calc_sum(my_hand_values, nmy);
dealer_sum = calc_sum(dealer_hand_values, ndealer);
if (dealer_sum > 21)
printf("\nDealer busted! I win!\n");
else if (my_sum == dealer_sum)
printf("\nMe and the dealer have the same score. It's a push!\n");
else if (my_sum < dealer_sum)
printf("\nDealer has a higher score. I lose!\n");
else
printf("\nI have a higher score. I win!\n");
return 0;
}
}
return 0;
}
void* play_game() {
// recv_msg, send_msg 스레드 생성...
pthread_create(&threads[1], NULL, recv_msg, NULL);
pthread_create(&threads[2], NULL, send_msg, NULL);
int tid;
// 스레드들 끝날때까지 대기후 삭제...
for (tid = 1; tid < 2; ++tid)
pthread_join(threads[tid], NULL);
}
int main() {
char buffer[BUFFER_SIZE];
int count = 0;
pid = getpid();
msg buf;
msgid_Send_Main = msgget(KEY_VALUE_MAIN, IPC_CREAT | PERM);
msgid_Recv_Main = msgget(KEY_VALUE_MAIN2, IPC_CREAT | PERM);
// Signal 등록 ...
(void)signal(SIGINT, (void(*)()) set_shutdown);
printf("input data ==> ");
fgets(buffer, BUFFER_SIZE, stdin);
buf.type = 200;
memset(buf.data, 0, sizeof(buf.data));
strncpy(buf.data, buffer, BUFFER_SIZE);
msgsnd(msgid_Send_Main, (void*)&buf, sizeof(msg), 0);
// 쓴 데이터가 ‘quit’이면 while 문 벗어남...
if (!strncmp(buf.data, "quit", 4)) {
return 0;
}
// play_game 스레드 진입...
pthread_create(&threads[0], NULL, play_game, NULL);
// 스레드 종료 대기후 삭제...
pthread_join(threads[0], NULL);
printf("game end!\n");
return 0;
}
| [
"inhyopark122@gmail.com"
] | inhyopark122@gmail.com |
09e1e961b6fedfd39567622146d7073e698bcedf | 473fc28d466ddbe9758ca49c7d4fb42e7d82586e | /app/src/main/java/com/syd/source/aosp/external/vixl/test/aarch32/traces/assembler-cond-rd-rn-operand-const-t32-sbc.h | 7a80c8cd537e12203f5836c6c211c62d276d4f87 | [] | no_license | lz-purple/Source | a7788070623f2965a8caa3264778f48d17372bab | e2745b756317aac3c7a27a4c10bdfe0921a82a1c | refs/heads/master | 2020-12-23T17:03:12.412572 | 2020-01-31T01:54:37 | 2020-01-31T01:54:37 | 237,205,127 | 4 | 2 | null | null | null | null | UTF-8 | C | false | false | 110,396 | h | // Copyright 2015, VIXL authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of ARM Limited nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ---------------------------------------------------------------------
// This file is auto generated using tools/generate_simulator_traces.py.
//
// PLEASE DO NOT EDIT.
// ---------------------------------------------------------------------
#ifndef VIXL_ASSEMBLER_COND_RD_RN_OPERAND_CONST_T32_SBC_H_
#define VIXL_ASSEMBLER_COND_RD_RN_OPERAND_CONST_T32_SBC_H_
const byte kInstruction_sbc_al_r13_r14_0x02ac0000[] = {
0x6e, 0xf1, 0x2b, 0x7d // sbc al r13 r14 0x02ac0000
};
const byte kInstruction_sbc_al_r10_r1_0x00156000[] = {
0x61, 0xf5, 0xab, 0x1a // sbc al r10 r1 0x00156000
};
const byte kInstruction_sbc_al_r10_r0_0x000003fc[] = {
0x60, 0xf5, 0x7f, 0x7a // sbc al r10 r0 0x000003fc
};
const byte kInstruction_sbc_al_r1_r11_0x2ac00000[] = {
0x6b, 0xf1, 0x2b, 0x51 // sbc al r1 r11 0x2ac00000
};
const byte kInstruction_sbc_al_r8_r6_0x00156000[] = {
0x66, 0xf5, 0xab, 0x18 // sbc al r8 r6 0x00156000
};
const byte kInstruction_sbc_al_r7_r12_0x00ff0000[] = {
0x6c, 0xf5, 0x7f, 0x07 // sbc al r7 r12 0x00ff0000
};
const byte kInstruction_sbc_al_r12_r3_0x00ff0000[] = {
0x63, 0xf5, 0x7f, 0x0c // sbc al r12 r3 0x00ff0000
};
const byte kInstruction_sbc_al_r4_r7_0x0000ff00[] = {
0x67, 0xf5, 0x7f, 0x44 // sbc al r4 r7 0x0000ff00
};
const byte kInstruction_sbc_al_r11_r13_0x0ab00000[] = {
0x6d, 0xf1, 0x2b, 0x6b // sbc al r11 r13 0x0ab00000
};
const byte kInstruction_sbc_al_r6_r12_0xff00ff00[] = {
0x6c, 0xf1, 0xff, 0x26 // sbc al r6 r12 0xff00ff00
};
const byte kInstruction_sbc_al_r12_r8_0x003fc000[] = {
0x68, 0xf5, 0x7f, 0x1c // sbc al r12 r8 0x003fc000
};
const byte kInstruction_sbc_al_r5_r12_0x00ab00ab[] = {
0x6c, 0xf1, 0xab, 0x15 // sbc al r5 r12 0x00ab00ab
};
const byte kInstruction_sbc_al_r7_r6_0x00ab00ab[] = {
0x66, 0xf1, 0xab, 0x17 // sbc al r7 r6 0x00ab00ab
};
const byte kInstruction_sbc_al_r0_r1_0x00ab00ab[] = {
0x61, 0xf1, 0xab, 0x10 // sbc al r0 r1 0x00ab00ab
};
const byte kInstruction_sbc_al_r9_r9_0x000001fe[] = {
0x69, 0xf5, 0xff, 0x79 // sbc al r9 r9 0x000001fe
};
const byte kInstruction_sbc_al_r2_r8_0xab00ab00[] = {
0x68, 0xf1, 0xab, 0x22 // sbc al r2 r8 0xab00ab00
};
const byte kInstruction_sbc_al_r9_r10_0x00ff0000[] = {
0x6a, 0xf5, 0x7f, 0x09 // sbc al r9 r10 0x00ff0000
};
const byte kInstruction_sbc_al_r8_r8_0x55800000[] = {
0x68, 0xf1, 0xab, 0x48 // sbc al r8 r8 0x55800000
};
const byte kInstruction_sbc_al_r6_r7_0x00ab00ab[] = {
0x67, 0xf1, 0xab, 0x16 // sbc al r6 r7 0x00ab00ab
};
const byte kInstruction_sbc_al_r5_r9_0xff000000[] = {
0x69, 0xf1, 0x7f, 0x45 // sbc al r5 r9 0xff000000
};
const byte kInstruction_sbc_al_r8_r8_0x00ab0000[] = {
0x68, 0xf5, 0x2b, 0x08 // sbc al r8 r8 0x00ab0000
};
const byte kInstruction_sbc_al_r5_r8_0xab00ab00[] = {
0x68, 0xf1, 0xab, 0x25 // sbc al r5 r8 0xab00ab00
};
const byte kInstruction_sbc_al_r0_r12_0xab000000[] = {
0x6c, 0xf1, 0x2b, 0x40 // sbc al r0 r12 0xab000000
};
const byte kInstruction_sbc_al_r13_r11_0xab000000[] = {
0x6b, 0xf1, 0x2b, 0x4d // sbc al r13 r11 0xab000000
};
const byte kInstruction_sbc_al_r14_r3_0xab00ab00[] = {
0x63, 0xf1, 0xab, 0x2e // sbc al r14 r3 0xab00ab00
};
const byte kInstruction_sbc_al_r0_r1_0x0003fc00[] = {
0x61, 0xf5, 0x7f, 0x30 // sbc al r0 r1 0x0003fc00
};
const byte kInstruction_sbc_al_r14_r13_0x0ab00000[] = {
0x6d, 0xf1, 0x2b, 0x6e // sbc al r14 r13 0x0ab00000
};
const byte kInstruction_sbc_al_r6_r0_0x0002ac00[] = {
0x60, 0xf5, 0x2b, 0x36 // sbc al r6 r0 0x0002ac00
};
const byte kInstruction_sbc_al_r6_r8_0x55800000[] = {
0x68, 0xf1, 0xab, 0x46 // sbc al r6 r8 0x55800000
};
const byte kInstruction_sbc_al_r2_r14_0x01560000[] = {
0x6e, 0xf1, 0xab, 0x72 // sbc al r2 r14 0x01560000
};
const byte kInstruction_sbc_al_r5_r13_0x03fc0000[] = {
0x6d, 0xf1, 0x7f, 0x75 // sbc al r5 r13 0x03fc0000
};
const byte kInstruction_sbc_al_r7_r6_0x00000ab0[] = {
0x66, 0xf5, 0x2b, 0x67 // sbc al r7 r6 0x00000ab0
};
const byte kInstruction_sbc_al_r3_r14_0x007f8000[] = {
0x6e, 0xf5, 0xff, 0x03 // sbc al r3 r14 0x007f8000
};
const byte kInstruction_sbc_al_r9_r4_0x00558000[] = {
0x64, 0xf5, 0xab, 0x09 // sbc al r9 r4 0x00558000
};
const byte kInstruction_sbc_al_r10_r11_0x00002ac0[] = {
0x6b, 0xf5, 0x2b, 0x5a // sbc al r10 r11 0x00002ac0
};
const byte kInstruction_sbc_al_r1_r5_0x003fc000[] = {
0x65, 0xf5, 0x7f, 0x11 // sbc al r1 r5 0x003fc000
};
const byte kInstruction_sbc_al_r7_r7_0x00003fc0[] = {
0x67, 0xf5, 0x7f, 0x57 // sbc al r7 r7 0x00003fc0
};
const byte kInstruction_sbc_al_r5_r3_0x000007f8[] = {
0x63, 0xf5, 0xff, 0x65 // sbc al r5 r3 0x000007f8
};
const byte kInstruction_sbc_al_r4_r3_0x00001560[] = {
0x63, 0xf5, 0xab, 0x54 // sbc al r4 r3 0x00001560
};
const byte kInstruction_sbc_al_r5_r3_0x03fc0000[] = {
0x63, 0xf1, 0x7f, 0x75 // sbc al r5 r3 0x03fc0000
};
const byte kInstruction_sbc_al_r2_r6_0x55800000[] = {
0x66, 0xf1, 0xab, 0x42 // sbc al r2 r6 0x55800000
};
const byte kInstruction_sbc_al_r13_r5_0x0000ab00[] = {
0x65, 0xf5, 0x2b, 0x4d // sbc al r13 r5 0x0000ab00
};
const byte kInstruction_sbc_al_r0_r11_0xab00ab00[] = {
0x6b, 0xf1, 0xab, 0x20 // sbc al r0 r11 0xab00ab00
};
const byte kInstruction_sbc_al_r14_r12_0x00ff00ff[] = {
0x6c, 0xf1, 0xff, 0x1e // sbc al r14 r12 0x00ff00ff
};
const byte kInstruction_sbc_al_r13_r8_0x7f800000[] = {
0x68, 0xf1, 0xff, 0x4d // sbc al r13 r8 0x7f800000
};
const byte kInstruction_sbc_al_r1_r2_0x15600000[] = {
0x62, 0xf1, 0xab, 0x51 // sbc al r1 r2 0x15600000
};
const byte kInstruction_sbc_al_r7_r6_0xab000000[] = {
0x66, 0xf1, 0x2b, 0x47 // sbc al r7 r6 0xab000000
};
const byte kInstruction_sbc_al_r1_r9_0x00000ff0[] = {
0x69, 0xf5, 0x7f, 0x61 // sbc al r1 r9 0x00000ff0
};
const byte kInstruction_sbc_al_r12_r8_0x0007f800[] = {
0x68, 0xf5, 0xff, 0x2c // sbc al r12 r8 0x0007f800
};
const byte kInstruction_sbc_al_r0_r8_0x00ab0000[] = {
0x68, 0xf5, 0x2b, 0x00 // sbc al r0 r8 0x00ab0000
};
const byte kInstruction_sbc_al_r11_r11_0x000000ff[] = {
0x6b, 0xf1, 0xff, 0x0b // sbc al r11 r11 0x000000ff
};
const byte kInstruction_sbc_al_r12_r13_0xff000000[] = {
0x6d, 0xf1, 0x7f, 0x4c // sbc al r12 r13 0xff000000
};
const byte kInstruction_sbc_al_r1_r3_0x0ab00000[] = {
0x63, 0xf1, 0x2b, 0x61 // sbc al r1 r3 0x0ab00000
};
const byte kInstruction_sbc_al_r2_r10_0x0001fe00[] = {
0x6a, 0xf5, 0xff, 0x32 // sbc al r2 r10 0x0001fe00
};
const byte kInstruction_sbc_al_r14_r2_0x01fe0000[] = {
0x62, 0xf1, 0xff, 0x7e // sbc al r14 r2 0x01fe0000
};
const byte kInstruction_sbc_al_r3_r4_0x000000ff[] = {
0x64, 0xf1, 0xff, 0x03 // sbc al r3 r4 0x000000ff
};
const byte kInstruction_sbc_al_r3_r13_0x00000558[] = {
0x6d, 0xf5, 0xab, 0x63 // sbc al r3 r13 0x00000558
};
const byte kInstruction_sbc_al_r13_r10_0x00055800[] = {
0x6a, 0xf5, 0xab, 0x2d // sbc al r13 r10 0x00055800
};
const byte kInstruction_sbc_al_r1_r10_0xff000000[] = {
0x6a, 0xf1, 0x7f, 0x41 // sbc al r1 r10 0xff000000
};
const byte kInstruction_sbc_al_r0_r7_0x2ac00000[] = {
0x67, 0xf1, 0x2b, 0x50 // sbc al r0 r7 0x2ac00000
};
const byte kInstruction_sbc_al_r12_r1_0xab000000[] = {
0x61, 0xf1, 0x2b, 0x4c // sbc al r12 r1 0xab000000
};
const byte kInstruction_sbc_al_r9_r14_0x00003fc0[] = {
0x6e, 0xf5, 0x7f, 0x59 // sbc al r9 r14 0x00003fc0
};
const byte kInstruction_sbc_al_r7_r2_0x2ac00000[] = {
0x62, 0xf1, 0x2b, 0x57 // sbc al r7 r2 0x2ac00000
};
const byte kInstruction_sbc_al_r14_r4_0x00001fe0[] = {
0x64, 0xf5, 0xff, 0x5e // sbc al r14 r4 0x00001fe0
};
const byte kInstruction_sbc_al_r12_r8_0x00007f80[] = {
0x68, 0xf5, 0xff, 0x4c // sbc al r12 r8 0x00007f80
};
const byte kInstruction_sbc_al_r7_r10_0x00000ab0[] = {
0x6a, 0xf5, 0x2b, 0x67 // sbc al r7 r10 0x00000ab0
};
const byte kInstruction_sbc_al_r13_r6_0x00ab0000[] = {
0x66, 0xf5, 0x2b, 0x0d // sbc al r13 r6 0x00ab0000
};
const byte kInstruction_sbc_al_r7_r9_0x0000ff00[] = {
0x69, 0xf5, 0x7f, 0x47 // sbc al r7 r9 0x0000ff00
};
const byte kInstruction_sbc_al_r2_r12_0xff00ff00[] = {
0x6c, 0xf1, 0xff, 0x22 // sbc al r2 r12 0xff00ff00
};
const byte kInstruction_sbc_al_r1_r6_0x00000156[] = {
0x66, 0xf5, 0xab, 0x71 // sbc al r1 r6 0x00000156
};
const byte kInstruction_sbc_al_r7_r5_0x03fc0000[] = {
0x65, 0xf1, 0x7f, 0x77 // sbc al r7 r5 0x03fc0000
};
const byte kInstruction_sbc_al_r2_r9_0x01fe0000[] = {
0x69, 0xf1, 0xff, 0x72 // sbc al r2 r9 0x01fe0000
};
const byte kInstruction_sbc_al_r10_r12_0x00002ac0[] = {
0x6c, 0xf5, 0x2b, 0x5a // sbc al r10 r12 0x00002ac0
};
const byte kInstruction_sbc_al_r14_r10_0x7f800000[] = {
0x6a, 0xf1, 0xff, 0x4e // sbc al r14 r10 0x7f800000
};
const byte kInstruction_sbc_al_r2_r8_0x02ac0000[] = {
0x68, 0xf1, 0x2b, 0x72 // sbc al r2 r8 0x02ac0000
};
const byte kInstruction_sbc_al_r4_r9_0x000001fe[] = {
0x69, 0xf5, 0xff, 0x74 // sbc al r4 r9 0x000001fe
};
const byte kInstruction_sbc_al_r10_r10_0x000001fe[] = {
0x6a, 0xf5, 0xff, 0x7a // sbc al r10 r10 0x000001fe
};
const byte kInstruction_sbc_al_r6_r6_0x3fc00000[] = {
0x66, 0xf1, 0x7f, 0x56 // sbc al r6 r6 0x3fc00000
};
const byte kInstruction_sbc_al_r4_r12_0x000003fc[] = {
0x6c, 0xf5, 0x7f, 0x74 // sbc al r4 r12 0x000003fc
};
const byte kInstruction_sbc_al_r0_r2_0x0000ff00[] = {
0x62, 0xf5, 0x7f, 0x40 // sbc al r0 r2 0x0000ff00
};
const byte kInstruction_sbc_al_r9_r0_0x003fc000[] = {
0x60, 0xf5, 0x7f, 0x19 // sbc al r9 r0 0x003fc000
};
const byte kInstruction_sbc_al_r7_r4_0x000002ac[] = {
0x64, 0xf5, 0x2b, 0x77 // sbc al r7 r4 0x000002ac
};
const byte kInstruction_sbc_al_r6_r6_0x7f800000[] = {
0x66, 0xf1, 0xff, 0x46 // sbc al r6 r6 0x7f800000
};
const byte kInstruction_sbc_al_r6_r8_0x00015600[] = {
0x68, 0xf5, 0xab, 0x36 // sbc al r6 r8 0x00015600
};
const byte kInstruction_sbc_al_r10_r0_0x00000ff0[] = {
0x60, 0xf5, 0x7f, 0x6a // sbc al r10 r0 0x00000ff0
};
const byte kInstruction_sbc_al_r8_r1_0xffffffff[] = {
0x61, 0xf1, 0xff, 0x38 // sbc al r8 r1 0xffffffff
};
const byte kInstruction_sbc_al_r3_r7_0x00ab00ab[] = {
0x67, 0xf1, 0xab, 0x13 // sbc al r3 r7 0x00ab00ab
};
const byte kInstruction_sbc_al_r8_r11_0x01fe0000[] = {
0x6b, 0xf1, 0xff, 0x78 // sbc al r8 r11 0x01fe0000
};
const byte kInstruction_sbc_al_r3_r1_0x00ff0000[] = {
0x61, 0xf5, 0x7f, 0x03 // sbc al r3 r1 0x00ff0000
};
const byte kInstruction_sbc_al_r5_r4_0x000001fe[] = {
0x64, 0xf5, 0xff, 0x75 // sbc al r5 r4 0x000001fe
};
const byte kInstruction_sbc_al_r7_r10_0x00000558[] = {
0x6a, 0xf5, 0xab, 0x67 // sbc al r7 r10 0x00000558
};
const byte kInstruction_sbc_al_r8_r13_0x00001560[] = {
0x6d, 0xf5, 0xab, 0x58 // sbc al r8 r13 0x00001560
};
const byte kInstruction_sbc_al_r9_r4_0x00002ac0[] = {
0x64, 0xf5, 0x2b, 0x59 // sbc al r9 r4 0x00002ac0
};
const byte kInstruction_sbc_al_r9_r7_0x03fc0000[] = {
0x67, 0xf1, 0x7f, 0x79 // sbc al r9 r7 0x03fc0000
};
const byte kInstruction_sbc_al_r11_r12_0x2ac00000[] = {
0x6c, 0xf1, 0x2b, 0x5b // sbc al r11 r12 0x2ac00000
};
const byte kInstruction_sbc_al_r13_r10_0x00001fe0[] = {
0x6a, 0xf5, 0xff, 0x5d // sbc al r13 r10 0x00001fe0
};
const byte kInstruction_sbc_al_r11_r10_0x00558000[] = {
0x6a, 0xf5, 0xab, 0x0b // sbc al r11 r10 0x00558000
};
const byte kInstruction_sbc_al_r3_r2_0x000000ab[] = {
0x62, 0xf1, 0xab, 0x03 // sbc al r3 r2 0x000000ab
};
const byte kInstruction_sbc_al_r0_r8_0x00000ab0[] = {
0x68, 0xf5, 0x2b, 0x60 // sbc al r0 r8 0x00000ab0
};
const byte kInstruction_sbc_al_r9_r7_0xab000000[] = {
0x67, 0xf1, 0x2b, 0x49 // sbc al r9 r7 0xab000000
};
const byte kInstruction_sbc_al_r11_r7_0x0ff00000[] = {
0x67, 0xf1, 0x7f, 0x6b // sbc al r11 r7 0x0ff00000
};
const byte kInstruction_sbc_al_r10_r2_0x7f800000[] = {
0x62, 0xf1, 0xff, 0x4a // sbc al r10 r2 0x7f800000
};
const byte kInstruction_sbc_al_r3_r1_0x05580000[] = {
0x61, 0xf1, 0xab, 0x63 // sbc al r3 r1 0x05580000
};
const byte kInstruction_sbc_al_r1_r4_0x0ab00000[] = {
0x64, 0xf1, 0x2b, 0x61 // sbc al r1 r4 0x0ab00000
};
const byte kInstruction_sbc_al_r4_r9_0x00005580[] = {
0x69, 0xf5, 0xab, 0x44 // sbc al r4 r9 0x00005580
};
const byte kInstruction_sbc_al_r3_r2_0x001fe000[] = {
0x62, 0xf5, 0xff, 0x13 // sbc al r3 r2 0x001fe000
};
const byte kInstruction_sbc_al_r14_r6_0x00000156[] = {
0x66, 0xf5, 0xab, 0x7e // sbc al r14 r6 0x00000156
};
const byte kInstruction_sbc_al_r14_r3_0x00000ab0[] = {
0x63, 0xf5, 0x2b, 0x6e // sbc al r14 r3 0x00000ab0
};
const byte kInstruction_sbc_al_r12_r13_0x000001fe[] = {
0x6d, 0xf5, 0xff, 0x7c // sbc al r12 r13 0x000001fe
};
const byte kInstruction_sbc_al_r12_r10_0x1fe00000[] = {
0x6a, 0xf1, 0xff, 0x5c // sbc al r12 r10 0x1fe00000
};
const byte kInstruction_sbc_al_r0_r9_0x2ac00000[] = {
0x69, 0xf1, 0x2b, 0x50 // sbc al r0 r9 0x2ac00000
};
const byte kInstruction_sbc_al_r11_r6_0x00000156[] = {
0x66, 0xf5, 0xab, 0x7b // sbc al r11 r6 0x00000156
};
const byte kInstruction_sbc_al_r2_r4_0x3fc00000[] = {
0x64, 0xf1, 0x7f, 0x52 // sbc al r2 r4 0x3fc00000
};
const byte kInstruction_sbc_al_r8_r13_0x00002ac0[] = {
0x6d, 0xf5, 0x2b, 0x58 // sbc al r8 r13 0x00002ac0
};
const byte kInstruction_sbc_al_r1_r5_0x00ff00ff[] = {
0x65, 0xf1, 0xff, 0x11 // sbc al r1 r5 0x00ff00ff
};
const byte kInstruction_sbc_al_r6_r1_0x0007f800[] = {
0x61, 0xf5, 0xff, 0x26 // sbc al r6 r1 0x0007f800
};
const byte kInstruction_sbc_al_r5_r1_0x00001fe0[] = {
0x61, 0xf5, 0xff, 0x55 // sbc al r5 r1 0x00001fe0
};
const byte kInstruction_sbc_al_r8_r11_0xab00ab00[] = {
0x6b, 0xf1, 0xab, 0x28 // sbc al r8 r11 0xab00ab00
};
const byte kInstruction_sbc_al_r5_r0_0xff00ff00[] = {
0x60, 0xf1, 0xff, 0x25 // sbc al r5 r0 0xff00ff00
};
const byte kInstruction_sbc_al_r14_r13_0x000000ab[] = {
0x6d, 0xf1, 0xab, 0x0e // sbc al r14 r13 0x000000ab
};
const byte kInstruction_sbc_al_r2_r4_0x05580000[] = {
0x64, 0xf1, 0xab, 0x62 // sbc al r2 r4 0x05580000
};
const byte kInstruction_sbc_al_r14_r10_0x07f80000[] = {
0x6a, 0xf1, 0xff, 0x6e // sbc al r14 r10 0x07f80000
};
const byte kInstruction_sbc_al_r10_r3_0x55800000[] = {
0x63, 0xf1, 0xab, 0x4a // sbc al r10 r3 0x55800000
};
const byte kInstruction_sbc_al_r0_r11_0x7f800000[] = {
0x6b, 0xf1, 0xff, 0x40 // sbc al r0 r11 0x7f800000
};
const byte kInstruction_sbc_al_r3_r12_0xffffffff[] = {
0x6c, 0xf1, 0xff, 0x33 // sbc al r3 r12 0xffffffff
};
const byte kInstruction_sbc_al_r2_r3_0x00000558[] = {
0x63, 0xf5, 0xab, 0x62 // sbc al r2 r3 0x00000558
};
const byte kInstruction_sbc_al_r2_r2_0x0003fc00[] = {
0x62, 0xf5, 0x7f, 0x32 // sbc al r2 r2 0x0003fc00
};
const byte kInstruction_sbc_al_r14_r10_0x15600000[] = {
0x6a, 0xf1, 0xab, 0x5e // sbc al r14 r10 0x15600000
};
const byte kInstruction_sbc_al_r3_r13_0x00000156[] = {
0x6d, 0xf5, 0xab, 0x73 // sbc al r3 r13 0x00000156
};
const byte kInstruction_sbc_al_r10_r5_0x1fe00000[] = {
0x65, 0xf1, 0xff, 0x5a // sbc al r10 r5 0x1fe00000
};
const byte kInstruction_sbc_al_r1_r5_0x00055800[] = {
0x65, 0xf5, 0xab, 0x21 // sbc al r1 r5 0x00055800
};
const byte kInstruction_sbc_al_r8_r6_0xff000000[] = {
0x66, 0xf1, 0x7f, 0x48 // sbc al r8 r6 0xff000000
};
const byte kInstruction_sbc_al_r3_r7_0x002ac000[] = {
0x67, 0xf5, 0x2b, 0x13 // sbc al r3 r7 0x002ac000
};
const byte kInstruction_sbc_al_r6_r4_0x00ff00ff[] = {
0x64, 0xf1, 0xff, 0x16 // sbc al r6 r4 0x00ff00ff
};
const byte kInstruction_sbc_al_r0_r8_0x0007f800[] = {
0x68, 0xf5, 0xff, 0x20 // sbc al r0 r8 0x0007f800
};
const byte kInstruction_sbc_al_r0_r3_0xff000000[] = {
0x63, 0xf1, 0x7f, 0x40 // sbc al r0 r3 0xff000000
};
const byte kInstruction_sbc_al_r11_r1_0xabababab[] = {
0x61, 0xf1, 0xab, 0x3b // sbc al r11 r1 0xabababab
};
const byte kInstruction_sbc_al_r14_r10_0x000001fe[] = {
0x6a, 0xf5, 0xff, 0x7e // sbc al r14 r10 0x000001fe
};
const byte kInstruction_sbc_al_r4_r11_0x002ac000[] = {
0x6b, 0xf5, 0x2b, 0x14 // sbc al r4 r11 0x002ac000
};
const byte kInstruction_sbc_al_r11_r12_0x000000ab[] = {
0x6c, 0xf1, 0xab, 0x0b // sbc al r11 r12 0x000000ab
};
const byte kInstruction_sbc_al_r3_r4_0x003fc000[] = {
0x64, 0xf5, 0x7f, 0x13 // sbc al r3 r4 0x003fc000
};
const byte kInstruction_sbc_al_r3_r13_0x0ff00000[] = {
0x6d, 0xf1, 0x7f, 0x63 // sbc al r3 r13 0x0ff00000
};
const byte kInstruction_sbc_al_r5_r4_0x00001fe0[] = {
0x64, 0xf5, 0xff, 0x55 // sbc al r5 r4 0x00001fe0
};
const byte kInstruction_sbc_al_r6_r12_0x002ac000[] = {
0x6c, 0xf5, 0x2b, 0x16 // sbc al r6 r12 0x002ac000
};
const byte kInstruction_sbc_al_r13_r13_0x1fe00000[] = {
0x6d, 0xf1, 0xff, 0x5d // sbc al r13 r13 0x1fe00000
};
const byte kInstruction_sbc_al_r0_r8_0x01560000[] = {
0x68, 0xf1, 0xab, 0x70 // sbc al r0 r8 0x01560000
};
const byte kInstruction_sbc_al_r9_r7_0x00055800[] = {
0x67, 0xf5, 0xab, 0x29 // sbc al r9 r7 0x00055800
};
const byte kInstruction_sbc_al_r6_r0_0x00000156[] = {
0x60, 0xf5, 0xab, 0x76 // sbc al r6 r0 0x00000156
};
const byte kInstruction_sbc_al_r14_r12_0x00055800[] = {
0x6c, 0xf5, 0xab, 0x2e // sbc al r14 r12 0x00055800
};
const byte kInstruction_sbc_al_r14_r0_0xab00ab00[] = {
0x60, 0xf1, 0xab, 0x2e // sbc al r14 r0 0xab00ab00
};
const byte kInstruction_sbc_al_r14_r2_0x00ab0000[] = {
0x62, 0xf5, 0x2b, 0x0e // sbc al r14 r2 0x00ab0000
};
const byte kInstruction_sbc_al_r0_r3_0x000000ab[] = {
0x63, 0xf1, 0xab, 0x00 // sbc al r0 r3 0x000000ab
};
const byte kInstruction_sbc_al_r13_r4_0x003fc000[] = {
0x64, 0xf5, 0x7f, 0x1d // sbc al r13 r4 0x003fc000
};
const byte kInstruction_sbc_al_r4_r2_0x00001560[] = {
0x62, 0xf5, 0xab, 0x54 // sbc al r4 r2 0x00001560
};
const byte kInstruction_sbc_al_r14_r4_0x2ac00000[] = {
0x64, 0xf1, 0x2b, 0x5e // sbc al r14 r4 0x2ac00000
};
const byte kInstruction_sbc_al_r4_r11_0x000003fc[] = {
0x6b, 0xf5, 0x7f, 0x74 // sbc al r4 r11 0x000003fc
};
const byte kInstruction_sbc_al_r6_r8_0x001fe000[] = {
0x68, 0xf5, 0xff, 0x16 // sbc al r6 r8 0x001fe000
};
const byte kInstruction_sbc_al_r12_r14_0x00000558[] = {
0x6e, 0xf5, 0xab, 0x6c // sbc al r12 r14 0x00000558
};
const byte kInstruction_sbc_al_r0_r13_0x0ff00000[] = {
0x6d, 0xf1, 0x7f, 0x60 // sbc al r0 r13 0x0ff00000
};
const byte kInstruction_sbc_al_r3_r11_0xabababab[] = {
0x6b, 0xf1, 0xab, 0x33 // sbc al r3 r11 0xabababab
};
const byte kInstruction_sbc_al_r4_r1_0x000001fe[] = {
0x61, 0xf5, 0xff, 0x74 // sbc al r4 r1 0x000001fe
};
const byte kInstruction_sbc_al_r0_r5_0x000002ac[] = {
0x65, 0xf5, 0x2b, 0x70 // sbc al r0 r5 0x000002ac
};
const byte kInstruction_sbc_al_r8_r5_0x0003fc00[] = {
0x65, 0xf5, 0x7f, 0x38 // sbc al r8 r5 0x0003fc00
};
const byte kInstruction_sbc_al_r7_r13_0x0002ac00[] = {
0x6d, 0xf5, 0x2b, 0x37 // sbc al r7 r13 0x0002ac00
};
const byte kInstruction_sbc_al_r10_r6_0x00015600[] = {
0x66, 0xf5, 0xab, 0x3a // sbc al r10 r6 0x00015600
};
const byte kInstruction_sbc_al_r12_r10_0x00ff0000[] = {
0x6a, 0xf5, 0x7f, 0x0c // sbc al r12 r10 0x00ff0000
};
const byte kInstruction_sbc_al_r12_r12_0x00005580[] = {
0x6c, 0xf5, 0xab, 0x4c // sbc al r12 r12 0x00005580
};
const byte kInstruction_sbc_al_r0_r4_0x02ac0000[] = {
0x64, 0xf1, 0x2b, 0x70 // sbc al r0 r4 0x02ac0000
};
const byte kInstruction_sbc_al_r9_r9_0x02ac0000[] = {
0x69, 0xf1, 0x2b, 0x79 // sbc al r9 r9 0x02ac0000
};
const byte kInstruction_sbc_al_r7_r4_0x00000558[] = {
0x64, 0xf5, 0xab, 0x67 // sbc al r7 r4 0x00000558
};
const byte kInstruction_sbc_al_r12_r14_0x07f80000[] = {
0x6e, 0xf1, 0xff, 0x6c // sbc al r12 r14 0x07f80000
};
const byte kInstruction_sbc_al_r7_r2_0xab00ab00[] = {
0x62, 0xf1, 0xab, 0x27 // sbc al r7 r2 0xab00ab00
};
const byte kInstruction_sbc_al_r1_r12_0xff000000[] = {
0x6c, 0xf1, 0x7f, 0x41 // sbc al r1 r12 0xff000000
};
const byte kInstruction_sbc_al_r8_r0_0x7f800000[] = {
0x60, 0xf1, 0xff, 0x48 // sbc al r8 r0 0x7f800000
};
const byte kInstruction_sbc_al_r7_r0_0x00000ab0[] = {
0x60, 0xf5, 0x2b, 0x67 // sbc al r7 r0 0x00000ab0
};
const byte kInstruction_sbc_al_r1_r0_0x00005580[] = {
0x60, 0xf5, 0xab, 0x41 // sbc al r1 r0 0x00005580
};
const byte kInstruction_sbc_al_r14_r1_0x001fe000[] = {
0x61, 0xf5, 0xff, 0x1e // sbc al r14 r1 0x001fe000
};
const byte kInstruction_sbc_al_r13_r13_0x0002ac00[] = {
0x6d, 0xf5, 0x2b, 0x3d // sbc al r13 r13 0x0002ac00
};
const byte kInstruction_sbc_al_r8_r12_0x0002ac00[] = {
0x6c, 0xf5, 0x2b, 0x38 // sbc al r8 r12 0x0002ac00
};
const byte kInstruction_sbc_al_r10_r10_0x00ff00ff[] = {
0x6a, 0xf1, 0xff, 0x1a // sbc al r10 r10 0x00ff00ff
};
const byte kInstruction_sbc_al_r4_r4_0x002ac000[] = {
0x64, 0xf5, 0x2b, 0x14 // sbc al r4 r4 0x002ac000
};
const byte kInstruction_sbc_al_r12_r5_0x000ab000[] = {
0x65, 0xf5, 0x2b, 0x2c // sbc al r12 r5 0x000ab000
};
const byte kInstruction_sbc_al_r1_r2_0x000003fc[] = {
0x62, 0xf5, 0x7f, 0x71 // sbc al r1 r2 0x000003fc
};
const byte kInstruction_sbc_al_r10_r11_0x001fe000[] = {
0x6b, 0xf5, 0xff, 0x1a // sbc al r10 r11 0x001fe000
};
const byte kInstruction_sbc_al_r11_r2_0x05580000[] = {
0x62, 0xf1, 0xab, 0x6b // sbc al r11 r2 0x05580000
};
const byte kInstruction_sbc_al_r2_r6_0x000000ab[] = {
0x66, 0xf1, 0xab, 0x02 // sbc al r2 r6 0x000000ab
};
const byte kInstruction_sbc_al_r6_r3_0x0000ff00[] = {
0x63, 0xf5, 0x7f, 0x46 // sbc al r6 r3 0x0000ff00
};
const byte kInstruction_sbc_al_r13_r0_0x00156000[] = {
0x60, 0xf5, 0xab, 0x1d // sbc al r13 r0 0x00156000
};
const byte kInstruction_sbc_al_r2_r9_0x00002ac0[] = {
0x69, 0xf5, 0x2b, 0x52 // sbc al r2 r9 0x00002ac0
};
const byte kInstruction_sbc_al_r11_r7_0x00055800[] = {
0x67, 0xf5, 0xab, 0x2b // sbc al r11 r7 0x00055800
};
const byte kInstruction_sbc_al_r10_r9_0x00001fe0[] = {
0x69, 0xf5, 0xff, 0x5a // sbc al r10 r9 0x00001fe0
};
const byte kInstruction_sbc_al_r10_r11_0x00156000[] = {
0x6b, 0xf5, 0xab, 0x1a // sbc al r10 r11 0x00156000
};
const byte kInstruction_sbc_al_r12_r10_0xff00ff00[] = {
0x6a, 0xf1, 0xff, 0x2c // sbc al r12 r10 0xff00ff00
};
const byte kInstruction_sbc_al_r7_r14_0x00ab00ab[] = {
0x6e, 0xf1, 0xab, 0x17 // sbc al r7 r14 0x00ab00ab
};
const byte kInstruction_sbc_al_r14_r7_0x002ac000[] = {
0x67, 0xf5, 0x2b, 0x1e // sbc al r14 r7 0x002ac000
};
const byte kInstruction_sbc_al_r5_r6_0x000ff000[] = {
0x66, 0xf5, 0x7f, 0x25 // sbc al r5 r6 0x000ff000
};
const byte kInstruction_sbc_al_r8_r1_0xff000000[] = {
0x61, 0xf1, 0x7f, 0x48 // sbc al r8 r1 0xff000000
};
const byte kInstruction_sbc_al_r8_r0_0x000002ac[] = {
0x60, 0xf5, 0x2b, 0x78 // sbc al r8 r0 0x000002ac
};
const byte kInstruction_sbc_al_r12_r6_0x00002ac0[] = {
0x66, 0xf5, 0x2b, 0x5c // sbc al r12 r6 0x00002ac0
};
const byte kInstruction_sbc_al_r14_r2_0x3fc00000[] = {
0x62, 0xf1, 0x7f, 0x5e // sbc al r14 r2 0x3fc00000
};
const byte kInstruction_sbc_al_r3_r3_0x01560000[] = {
0x63, 0xf1, 0xab, 0x73 // sbc al r3 r3 0x01560000
};
const byte kInstruction_sbc_al_r3_r12_0x0001fe00[] = {
0x6c, 0xf5, 0xff, 0x33 // sbc al r3 r12 0x0001fe00
};
const byte kInstruction_sbc_al_r8_r10_0x000002ac[] = {
0x6a, 0xf5, 0x2b, 0x78 // sbc al r8 r10 0x000002ac
};
const byte kInstruction_sbc_al_r9_r9_0x002ac000[] = {
0x69, 0xf5, 0x2b, 0x19 // sbc al r9 r9 0x002ac000
};
const byte kInstruction_sbc_al_r0_r6_0x00156000[] = {
0x66, 0xf5, 0xab, 0x10 // sbc al r0 r6 0x00156000
};
const byte kInstruction_sbc_al_r14_r7_0x0ff00000[] = {
0x67, 0xf1, 0x7f, 0x6e // sbc al r14 r7 0x0ff00000
};
const byte kInstruction_sbc_al_r1_r3_0x00005580[] = {
0x63, 0xf5, 0xab, 0x41 // sbc al r1 r3 0x00005580
};
const byte kInstruction_sbc_al_r14_r7_0x000001fe[] = {
0x67, 0xf5, 0xff, 0x7e // sbc al r14 r7 0x000001fe
};
const byte kInstruction_sbc_al_r9_r5_0x03fc0000[] = {
0x65, 0xf1, 0x7f, 0x79 // sbc al r9 r5 0x03fc0000
};
const byte kInstruction_sbc_al_r7_r14_0x002ac000[] = {
0x6e, 0xf5, 0x2b, 0x17 // sbc al r7 r14 0x002ac000
};
const byte kInstruction_sbc_al_r8_r9_0x00000558[] = {
0x69, 0xf5, 0xab, 0x68 // sbc al r8 r9 0x00000558
};
const byte kInstruction_sbc_al_r14_r1_0x007f8000[] = {
0x61, 0xf5, 0xff, 0x0e // sbc al r14 r1 0x007f8000
};
const byte kInstruction_sbc_al_r11_r0_0xab00ab00[] = {
0x60, 0xf1, 0xab, 0x2b // sbc al r11 r0 0xab00ab00
};
const byte kInstruction_sbc_al_r11_r8_0x00000156[] = {
0x68, 0xf5, 0xab, 0x7b // sbc al r11 r8 0x00000156
};
const byte kInstruction_sbc_al_r4_r10_0x00055800[] = {
0x6a, 0xf5, 0xab, 0x24 // sbc al r4 r10 0x00055800
};
const byte kInstruction_sbc_al_r2_r7_0x00007f80[] = {
0x67, 0xf5, 0xff, 0x42 // sbc al r2 r7 0x00007f80
};
const byte kInstruction_sbc_al_r0_r6_0x00558000[] = {
0x66, 0xf5, 0xab, 0x00 // sbc al r0 r6 0x00558000
};
const byte kInstruction_sbc_al_r4_r2_0x00558000[] = {
0x62, 0xf5, 0xab, 0x04 // sbc al r4 r2 0x00558000
};
const byte kInstruction_sbc_al_r2_r3_0x0007f800[] = {
0x63, 0xf5, 0xff, 0x22 // sbc al r2 r3 0x0007f800
};
const byte kInstruction_sbc_al_r14_r14_0xab00ab00[] = {
0x6e, 0xf1, 0xab, 0x2e // sbc al r14 r14 0xab00ab00
};
const byte kInstruction_sbc_al_r0_r13_0x000000ff[] = {
0x6d, 0xf1, 0xff, 0x00 // sbc al r0 r13 0x000000ff
};
const byte kInstruction_sbc_al_r10_r9_0xab00ab00[] = {
0x69, 0xf1, 0xab, 0x2a // sbc al r10 r9 0xab00ab00
};
const byte kInstruction_sbc_al_r1_r1_0x3fc00000[] = {
0x61, 0xf1, 0x7f, 0x51 // sbc al r1 r1 0x3fc00000
};
const byte kInstruction_sbc_al_r8_r6_0x002ac000[] = {
0x66, 0xf5, 0x2b, 0x18 // sbc al r8 r6 0x002ac000
};
const byte kInstruction_sbc_al_r12_r4_0x55800000[] = {
0x64, 0xf1, 0xab, 0x4c // sbc al r12 r4 0x55800000
};
const byte kInstruction_sbc_al_r6_r10_0x2ac00000[] = {
0x6a, 0xf1, 0x2b, 0x56 // sbc al r6 r10 0x2ac00000
};
const byte kInstruction_sbc_al_r7_r9_0x001fe000[] = {
0x69, 0xf5, 0xff, 0x17 // sbc al r7 r9 0x001fe000
};
const byte kInstruction_sbc_al_r4_r12_0x00005580[] = {
0x6c, 0xf5, 0xab, 0x44 // sbc al r4 r12 0x00005580
};
const byte kInstruction_sbc_al_r9_r8_0x0ab00000[] = {
0x68, 0xf1, 0x2b, 0x69 // sbc al r9 r8 0x0ab00000
};
const byte kInstruction_sbc_al_r2_r4_0xff00ff00[] = {
0x64, 0xf1, 0xff, 0x22 // sbc al r2 r4 0xff00ff00
};
const byte kInstruction_sbc_al_r8_r14_0x00001fe0[] = {
0x6e, 0xf5, 0xff, 0x58 // sbc al r8 r14 0x00001fe0
};
const byte kInstruction_sbc_al_r5_r3_0x003fc000[] = {
0x63, 0xf5, 0x7f, 0x15 // sbc al r5 r3 0x003fc000
};
const byte kInstruction_sbc_al_r2_r10_0x00ff00ff[] = {
0x6a, 0xf1, 0xff, 0x12 // sbc al r2 r10 0x00ff00ff
};
const byte kInstruction_sbc_al_r11_r12_0x15600000[] = {
0x6c, 0xf1, 0xab, 0x5b // sbc al r11 r12 0x15600000
};
const byte kInstruction_sbc_al_r1_r5_0x00002ac0[] = {
0x65, 0xf5, 0x2b, 0x51 // sbc al r1 r5 0x00002ac0
};
const byte kInstruction_sbc_al_r3_r7_0x2ac00000[] = {
0x67, 0xf1, 0x2b, 0x53 // sbc al r3 r7 0x2ac00000
};
const byte kInstruction_sbc_al_r5_r1_0xffffffff[] = {
0x61, 0xf1, 0xff, 0x35 // sbc al r5 r1 0xffffffff
};
const byte kInstruction_sbc_al_r4_r10_0xff00ff00[] = {
0x6a, 0xf1, 0xff, 0x24 // sbc al r4 r10 0xff00ff00
};
const byte kInstruction_sbc_al_r1_r2_0x00001fe0[] = {
0x62, 0xf5, 0xff, 0x51 // sbc al r1 r2 0x00001fe0
};
const byte kInstruction_sbc_al_r5_r14_0x000000ff[] = {
0x6e, 0xf1, 0xff, 0x05 // sbc al r5 r14 0x000000ff
};
const byte kInstruction_sbc_al_r14_r0_0x000ab000[] = {
0x60, 0xf5, 0x2b, 0x2e // sbc al r14 r0 0x000ab000
};
const byte kInstruction_sbc_al_r10_r3_0x00ab0000[] = {
0x63, 0xf5, 0x2b, 0x0a // sbc al r10 r3 0x00ab0000
};
const byte kInstruction_sbc_al_r10_r12_0x03fc0000[] = {
0x6c, 0xf1, 0x7f, 0x7a // sbc al r10 r12 0x03fc0000
};
const byte kInstruction_sbc_al_r8_r11_0x0007f800[] = {
0x6b, 0xf5, 0xff, 0x28 // sbc al r8 r11 0x0007f800
};
const byte kInstruction_sbc_al_r9_r13_0x0001fe00[] = {
0x6d, 0xf5, 0xff, 0x39 // sbc al r9 r13 0x0001fe00
};
const byte kInstruction_sbc_al_r12_r13_0x02ac0000[] = {
0x6d, 0xf1, 0x2b, 0x7c // sbc al r12 r13 0x02ac0000
};
const byte kInstruction_sbc_al_r3_r9_0x00ab00ab[] = {
0x69, 0xf1, 0xab, 0x13 // sbc al r3 r9 0x00ab00ab
};
const byte kInstruction_sbc_al_r10_r1_0x3fc00000[] = {
0x61, 0xf1, 0x7f, 0x5a // sbc al r10 r1 0x3fc00000
};
const byte kInstruction_sbc_al_r6_r8_0x00000558[] = {
0x68, 0xf5, 0xab, 0x66 // sbc al r6 r8 0x00000558
};
const byte kInstruction_sbc_al_r6_r12_0x0000ab00[] = {
0x6c, 0xf5, 0x2b, 0x46 // sbc al r6 r12 0x0000ab00
};
const byte kInstruction_sbc_al_r14_r13_0x000ab000[] = {
0x6d, 0xf5, 0x2b, 0x2e // sbc al r14 r13 0x000ab000
};
const byte kInstruction_sbc_al_r1_r5_0x1fe00000[] = {
0x65, 0xf1, 0xff, 0x51 // sbc al r1 r5 0x1fe00000
};
const byte kInstruction_sbc_al_r11_r3_0x02ac0000[] = {
0x63, 0xf1, 0x2b, 0x7b // sbc al r11 r3 0x02ac0000
};
const byte kInstruction_sbc_al_r9_r5_0x55800000[] = {
0x65, 0xf1, 0xab, 0x49 // sbc al r9 r5 0x55800000
};
const byte kInstruction_sbc_al_r5_r5_0x000ab000[] = {
0x65, 0xf5, 0x2b, 0x25 // sbc al r5 r5 0x000ab000
};
const byte kInstruction_sbc_al_r0_r12_0x003fc000[] = {
0x6c, 0xf5, 0x7f, 0x10 // sbc al r0 r12 0x003fc000
};
const byte kInstruction_sbc_al_r10_r4_0x0000ab00[] = {
0x64, 0xf5, 0x2b, 0x4a // sbc al r10 r4 0x0000ab00
};
const byte kInstruction_sbc_al_r3_r2_0x0000ff00[] = {
0x62, 0xf5, 0x7f, 0x43 // sbc al r3 r2 0x0000ff00
};
const byte kInstruction_sbc_al_r14_r8_0x3fc00000[] = {
0x68, 0xf1, 0x7f, 0x5e // sbc al r14 r8 0x3fc00000
};
const byte kInstruction_sbc_al_r10_r13_0x05580000[] = {
0x6d, 0xf1, 0xab, 0x6a // sbc al r10 r13 0x05580000
};
const byte kInstruction_sbc_al_r4_r13_0x00156000[] = {
0x6d, 0xf5, 0xab, 0x14 // sbc al r4 r13 0x00156000
};
const byte kInstruction_sbc_al_r7_r2_0x000002ac[] = {
0x62, 0xf5, 0x2b, 0x77 // sbc al r7 r2 0x000002ac
};
const byte kInstruction_sbc_al_r5_r10_0x000002ac[] = {
0x6a, 0xf5, 0x2b, 0x75 // sbc al r5 r10 0x000002ac
};
const byte kInstruction_sbc_al_r7_r0_0xab000000[] = {
0x60, 0xf1, 0x2b, 0x47 // sbc al r7 r0 0xab000000
};
const byte kInstruction_sbc_al_r1_r10_0x000002ac[] = {
0x6a, 0xf5, 0x2b, 0x71 // sbc al r1 r10 0x000002ac
};
const byte kInstruction_sbc_al_r11_r9_0x00002ac0[] = {
0x69, 0xf5, 0x2b, 0x5b // sbc al r11 r9 0x00002ac0
};
const byte kInstruction_sbc_al_r4_r0_0x000001fe[] = {
0x60, 0xf5, 0xff, 0x74 // sbc al r4 r0 0x000001fe
};
const byte kInstruction_sbc_al_r11_r9_0x0003fc00[] = {
0x69, 0xf5, 0x7f, 0x3b // sbc al r11 r9 0x0003fc00
};
const byte kInstruction_sbc_al_r8_r3_0x00005580[] = {
0x63, 0xf5, 0xab, 0x48 // sbc al r8 r3 0x00005580
};
const byte kInstruction_sbc_al_r4_r4_0xffffffff[] = {
0x64, 0xf1, 0xff, 0x34 // sbc al r4 r4 0xffffffff
};
const byte kInstruction_sbc_al_r1_r9_0x00000558[] = {
0x69, 0xf5, 0xab, 0x61 // sbc al r1 r9 0x00000558
};
const byte kInstruction_sbc_al_r9_r2_0x00ab0000[] = {
0x62, 0xf5, 0x2b, 0x09 // sbc al r9 r2 0x00ab0000
};
const byte kInstruction_sbc_al_r11_r6_0x00003fc0[] = {
0x66, 0xf5, 0x7f, 0x5b // sbc al r11 r6 0x00003fc0
};
const byte kInstruction_sbc_al_r11_r11_0x01fe0000[] = {
0x6b, 0xf1, 0xff, 0x7b // sbc al r11 r11 0x01fe0000
};
const byte kInstruction_sbc_al_r6_r10_0x0001fe00[] = {
0x6a, 0xf5, 0xff, 0x36 // sbc al r6 r10 0x0001fe00
};
const byte kInstruction_sbc_al_r8_r3_0x00000156[] = {
0x63, 0xf5, 0xab, 0x78 // sbc al r8 r3 0x00000156
};
const byte kInstruction_sbc_al_r12_r12_0x0002ac00[] = {
0x6c, 0xf5, 0x2b, 0x3c // sbc al r12 r12 0x0002ac00
};
const byte kInstruction_sbc_al_r8_r6_0x7f800000[] = {
0x66, 0xf1, 0xff, 0x48 // sbc al r8 r6 0x7f800000
};
const byte kInstruction_sbc_al_r5_r13_0x000002ac[] = {
0x6d, 0xf5, 0x2b, 0x75 // sbc al r5 r13 0x000002ac
};
const byte kInstruction_sbc_al_r5_r13_0x15600000[] = {
0x6d, 0xf1, 0xab, 0x55 // sbc al r5 r13 0x15600000
};
const byte kInstruction_sbc_al_r8_r8_0x000000ab[] = {
0x68, 0xf1, 0xab, 0x08 // sbc al r8 r8 0x000000ab
};
const byte kInstruction_sbc_al_r12_r14_0x00156000[] = {
0x6e, 0xf5, 0xab, 0x1c // sbc al r12 r14 0x00156000
};
const byte kInstruction_sbc_al_r1_r7_0x003fc000[] = {
0x67, 0xf5, 0x7f, 0x11 // sbc al r1 r7 0x003fc000
};
const byte kInstruction_sbc_al_r8_r0_0x00003fc0[] = {
0x60, 0xf5, 0x7f, 0x58 // sbc al r8 r0 0x00003fc0
};
const byte kInstruction_sbc_al_r14_r11_0x0007f800[] = {
0x6b, 0xf5, 0xff, 0x2e // sbc al r14 r11 0x0007f800
};
const byte kInstruction_sbc_al_r3_r8_0x00ab00ab[] = {
0x68, 0xf1, 0xab, 0x13 // sbc al r3 r8 0x00ab00ab
};
const byte kInstruction_sbc_al_r14_r8_0x55800000[] = {
0x68, 0xf1, 0xab, 0x4e // sbc al r14 r8 0x55800000
};
const byte kInstruction_sbc_al_r7_r8_0x000ff000[] = {
0x68, 0xf5, 0x7f, 0x27 // sbc al r7 r8 0x000ff000
};
const byte kInstruction_sbc_al_r4_r11_0x01fe0000[] = {
0x6b, 0xf1, 0xff, 0x74 // sbc al r4 r11 0x01fe0000
};
const byte kInstruction_sbc_al_r2_r4_0x01560000[] = {
0x64, 0xf1, 0xab, 0x72 // sbc al r2 r4 0x01560000
};
const byte kInstruction_sbc_al_r4_r3_0xffffffff[] = {
0x63, 0xf1, 0xff, 0x34 // sbc al r4 r3 0xffffffff
};
const byte kInstruction_sbc_al_r7_r8_0xab000000[] = {
0x68, 0xf1, 0x2b, 0x47 // sbc al r7 r8 0xab000000
};
const byte kInstruction_sbc_al_r0_r13_0x00000ab0[] = {
0x6d, 0xf5, 0x2b, 0x60 // sbc al r0 r13 0x00000ab0
};
const byte kInstruction_sbc_al_r1_r2_0x000001fe[] = {
0x62, 0xf5, 0xff, 0x71 // sbc al r1 r2 0x000001fe
};
const byte kInstruction_sbc_al_r8_r14_0x02ac0000[] = {
0x6e, 0xf1, 0x2b, 0x78 // sbc al r8 r14 0x02ac0000
};
const byte kInstruction_sbc_al_r4_r5_0x00558000[] = {
0x65, 0xf5, 0xab, 0x04 // sbc al r4 r5 0x00558000
};
const byte kInstruction_sbc_al_r6_r7_0xff00ff00[] = {
0x67, 0xf1, 0xff, 0x26 // sbc al r6 r7 0xff00ff00
};
const byte kInstruction_sbc_al_r8_r12_0x001fe000[] = {
0x6c, 0xf5, 0xff, 0x18 // sbc al r8 r12 0x001fe000
};
const byte kInstruction_sbc_al_r6_r4_0x07f80000[] = {
0x64, 0xf1, 0xff, 0x66 // sbc al r6 r4 0x07f80000
};
const byte kInstruction_sbc_al_r4_r0_0x00001fe0[] = {
0x60, 0xf5, 0xff, 0x54 // sbc al r4 r0 0x00001fe0
};
const byte kInstruction_sbc_al_r14_r3_0xff00ff00[] = {
0x63, 0xf1, 0xff, 0x2e // sbc al r14 r3 0xff00ff00
};
const byte kInstruction_sbc_al_r0_r6_0xab000000[] = {
0x66, 0xf1, 0x2b, 0x40 // sbc al r0 r6 0xab000000
};
const byte kInstruction_sbc_al_r12_r13_0x00000ab0[] = {
0x6d, 0xf5, 0x2b, 0x6c // sbc al r12 r13 0x00000ab0
};
const byte kInstruction_sbc_al_r12_r8_0x00000558[] = {
0x68, 0xf5, 0xab, 0x6c // sbc al r12 r8 0x00000558
};
const byte kInstruction_sbc_al_r3_r12_0x0003fc00[] = {
0x6c, 0xf5, 0x7f, 0x33 // sbc al r3 r12 0x0003fc00
};
const byte kInstruction_sbc_al_r2_r11_0x7f800000[] = {
0x6b, 0xf1, 0xff, 0x42 // sbc al r2 r11 0x7f800000
};
const byte kInstruction_sbc_al_r10_r4_0x15600000[] = {
0x64, 0xf1, 0xab, 0x5a // sbc al r10 r4 0x15600000
};
const byte kInstruction_sbc_al_r8_r7_0x0ab00000[] = {
0x67, 0xf1, 0x2b, 0x68 // sbc al r8 r7 0x0ab00000
};
const byte kInstruction_sbc_al_r10_r6_0x000000ff[] = {
0x66, 0xf1, 0xff, 0x0a // sbc al r10 r6 0x000000ff
};
const byte kInstruction_sbc_al_r3_r4_0xff00ff00[] = {
0x64, 0xf1, 0xff, 0x23 // sbc al r3 r4 0xff00ff00
};
const byte kInstruction_sbc_al_r14_r10_0x00ab0000[] = {
0x6a, 0xf5, 0x2b, 0x0e // sbc al r14 r10 0x00ab0000
};
const byte kInstruction_sbc_al_r8_r3_0x0002ac00[] = {
0x63, 0xf5, 0x2b, 0x38 // sbc al r8 r3 0x0002ac00
};
const byte kInstruction_sbc_al_r8_r8_0x00000558[] = {
0x68, 0xf5, 0xab, 0x68 // sbc al r8 r8 0x00000558
};
const byte kInstruction_sbc_al_r12_r4_0x00015600[] = {
0x64, 0xf5, 0xab, 0x3c // sbc al r12 r4 0x00015600
};
const byte kInstruction_sbc_al_r8_r1_0x002ac000[] = {
0x61, 0xf5, 0x2b, 0x18 // sbc al r8 r1 0x002ac000
};
const byte kInstruction_sbc_al_r8_r5_0x000000ab[] = {
0x65, 0xf1, 0xab, 0x08 // sbc al r8 r5 0x000000ab
};
const byte kInstruction_sbc_al_r6_r6_0x000000ab[] = {
0x66, 0xf1, 0xab, 0x06 // sbc al r6 r6 0x000000ab
};
const byte kInstruction_sbc_al_r5_r7_0x00002ac0[] = {
0x67, 0xf5, 0x2b, 0x55 // sbc al r5 r7 0x00002ac0
};
const byte kInstruction_sbc_al_r11_r4_0x00000ff0[] = {
0x64, 0xf5, 0x7f, 0x6b // sbc al r11 r4 0x00000ff0
};
const byte kInstruction_sbc_al_r9_r9_0x00000ff0[] = {
0x69, 0xf5, 0x7f, 0x69 // sbc al r9 r9 0x00000ff0
};
const byte kInstruction_sbc_al_r0_r8_0x00ff0000[] = {
0x68, 0xf5, 0x7f, 0x00 // sbc al r0 r8 0x00ff0000
};
const byte kInstruction_sbc_al_r9_r11_0x000000ab[] = {
0x6b, 0xf1, 0xab, 0x09 // sbc al r9 r11 0x000000ab
};
const byte kInstruction_sbc_al_r7_r5_0x000000ff[] = {
0x65, 0xf1, 0xff, 0x07 // sbc al r7 r5 0x000000ff
};
const byte kInstruction_sbc_al_r14_r0_0x15600000[] = {
0x60, 0xf1, 0xab, 0x5e // sbc al r14 r0 0x15600000
};
const byte kInstruction_sbc_al_r10_r9_0x00000156[] = {
0x69, 0xf5, 0xab, 0x7a // sbc al r10 r9 0x00000156
};
const byte kInstruction_sbc_al_r3_r7_0x00ff0000[] = {
0x67, 0xf5, 0x7f, 0x03 // sbc al r3 r7 0x00ff0000
};
const byte kInstruction_sbc_al_r6_r11_0xab00ab00[] = {
0x6b, 0xf1, 0xab, 0x26 // sbc al r6 r11 0xab00ab00
};
const byte kInstruction_sbc_al_r5_r2_0x002ac000[] = {
0x62, 0xf5, 0x2b, 0x15 // sbc al r5 r2 0x002ac000
};
const byte kInstruction_sbc_al_r9_r14_0x55800000[] = {
0x6e, 0xf1, 0xab, 0x49 // sbc al r9 r14 0x55800000
};
const byte kInstruction_sbc_al_r10_r13_0x15600000[] = {
0x6d, 0xf1, 0xab, 0x5a // sbc al r10 r13 0x15600000
};
const byte kInstruction_sbc_al_r13_r7_0x0ff00000[] = {
0x67, 0xf1, 0x7f, 0x6d // sbc al r13 r7 0x0ff00000
};
const byte kInstruction_sbc_al_r12_r5_0xffffffff[] = {
0x65, 0xf1, 0xff, 0x3c // sbc al r12 r5 0xffffffff
};
const byte kInstruction_sbc_al_r8_r10_0x00000156[] = {
0x6a, 0xf5, 0xab, 0x78 // sbc al r8 r10 0x00000156
};
const byte kInstruction_sbc_al_r7_r6_0x00005580[] = {
0x66, 0xf5, 0xab, 0x47 // sbc al r7 r6 0x00005580
};
const byte kInstruction_sbc_al_r6_r6_0x0ab00000[] = {
0x66, 0xf1, 0x2b, 0x66 // sbc al r6 r6 0x0ab00000
};
const byte kInstruction_sbc_al_r3_r7_0x01fe0000[] = {
0x67, 0xf1, 0xff, 0x73 // sbc al r3 r7 0x01fe0000
};
const byte kInstruction_sbc_al_r14_r9_0x00558000[] = {
0x69, 0xf5, 0xab, 0x0e // sbc al r14 r9 0x00558000
};
const byte kInstruction_sbc_al_r3_r13_0x000007f8[] = {
0x6d, 0xf5, 0xff, 0x63 // sbc al r3 r13 0x000007f8
};
const byte kInstruction_sbc_al_r10_r2_0x00055800[] = {
0x62, 0xf5, 0xab, 0x2a // sbc al r10 r2 0x00055800
};
const byte kInstruction_sbc_al_r5_r14_0x00005580[] = {
0x6e, 0xf5, 0xab, 0x45 // sbc al r5 r14 0x00005580
};
const byte kInstruction_sbc_al_r9_r12_0xab000000[] = {
0x6c, 0xf1, 0x2b, 0x49 // sbc al r9 r12 0xab000000
};
const byte kInstruction_sbc_al_r2_r14_0x00000156[] = {
0x6e, 0xf5, 0xab, 0x72 // sbc al r2 r14 0x00000156
};
const byte kInstruction_sbc_al_r6_r10_0x000ff000[] = {
0x6a, 0xf5, 0x7f, 0x26 // sbc al r6 r10 0x000ff000
};
const byte kInstruction_sbc_al_r6_r7_0x000007f8[] = {
0x67, 0xf5, 0xff, 0x66 // sbc al r6 r7 0x000007f8
};
const byte kInstruction_sbc_al_r8_r3_0x7f800000[] = {
0x63, 0xf1, 0xff, 0x48 // sbc al r8 r3 0x7f800000
};
const byte kInstruction_sbc_al_r0_r12_0x15600000[] = {
0x6c, 0xf1, 0xab, 0x50 // sbc al r0 r12 0x15600000
};
const byte kInstruction_sbc_al_r1_r6_0x00558000[] = {
0x66, 0xf5, 0xab, 0x01 // sbc al r1 r6 0x00558000
};
const byte kInstruction_sbc_al_r3_r8_0x55800000[] = {
0x68, 0xf1, 0xab, 0x43 // sbc al r3 r8 0x55800000
};
const byte kInstruction_sbc_al_r1_r14_0x000003fc[] = {
0x6e, 0xf5, 0x7f, 0x71 // sbc al r1 r14 0x000003fc
};
const byte kInstruction_sbc_al_r0_r2_0x0ab00000[] = {
0x62, 0xf1, 0x2b, 0x60 // sbc al r0 r2 0x0ab00000
};
const byte kInstruction_sbc_al_r10_r12_0x00000156[] = {
0x6c, 0xf5, 0xab, 0x7a // sbc al r10 r12 0x00000156
};
const byte kInstruction_sbc_al_r12_r14_0x03fc0000[] = {
0x6e, 0xf1, 0x7f, 0x7c // sbc al r12 r14 0x03fc0000
};
const byte kInstruction_sbc_al_r2_r5_0x0001fe00[] = {
0x65, 0xf5, 0xff, 0x32 // sbc al r2 r5 0x0001fe00
};
const byte kInstruction_sbc_al_r5_r11_0x000ab000[] = {
0x6b, 0xf5, 0x2b, 0x25 // sbc al r5 r11 0x000ab000
};
const byte kInstruction_sbc_al_r14_r14_0x0001fe00[] = {
0x6e, 0xf5, 0xff, 0x3e // sbc al r14 r14 0x0001fe00
};
const byte kInstruction_sbc_al_r13_r2_0x00003fc0[] = {
0x62, 0xf5, 0x7f, 0x5d // sbc al r13 r2 0x00003fc0
};
const byte kInstruction_sbc_al_r0_r8_0xab000000[] = {
0x68, 0xf1, 0x2b, 0x40 // sbc al r0 r8 0xab000000
};
const byte kInstruction_sbc_al_r12_r0_0x000000ab[] = {
0x60, 0xf1, 0xab, 0x0c // sbc al r12 r0 0x000000ab
};
const byte kInstruction_sbc_al_r11_r10_0x002ac000[] = {
0x6a, 0xf5, 0x2b, 0x1b // sbc al r11 r10 0x002ac000
};
const byte kInstruction_sbc_al_r12_r11_0x00ab0000[] = {
0x6b, 0xf5, 0x2b, 0x0c // sbc al r12 r11 0x00ab0000
};
const byte kInstruction_sbc_al_r2_r9_0x0ff00000[] = {
0x69, 0xf1, 0x7f, 0x62 // sbc al r2 r9 0x0ff00000
};
const byte kInstruction_sbc_al_r7_r4_0x000001fe[] = {
0x64, 0xf5, 0xff, 0x77 // sbc al r7 r4 0x000001fe
};
const byte kInstruction_sbc_al_r7_r6_0x0000ff00[] = {
0x66, 0xf5, 0x7f, 0x47 // sbc al r7 r6 0x0000ff00
};
const byte kInstruction_sbc_al_r11_r14_0x05580000[] = {
0x6e, 0xf1, 0xab, 0x6b // sbc al r11 r14 0x05580000
};
const byte kInstruction_sbc_al_r6_r10_0x00000558[] = {
0x6a, 0xf5, 0xab, 0x66 // sbc al r6 r10 0x00000558
};
const byte kInstruction_sbc_al_r11_r6_0x0001fe00[] = {
0x66, 0xf5, 0xff, 0x3b // sbc al r11 r6 0x0001fe00
};
const byte kInstruction_sbc_al_r11_r12_0xab00ab00[] = {
0x6c, 0xf1, 0xab, 0x2b // sbc al r11 r12 0xab00ab00
};
const byte kInstruction_sbc_al_r1_r8_0x7f800000[] = {
0x68, 0xf1, 0xff, 0x41 // sbc al r1 r8 0x7f800000
};
const byte kInstruction_sbc_al_r4_r3_0x0000ff00[] = {
0x63, 0xf5, 0x7f, 0x44 // sbc al r4 r3 0x0000ff00
};
const byte kInstruction_sbc_al_r5_r4_0x00ff00ff[] = {
0x64, 0xf1, 0xff, 0x15 // sbc al r5 r4 0x00ff00ff
};
const byte kInstruction_sbc_al_r12_r11_0x2ac00000[] = {
0x6b, 0xf1, 0x2b, 0x5c // sbc al r12 r11 0x2ac00000
};
const byte kInstruction_sbc_al_r1_r6_0xab00ab00[] = {
0x66, 0xf1, 0xab, 0x21 // sbc al r1 r6 0xab00ab00
};
const byte kInstruction_sbc_al_r6_r3_0x000000ab[] = {
0x63, 0xf1, 0xab, 0x06 // sbc al r6 r3 0x000000ab
};
const byte kInstruction_sbc_al_r2_r11_0x0007f800[] = {
0x6b, 0xf5, 0xff, 0x22 // sbc al r2 r11 0x0007f800
};
const byte kInstruction_sbc_al_r3_r0_0x00001560[] = {
0x60, 0xf5, 0xab, 0x53 // sbc al r3 r0 0x00001560
};
const byte kInstruction_sbc_al_r1_r14_0x00000558[] = {
0x6e, 0xf5, 0xab, 0x61 // sbc al r1 r14 0x00000558
};
const byte kInstruction_sbc_al_r10_r8_0x00558000[] = {
0x68, 0xf5, 0xab, 0x0a // sbc al r10 r8 0x00558000
};
const byte kInstruction_sbc_al_r0_r8_0x000ff000[] = {
0x68, 0xf5, 0x7f, 0x20 // sbc al r0 r8 0x000ff000
};
const byte kInstruction_sbc_al_r13_r6_0x007f8000[] = {
0x66, 0xf5, 0xff, 0x0d // sbc al r13 r6 0x007f8000
};
const byte kInstruction_sbc_al_r3_r10_0x000002ac[] = {
0x6a, 0xf5, 0x2b, 0x73 // sbc al r3 r10 0x000002ac
};
const byte kInstruction_sbc_al_r12_r2_0x0003fc00[] = {
0x62, 0xf5, 0x7f, 0x3c // sbc al r12 r2 0x0003fc00
};
const byte kInstruction_sbc_al_r5_r5_0x02ac0000[] = {
0x65, 0xf1, 0x2b, 0x75 // sbc al r5 r5 0x02ac0000
};
const byte kInstruction_sbc_al_r11_r12_0x001fe000[] = {
0x6c, 0xf5, 0xff, 0x1b // sbc al r11 r12 0x001fe000
};
const byte kInstruction_sbc_al_r0_r14_0x001fe000[] = {
0x6e, 0xf5, 0xff, 0x10 // sbc al r0 r14 0x001fe000
};
const byte kInstruction_sbc_al_r0_r14_0x02ac0000[] = {
0x6e, 0xf1, 0x2b, 0x70 // sbc al r0 r14 0x02ac0000
};
const byte kInstruction_sbc_al_r6_r7_0x0ff00000[] = {
0x67, 0xf1, 0x7f, 0x66 // sbc al r6 r7 0x0ff00000
};
const byte kInstruction_sbc_al_r10_r13_0x00000156[] = {
0x6d, 0xf5, 0xab, 0x7a // sbc al r10 r13 0x00000156
};
const byte kInstruction_sbc_al_r3_r7_0x000007f8[] = {
0x67, 0xf5, 0xff, 0x63 // sbc al r3 r7 0x000007f8
};
const byte kInstruction_sbc_al_r4_r10_0x000000ab[] = {
0x6a, 0xf1, 0xab, 0x04 // sbc al r4 r10 0x000000ab
};
const byte kInstruction_sbc_al_r0_r6_0x00000558[] = {
0x66, 0xf5, 0xab, 0x60 // sbc al r0 r6 0x00000558
};
const byte kInstruction_sbc_al_r1_r1_0x05580000[] = {
0x61, 0xf1, 0xab, 0x61 // sbc al r1 r1 0x05580000
};
const byte kInstruction_sbc_al_r8_r2_0x00001560[] = {
0x62, 0xf5, 0xab, 0x58 // sbc al r8 r2 0x00001560
};
const byte kInstruction_sbc_al_r9_r5_0x0001fe00[] = {
0x65, 0xf5, 0xff, 0x39 // sbc al r9 r5 0x0001fe00
};
const byte kInstruction_sbc_al_r13_r9_0x0ab00000[] = {
0x69, 0xf1, 0x2b, 0x6d // sbc al r13 r9 0x0ab00000
};
const byte kInstruction_sbc_al_r13_r9_0x00007f80[] = {
0x69, 0xf5, 0xff, 0x4d // sbc al r13 r9 0x00007f80
};
const byte kInstruction_sbc_al_r10_r5_0x0000ab00[] = {
0x65, 0xf5, 0x2b, 0x4a // sbc al r10 r5 0x0000ab00
};
const byte kInstruction_sbc_al_r6_r13_0x007f8000[] = {
0x6d, 0xf5, 0xff, 0x06 // sbc al r6 r13 0x007f8000
};
const byte kInstruction_sbc_al_r5_r9_0x000ab000[] = {
0x69, 0xf5, 0x2b, 0x25 // sbc al r5 r9 0x000ab000
};
const byte kInstruction_sbc_al_r4_r4_0x000000ab[] = {
0x64, 0xf1, 0xab, 0x04 // sbc al r4 r4 0x000000ab
};
const byte kInstruction_sbc_al_r13_r5_0xab00ab00[] = {
0x65, 0xf1, 0xab, 0x2d // sbc al r13 r5 0xab00ab00
};
const byte kInstruction_sbc_al_r12_r3_0x00005580[] = {
0x63, 0xf5, 0xab, 0x4c // sbc al r12 r3 0x00005580
};
const byte kInstruction_sbc_al_r0_r10_0x55800000[] = {
0x6a, 0xf1, 0xab, 0x40 // sbc al r0 r10 0x55800000
};
const byte kInstruction_sbc_al_r2_r8_0x00ab00ab[] = {
0x68, 0xf1, 0xab, 0x12 // sbc al r2 r8 0x00ab00ab
};
const byte kInstruction_sbc_al_r11_r5_0x0003fc00[] = {
0x65, 0xf5, 0x7f, 0x3b // sbc al r11 r5 0x0003fc00
};
const byte kInstruction_sbc_al_r11_r0_0x00ab0000[] = {
0x60, 0xf5, 0x2b, 0x0b // sbc al r11 r0 0x00ab0000
};
const byte kInstruction_sbc_al_r10_r2_0x000002ac[] = {
0x62, 0xf5, 0x2b, 0x7a // sbc al r10 r2 0x000002ac
};
const byte kInstruction_sbc_al_r11_r12_0x00055800[] = {
0x6c, 0xf5, 0xab, 0x2b // sbc al r11 r12 0x00055800
};
const byte kInstruction_sbc_al_r5_r13_0x00000ff0[] = {
0x6d, 0xf5, 0x7f, 0x65 // sbc al r5 r13 0x00000ff0
};
const byte kInstruction_sbc_al_r4_r14_0x15600000[] = {
0x6e, 0xf1, 0xab, 0x54 // sbc al r4 r14 0x15600000
};
const byte kInstruction_sbc_al_r10_r1_0x00003fc0[] = {
0x61, 0xf5, 0x7f, 0x5a // sbc al r10 r1 0x00003fc0
};
const byte kInstruction_sbc_al_r14_r8_0xff000000[] = {
0x68, 0xf1, 0x7f, 0x4e // sbc al r14 r8 0xff000000
};
const byte kInstruction_sbc_al_r12_r0_0x00ff0000[] = {
0x60, 0xf5, 0x7f, 0x0c // sbc al r12 r0 0x00ff0000
};
const byte kInstruction_sbc_al_r4_r5_0x3fc00000[] = {
0x65, 0xf1, 0x7f, 0x54 // sbc al r4 r5 0x3fc00000
};
const byte kInstruction_sbc_al_r14_r10_0x3fc00000[] = {
0x6a, 0xf1, 0x7f, 0x5e // sbc al r14 r10 0x3fc00000
};
const byte kInstruction_sbc_al_r10_r1_0x00015600[] = {
0x61, 0xf5, 0xab, 0x3a // sbc al r10 r1 0x00015600
};
const byte kInstruction_sbc_al_r4_r3_0xff000000[] = {
0x63, 0xf1, 0x7f, 0x44 // sbc al r4 r3 0xff000000
};
const byte kInstruction_sbc_al_r10_r10_0x02ac0000[] = {
0x6a, 0xf1, 0x2b, 0x7a // sbc al r10 r10 0x02ac0000
};
const byte kInstruction_sbc_al_r9_r9_0x000ff000[] = {
0x69, 0xf5, 0x7f, 0x29 // sbc al r9 r9 0x000ff000
};
const byte kInstruction_sbc_al_r13_r7_0x0002ac00[] = {
0x67, 0xf5, 0x2b, 0x3d // sbc al r13 r7 0x0002ac00
};
const byte kInstruction_sbc_al_r7_r8_0x00001fe0[] = {
0x68, 0xf5, 0xff, 0x57 // sbc al r7 r8 0x00001fe0
};
const byte kInstruction_sbc_al_r2_r4_0x00001560[] = {
0x64, 0xf5, 0xab, 0x52 // sbc al r2 r4 0x00001560
};
const byte kInstruction_sbc_al_r13_r7_0x00156000[] = {
0x67, 0xf5, 0xab, 0x1d // sbc al r13 r7 0x00156000
};
const byte kInstruction_sbc_al_r9_r9_0x000003fc[] = {
0x69, 0xf5, 0x7f, 0x79 // sbc al r9 r9 0x000003fc
};
const byte kInstruction_sbc_al_r0_r3_0x000ab000[] = {
0x63, 0xf5, 0x2b, 0x20 // sbc al r0 r3 0x000ab000
};
const byte kInstruction_sbc_al_r10_r12_0x0000ab00[] = {
0x6c, 0xf5, 0x2b, 0x4a // sbc al r10 r12 0x0000ab00
};
const byte kInstruction_sbc_al_r1_r13_0x00002ac0[] = {
0x6d, 0xf5, 0x2b, 0x51 // sbc al r1 r13 0x00002ac0
};
const byte kInstruction_sbc_al_r3_r10_0x001fe000[] = {
0x6a, 0xf5, 0xff, 0x13 // sbc al r3 r10 0x001fe000
};
const byte kInstruction_sbc_al_r4_r12_0x00ff00ff[] = {
0x6c, 0xf1, 0xff, 0x14 // sbc al r4 r12 0x00ff00ff
};
const byte kInstruction_sbc_al_r12_r5_0x003fc000[] = {
0x65, 0xf5, 0x7f, 0x1c // sbc al r12 r5 0x003fc000
};
const byte kInstruction_sbc_al_r11_r2_0x0001fe00[] = {
0x62, 0xf5, 0xff, 0x3b // sbc al r11 r2 0x0001fe00
};
const byte kInstruction_sbc_al_r8_r6_0x0007f800[] = {
0x66, 0xf5, 0xff, 0x28 // sbc al r8 r6 0x0007f800
};
const byte kInstruction_sbc_al_r11_r1_0x000000ff[] = {
0x61, 0xf1, 0xff, 0x0b // sbc al r11 r1 0x000000ff
};
const byte kInstruction_sbc_al_r5_r2_0x007f8000[] = {
0x62, 0xf5, 0xff, 0x05 // sbc al r5 r2 0x007f8000
};
const byte kInstruction_sbc_al_r8_r10_0xab000000[] = {
0x6a, 0xf1, 0x2b, 0x48 // sbc al r8 r10 0xab000000
};
const byte kInstruction_sbc_al_r10_r3_0x000ff000[] = {
0x63, 0xf5, 0x7f, 0x2a // sbc al r10 r3 0x000ff000
};
const byte kInstruction_sbc_al_r6_r0_0x00ff0000[] = {
0x60, 0xf5, 0x7f, 0x06 // sbc al r6 r0 0x00ff0000
};
const byte kInstruction_sbc_al_r7_r14_0x0ff00000[] = {
0x6e, 0xf1, 0x7f, 0x67 // sbc al r7 r14 0x0ff00000
};
const byte kInstruction_sbc_al_r8_r3_0x00001560[] = {
0x63, 0xf5, 0xab, 0x58 // sbc al r8 r3 0x00001560
};
const byte kInstruction_sbc_al_r13_r9_0x00000558[] = {
0x69, 0xf5, 0xab, 0x6d // sbc al r13 r9 0x00000558
};
const byte kInstruction_sbc_al_r8_r7_0x00001fe0[] = {
0x67, 0xf5, 0xff, 0x58 // sbc al r8 r7 0x00001fe0
};
const byte kInstruction_sbc_al_r13_r3_0x0003fc00[] = {
0x63, 0xf5, 0x7f, 0x3d // sbc al r13 r3 0x0003fc00
};
const byte kInstruction_sbc_al_r4_r14_0x000000ab[] = {
0x6e, 0xf1, 0xab, 0x04 // sbc al r4 r14 0x000000ab
};
const byte kInstruction_sbc_al_r14_r7_0x000000ab[] = {
0x67, 0xf1, 0xab, 0x0e // sbc al r14 r7 0x000000ab
};
const byte kInstruction_sbc_al_r11_r9_0x00558000[] = {
0x69, 0xf5, 0xab, 0x0b // sbc al r11 r9 0x00558000
};
const byte kInstruction_sbc_al_r3_r10_0x0000ff00[] = {
0x6a, 0xf5, 0x7f, 0x43 // sbc al r3 r10 0x0000ff00
};
const byte kInstruction_sbc_al_r4_r12_0x003fc000[] = {
0x6c, 0xf5, 0x7f, 0x14 // sbc al r4 r12 0x003fc000
};
const byte kInstruction_sbc_al_r11_r1_0x002ac000[] = {
0x61, 0xf5, 0x2b, 0x1b // sbc al r11 r1 0x002ac000
};
const byte kInstruction_sbc_al_r12_r0_0x7f800000[] = {
0x60, 0xf1, 0xff, 0x4c // sbc al r12 r0 0x7f800000
};
const byte kInstruction_sbc_al_r3_r9_0x00003fc0[] = {
0x69, 0xf5, 0x7f, 0x53 // sbc al r3 r9 0x00003fc0
};
const byte kInstruction_sbc_al_r6_r6_0x0ff00000[] = {
0x66, 0xf1, 0x7f, 0x66 // sbc al r6 r6 0x0ff00000
};
const byte kInstruction_sbc_al_r1_r11_0xff000000[] = {
0x6b, 0xf1, 0x7f, 0x41 // sbc al r1 r11 0xff000000
};
const byte kInstruction_sbc_al_r2_r10_0x0007f800[] = {
0x6a, 0xf5, 0xff, 0x22 // sbc al r2 r10 0x0007f800
};
const byte kInstruction_sbc_al_r12_r10_0x000002ac[] = {
0x6a, 0xf5, 0x2b, 0x7c // sbc al r12 r10 0x000002ac
};
const byte kInstruction_sbc_al_r10_r8_0x000003fc[] = {
0x68, 0xf5, 0x7f, 0x7a // sbc al r10 r8 0x000003fc
};
const byte kInstruction_sbc_al_r9_r0_0x55800000[] = {
0x60, 0xf1, 0xab, 0x49 // sbc al r9 r0 0x55800000
};
const byte kInstruction_sbc_al_r8_r7_0x1fe00000[] = {
0x67, 0xf1, 0xff, 0x58 // sbc al r8 r7 0x1fe00000
};
const byte kInstruction_sbc_al_r4_r0_0x15600000[] = {
0x60, 0xf1, 0xab, 0x54 // sbc al r4 r0 0x15600000
};
const byte kInstruction_sbc_al_r4_r0_0xff00ff00[] = {
0x60, 0xf1, 0xff, 0x24 // sbc al r4 r0 0xff00ff00
};
const byte kInstruction_sbc_al_r1_r14_0x00007f80[] = {
0x6e, 0xf5, 0xff, 0x41 // sbc al r1 r14 0x00007f80
};
const byte kInstruction_sbc_al_r7_r3_0x00ff00ff[] = {
0x63, 0xf1, 0xff, 0x17 // sbc al r7 r3 0x00ff00ff
};
const byte kInstruction_sbc_al_r10_r2_0x00001560[] = {
0x62, 0xf5, 0xab, 0x5a // sbc al r10 r2 0x00001560
};
const byte kInstruction_sbc_al_r0_r14_0xabababab[] = {
0x6e, 0xf1, 0xab, 0x30 // sbc al r0 r14 0xabababab
};
const byte kInstruction_sbc_al_r3_r4_0x007f8000[] = {
0x64, 0xf5, 0xff, 0x03 // sbc al r3 r4 0x007f8000
};
const byte kInstruction_sbc_al_r0_r2_0x003fc000[] = {
0x62, 0xf5, 0x7f, 0x10 // sbc al r0 r2 0x003fc000
};
const byte kInstruction_sbc_al_r13_r6_0x0002ac00[] = {
0x66, 0xf5, 0x2b, 0x3d // sbc al r13 r6 0x0002ac00
};
const byte kInstruction_sbc_al_r11_r5_0x00001fe0[] = {
0x65, 0xf5, 0xff, 0x5b // sbc al r11 r5 0x00001fe0
};
const byte kInstruction_sbc_al_r1_r13_0x00005580[] = {
0x6d, 0xf5, 0xab, 0x41 // sbc al r1 r13 0x00005580
};
const byte kInstruction_sbc_al_r13_r8_0x000007f8[] = {
0x68, 0xf5, 0xff, 0x6d // sbc al r13 r8 0x000007f8
};
const byte kInstruction_sbc_al_r6_r4_0x0ab00000[] = {
0x64, 0xf1, 0x2b, 0x66 // sbc al r6 r4 0x0ab00000
};
const byte kInstruction_sbc_al_r14_r10_0x1fe00000[] = {
0x6a, 0xf1, 0xff, 0x5e // sbc al r14 r10 0x1fe00000
};
const byte kInstruction_sbc_al_r7_r6_0xff00ff00[] = {
0x66, 0xf1, 0xff, 0x27 // sbc al r7 r6 0xff00ff00
};
const byte kInstruction_sbc_al_r11_r5_0xffffffff[] = {
0x65, 0xf1, 0xff, 0x3b // sbc al r11 r5 0xffffffff
};
const byte kInstruction_sbc_al_r0_r12_0xffffffff[] = {
0x6c, 0xf1, 0xff, 0x30 // sbc al r0 r12 0xffffffff
};
const byte kInstruction_sbc_al_r12_r2_0x15600000[] = {
0x62, 0xf1, 0xab, 0x5c // sbc al r12 r2 0x15600000
};
const byte kInstruction_sbc_al_r3_r12_0x000ff000[] = {
0x6c, 0xf5, 0x7f, 0x23 // sbc al r3 r12 0x000ff000
};
const byte kInstruction_sbc_al_r6_r8_0x00055800[] = {
0x68, 0xf5, 0xab, 0x26 // sbc al r6 r8 0x00055800
};
const byte kInstruction_sbc_al_r12_r7_0x05580000[] = {
0x67, 0xf1, 0xab, 0x6c // sbc al r12 r7 0x05580000
};
const byte kInstruction_sbc_al_r8_r5_0x007f8000[] = {
0x65, 0xf5, 0xff, 0x08 // sbc al r8 r5 0x007f8000
};
const byte kInstruction_sbc_al_r4_r1_0x000ab000[] = {
0x61, 0xf5, 0x2b, 0x24 // sbc al r4 r1 0x000ab000
};
const byte kInstruction_sbc_al_r13_r12_0x02ac0000[] = {
0x6c, 0xf1, 0x2b, 0x7d // sbc al r13 r12 0x02ac0000
};
const byte kInstruction_sbc_al_r9_r8_0x000000ff[] = {
0x68, 0xf1, 0xff, 0x09 // sbc al r9 r8 0x000000ff
};
const byte kInstruction_sbc_al_r1_r11_0x00005580[] = {
0x6b, 0xf5, 0xab, 0x41 // sbc al r1 r11 0x00005580
};
const byte kInstruction_sbc_al_r10_r12_0x02ac0000[] = {
0x6c, 0xf1, 0x2b, 0x7a // sbc al r10 r12 0x02ac0000
};
const byte kInstruction_sbc_al_r7_r9_0x00ab00ab[] = {
0x69, 0xf1, 0xab, 0x17 // sbc al r7 r9 0x00ab00ab
};
const byte kInstruction_sbc_al_r0_r5_0x0000ab00[] = {
0x65, 0xf5, 0x2b, 0x40 // sbc al r0 r5 0x0000ab00
};
const byte kInstruction_sbc_al_r13_r9_0x00558000[] = {
0x69, 0xf5, 0xab, 0x0d // sbc al r13 r9 0x00558000
};
const byte kInstruction_sbc_al_r0_r1_0x002ac000[] = {
0x61, 0xf5, 0x2b, 0x10 // sbc al r0 r1 0x002ac000
};
const byte kInstruction_sbc_al_r14_r1_0x00000ab0[] = {
0x61, 0xf5, 0x2b, 0x6e // sbc al r14 r1 0x00000ab0
};
const byte kInstruction_sbc_al_r2_r2_0x00000558[] = {
0x62, 0xf5, 0xab, 0x62 // sbc al r2 r2 0x00000558
};
const byte kInstruction_sbc_al_r10_r13_0x00ab00ab[] = {
0x6d, 0xf1, 0xab, 0x1a // sbc al r10 r13 0x00ab00ab
};
const byte kInstruction_sbc_al_r4_r6_0x00001560[] = {
0x66, 0xf5, 0xab, 0x54 // sbc al r4 r6 0x00001560
};
const byte kInstruction_sbc_al_r10_r0_0x00156000[] = {
0x60, 0xf5, 0xab, 0x1a // sbc al r10 r0 0x00156000
};
const byte kInstruction_sbc_al_r10_r13_0x00156000[] = {
0x6d, 0xf5, 0xab, 0x1a // sbc al r10 r13 0x00156000
};
const byte kInstruction_sbc_al_r11_r2_0x001fe000[] = {
0x62, 0xf5, 0xff, 0x1b // sbc al r11 r2 0x001fe000
};
const byte kInstruction_sbc_al_r4_r5_0x2ac00000[] = {
0x65, 0xf1, 0x2b, 0x54 // sbc al r4 r5 0x2ac00000
};
const byte kInstruction_sbc_al_r8_r8_0x02ac0000[] = {
0x68, 0xf1, 0x2b, 0x78 // sbc al r8 r8 0x02ac0000
};
const byte kInstruction_sbc_al_r9_r1_0x7f800000[] = {
0x61, 0xf1, 0xff, 0x49 // sbc al r9 r1 0x7f800000
};
const byte kInstruction_sbc_al_r8_r9_0xff00ff00[] = {
0x69, 0xf1, 0xff, 0x28 // sbc al r8 r9 0xff00ff00
};
const byte kInstruction_sbc_al_r12_r7_0x00ff00ff[] = {
0x67, 0xf1, 0xff, 0x1c // sbc al r12 r7 0x00ff00ff
};
const byte kInstruction_sbc_al_r9_r10_0x00156000[] = {
0x6a, 0xf5, 0xab, 0x19 // sbc al r9 r10 0x00156000
};
const TestResult kReferencesbc[] = {
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r14_0x02ac0000),
kInstruction_sbc_al_r13_r14_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r1_0x00156000),
kInstruction_sbc_al_r10_r1_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r0_0x000003fc),
kInstruction_sbc_al_r10_r0_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r11_0x2ac00000),
kInstruction_sbc_al_r1_r11_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r6_0x00156000),
kInstruction_sbc_al_r8_r6_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r12_0x00ff0000),
kInstruction_sbc_al_r7_r12_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r3_0x00ff0000),
kInstruction_sbc_al_r12_r3_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r7_0x0000ff00),
kInstruction_sbc_al_r4_r7_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r13_0x0ab00000),
kInstruction_sbc_al_r11_r13_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r12_0xff00ff00),
kInstruction_sbc_al_r6_r12_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r8_0x003fc000),
kInstruction_sbc_al_r12_r8_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r12_0x00ab00ab),
kInstruction_sbc_al_r5_r12_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r6_0x00ab00ab),
kInstruction_sbc_al_r7_r6_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r1_0x00ab00ab),
kInstruction_sbc_al_r0_r1_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r9_0x000001fe),
kInstruction_sbc_al_r9_r9_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r8_0xab00ab00),
kInstruction_sbc_al_r2_r8_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r10_0x00ff0000),
kInstruction_sbc_al_r9_r10_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r8_0x55800000),
kInstruction_sbc_al_r8_r8_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r7_0x00ab00ab),
kInstruction_sbc_al_r6_r7_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r9_0xff000000),
kInstruction_sbc_al_r5_r9_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r8_0x00ab0000),
kInstruction_sbc_al_r8_r8_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r8_0xab00ab00),
kInstruction_sbc_al_r5_r8_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r12_0xab000000),
kInstruction_sbc_al_r0_r12_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r11_0xab000000),
kInstruction_sbc_al_r13_r11_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r3_0xab00ab00),
kInstruction_sbc_al_r14_r3_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r1_0x0003fc00),
kInstruction_sbc_al_r0_r1_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r13_0x0ab00000),
kInstruction_sbc_al_r14_r13_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r0_0x0002ac00),
kInstruction_sbc_al_r6_r0_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r8_0x55800000),
kInstruction_sbc_al_r6_r8_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r14_0x01560000),
kInstruction_sbc_al_r2_r14_0x01560000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r13_0x03fc0000),
kInstruction_sbc_al_r5_r13_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r6_0x00000ab0),
kInstruction_sbc_al_r7_r6_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r14_0x007f8000),
kInstruction_sbc_al_r3_r14_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r4_0x00558000),
kInstruction_sbc_al_r9_r4_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r11_0x00002ac0),
kInstruction_sbc_al_r10_r11_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r5_0x003fc000),
kInstruction_sbc_al_r1_r5_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r7_0x00003fc0),
kInstruction_sbc_al_r7_r7_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r3_0x000007f8),
kInstruction_sbc_al_r5_r3_0x000007f8,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r3_0x00001560),
kInstruction_sbc_al_r4_r3_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r3_0x03fc0000),
kInstruction_sbc_al_r5_r3_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r6_0x55800000),
kInstruction_sbc_al_r2_r6_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r5_0x0000ab00),
kInstruction_sbc_al_r13_r5_0x0000ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r11_0xab00ab00),
kInstruction_sbc_al_r0_r11_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r12_0x00ff00ff),
kInstruction_sbc_al_r14_r12_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r8_0x7f800000),
kInstruction_sbc_al_r13_r8_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r2_0x15600000),
kInstruction_sbc_al_r1_r2_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r6_0xab000000),
kInstruction_sbc_al_r7_r6_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r9_0x00000ff0),
kInstruction_sbc_al_r1_r9_0x00000ff0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r8_0x0007f800),
kInstruction_sbc_al_r12_r8_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0x00ab0000),
kInstruction_sbc_al_r0_r8_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r11_0x000000ff),
kInstruction_sbc_al_r11_r11_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r13_0xff000000),
kInstruction_sbc_al_r12_r13_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r3_0x0ab00000),
kInstruction_sbc_al_r1_r3_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r10_0x0001fe00),
kInstruction_sbc_al_r2_r10_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r2_0x01fe0000),
kInstruction_sbc_al_r14_r2_0x01fe0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r4_0x000000ff),
kInstruction_sbc_al_r3_r4_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r13_0x00000558),
kInstruction_sbc_al_r3_r13_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r10_0x00055800),
kInstruction_sbc_al_r13_r10_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r10_0xff000000),
kInstruction_sbc_al_r1_r10_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r7_0x2ac00000),
kInstruction_sbc_al_r0_r7_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r1_0xab000000),
kInstruction_sbc_al_r12_r1_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r14_0x00003fc0),
kInstruction_sbc_al_r9_r14_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r2_0x2ac00000),
kInstruction_sbc_al_r7_r2_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r4_0x00001fe0),
kInstruction_sbc_al_r14_r4_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r8_0x00007f80),
kInstruction_sbc_al_r12_r8_0x00007f80,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r10_0x00000ab0),
kInstruction_sbc_al_r7_r10_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r6_0x00ab0000),
kInstruction_sbc_al_r13_r6_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r9_0x0000ff00),
kInstruction_sbc_al_r7_r9_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r12_0xff00ff00),
kInstruction_sbc_al_r2_r12_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r6_0x00000156),
kInstruction_sbc_al_r1_r6_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r5_0x03fc0000),
kInstruction_sbc_al_r7_r5_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r9_0x01fe0000),
kInstruction_sbc_al_r2_r9_0x01fe0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r12_0x00002ac0),
kInstruction_sbc_al_r10_r12_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x7f800000),
kInstruction_sbc_al_r14_r10_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r8_0x02ac0000),
kInstruction_sbc_al_r2_r8_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r9_0x000001fe),
kInstruction_sbc_al_r4_r9_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r10_0x000001fe),
kInstruction_sbc_al_r10_r10_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r6_0x3fc00000),
kInstruction_sbc_al_r6_r6_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r12_0x000003fc),
kInstruction_sbc_al_r4_r12_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r2_0x0000ff00),
kInstruction_sbc_al_r0_r2_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r0_0x003fc000),
kInstruction_sbc_al_r9_r0_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r4_0x000002ac),
kInstruction_sbc_al_r7_r4_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r6_0x7f800000),
kInstruction_sbc_al_r6_r6_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r8_0x00015600),
kInstruction_sbc_al_r6_r8_0x00015600,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r0_0x00000ff0),
kInstruction_sbc_al_r10_r0_0x00000ff0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r1_0xffffffff),
kInstruction_sbc_al_r8_r1_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r7_0x00ab00ab),
kInstruction_sbc_al_r3_r7_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r11_0x01fe0000),
kInstruction_sbc_al_r8_r11_0x01fe0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r1_0x00ff0000),
kInstruction_sbc_al_r3_r1_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r4_0x000001fe),
kInstruction_sbc_al_r5_r4_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r10_0x00000558),
kInstruction_sbc_al_r7_r10_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r13_0x00001560),
kInstruction_sbc_al_r8_r13_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r4_0x00002ac0),
kInstruction_sbc_al_r9_r4_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r7_0x03fc0000),
kInstruction_sbc_al_r9_r7_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r12_0x2ac00000),
kInstruction_sbc_al_r11_r12_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r10_0x00001fe0),
kInstruction_sbc_al_r13_r10_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r10_0x00558000),
kInstruction_sbc_al_r11_r10_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r2_0x000000ab),
kInstruction_sbc_al_r3_r2_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0x00000ab0),
kInstruction_sbc_al_r0_r8_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r7_0xab000000),
kInstruction_sbc_al_r9_r7_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r7_0x0ff00000),
kInstruction_sbc_al_r11_r7_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r2_0x7f800000),
kInstruction_sbc_al_r10_r2_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r1_0x05580000),
kInstruction_sbc_al_r3_r1_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r4_0x0ab00000),
kInstruction_sbc_al_r1_r4_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r9_0x00005580),
kInstruction_sbc_al_r4_r9_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r2_0x001fe000),
kInstruction_sbc_al_r3_r2_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r6_0x00000156),
kInstruction_sbc_al_r14_r6_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r3_0x00000ab0),
kInstruction_sbc_al_r14_r3_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r13_0x000001fe),
kInstruction_sbc_al_r12_r13_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r10_0x1fe00000),
kInstruction_sbc_al_r12_r10_0x1fe00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r9_0x2ac00000),
kInstruction_sbc_al_r0_r9_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r6_0x00000156),
kInstruction_sbc_al_r11_r6_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r4_0x3fc00000),
kInstruction_sbc_al_r2_r4_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r13_0x00002ac0),
kInstruction_sbc_al_r8_r13_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r5_0x00ff00ff),
kInstruction_sbc_al_r1_r5_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r1_0x0007f800),
kInstruction_sbc_al_r6_r1_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r1_0x00001fe0),
kInstruction_sbc_al_r5_r1_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r11_0xab00ab00),
kInstruction_sbc_al_r8_r11_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r0_0xff00ff00),
kInstruction_sbc_al_r5_r0_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r13_0x000000ab),
kInstruction_sbc_al_r14_r13_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r4_0x05580000),
kInstruction_sbc_al_r2_r4_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x07f80000),
kInstruction_sbc_al_r14_r10_0x07f80000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r3_0x55800000),
kInstruction_sbc_al_r10_r3_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r11_0x7f800000),
kInstruction_sbc_al_r0_r11_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r12_0xffffffff),
kInstruction_sbc_al_r3_r12_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r3_0x00000558),
kInstruction_sbc_al_r2_r3_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r2_0x0003fc00),
kInstruction_sbc_al_r2_r2_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x15600000),
kInstruction_sbc_al_r14_r10_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r13_0x00000156),
kInstruction_sbc_al_r3_r13_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r5_0x1fe00000),
kInstruction_sbc_al_r10_r5_0x1fe00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r5_0x00055800),
kInstruction_sbc_al_r1_r5_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r6_0xff000000),
kInstruction_sbc_al_r8_r6_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r7_0x002ac000),
kInstruction_sbc_al_r3_r7_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r4_0x00ff00ff),
kInstruction_sbc_al_r6_r4_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0x0007f800),
kInstruction_sbc_al_r0_r8_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r3_0xff000000),
kInstruction_sbc_al_r0_r3_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r1_0xabababab),
kInstruction_sbc_al_r11_r1_0xabababab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x000001fe),
kInstruction_sbc_al_r14_r10_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r11_0x002ac000),
kInstruction_sbc_al_r4_r11_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r12_0x000000ab),
kInstruction_sbc_al_r11_r12_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r4_0x003fc000),
kInstruction_sbc_al_r3_r4_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r13_0x0ff00000),
kInstruction_sbc_al_r3_r13_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r4_0x00001fe0),
kInstruction_sbc_al_r5_r4_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r12_0x002ac000),
kInstruction_sbc_al_r6_r12_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r13_0x1fe00000),
kInstruction_sbc_al_r13_r13_0x1fe00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0x01560000),
kInstruction_sbc_al_r0_r8_0x01560000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r7_0x00055800),
kInstruction_sbc_al_r9_r7_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r0_0x00000156),
kInstruction_sbc_al_r6_r0_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r12_0x00055800),
kInstruction_sbc_al_r14_r12_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r0_0xab00ab00),
kInstruction_sbc_al_r14_r0_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r2_0x00ab0000),
kInstruction_sbc_al_r14_r2_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r3_0x000000ab),
kInstruction_sbc_al_r0_r3_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r4_0x003fc000),
kInstruction_sbc_al_r13_r4_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r2_0x00001560),
kInstruction_sbc_al_r4_r2_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r4_0x2ac00000),
kInstruction_sbc_al_r14_r4_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r11_0x000003fc),
kInstruction_sbc_al_r4_r11_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r8_0x001fe000),
kInstruction_sbc_al_r6_r8_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r14_0x00000558),
kInstruction_sbc_al_r12_r14_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r13_0x0ff00000),
kInstruction_sbc_al_r0_r13_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r11_0xabababab),
kInstruction_sbc_al_r3_r11_0xabababab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r1_0x000001fe),
kInstruction_sbc_al_r4_r1_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r5_0x000002ac),
kInstruction_sbc_al_r0_r5_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r5_0x0003fc00),
kInstruction_sbc_al_r8_r5_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r13_0x0002ac00),
kInstruction_sbc_al_r7_r13_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r6_0x00015600),
kInstruction_sbc_al_r10_r6_0x00015600,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r10_0x00ff0000),
kInstruction_sbc_al_r12_r10_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r12_0x00005580),
kInstruction_sbc_al_r12_r12_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r4_0x02ac0000),
kInstruction_sbc_al_r0_r4_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r9_0x02ac0000),
kInstruction_sbc_al_r9_r9_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r4_0x00000558),
kInstruction_sbc_al_r7_r4_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r14_0x07f80000),
kInstruction_sbc_al_r12_r14_0x07f80000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r2_0xab00ab00),
kInstruction_sbc_al_r7_r2_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r12_0xff000000),
kInstruction_sbc_al_r1_r12_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r0_0x7f800000),
kInstruction_sbc_al_r8_r0_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r0_0x00000ab0),
kInstruction_sbc_al_r7_r0_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r0_0x00005580),
kInstruction_sbc_al_r1_r0_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r1_0x001fe000),
kInstruction_sbc_al_r14_r1_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r13_0x0002ac00),
kInstruction_sbc_al_r13_r13_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r12_0x0002ac00),
kInstruction_sbc_al_r8_r12_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r10_0x00ff00ff),
kInstruction_sbc_al_r10_r10_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r4_0x002ac000),
kInstruction_sbc_al_r4_r4_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r5_0x000ab000),
kInstruction_sbc_al_r12_r5_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r2_0x000003fc),
kInstruction_sbc_al_r1_r2_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r11_0x001fe000),
kInstruction_sbc_al_r10_r11_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r2_0x05580000),
kInstruction_sbc_al_r11_r2_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r6_0x000000ab),
kInstruction_sbc_al_r2_r6_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r3_0x0000ff00),
kInstruction_sbc_al_r6_r3_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r0_0x00156000),
kInstruction_sbc_al_r13_r0_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r9_0x00002ac0),
kInstruction_sbc_al_r2_r9_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r7_0x00055800),
kInstruction_sbc_al_r11_r7_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r9_0x00001fe0),
kInstruction_sbc_al_r10_r9_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r11_0x00156000),
kInstruction_sbc_al_r10_r11_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r10_0xff00ff00),
kInstruction_sbc_al_r12_r10_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r14_0x00ab00ab),
kInstruction_sbc_al_r7_r14_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r7_0x002ac000),
kInstruction_sbc_al_r14_r7_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r6_0x000ff000),
kInstruction_sbc_al_r5_r6_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r1_0xff000000),
kInstruction_sbc_al_r8_r1_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r0_0x000002ac),
kInstruction_sbc_al_r8_r0_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r6_0x00002ac0),
kInstruction_sbc_al_r12_r6_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r2_0x3fc00000),
kInstruction_sbc_al_r14_r2_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r3_0x01560000),
kInstruction_sbc_al_r3_r3_0x01560000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r12_0x0001fe00),
kInstruction_sbc_al_r3_r12_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r10_0x000002ac),
kInstruction_sbc_al_r8_r10_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r9_0x002ac000),
kInstruction_sbc_al_r9_r9_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r6_0x00156000),
kInstruction_sbc_al_r0_r6_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r7_0x0ff00000),
kInstruction_sbc_al_r14_r7_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r3_0x00005580),
kInstruction_sbc_al_r1_r3_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r7_0x000001fe),
kInstruction_sbc_al_r14_r7_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r5_0x03fc0000),
kInstruction_sbc_al_r9_r5_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r14_0x002ac000),
kInstruction_sbc_al_r7_r14_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r9_0x00000558),
kInstruction_sbc_al_r8_r9_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r1_0x007f8000),
kInstruction_sbc_al_r14_r1_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r0_0xab00ab00),
kInstruction_sbc_al_r11_r0_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r8_0x00000156),
kInstruction_sbc_al_r11_r8_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r10_0x00055800),
kInstruction_sbc_al_r4_r10_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r7_0x00007f80),
kInstruction_sbc_al_r2_r7_0x00007f80,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r6_0x00558000),
kInstruction_sbc_al_r0_r6_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r2_0x00558000),
kInstruction_sbc_al_r4_r2_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r3_0x0007f800),
kInstruction_sbc_al_r2_r3_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r14_0xab00ab00),
kInstruction_sbc_al_r14_r14_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r13_0x000000ff),
kInstruction_sbc_al_r0_r13_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r9_0xab00ab00),
kInstruction_sbc_al_r10_r9_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r1_0x3fc00000),
kInstruction_sbc_al_r1_r1_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r6_0x002ac000),
kInstruction_sbc_al_r8_r6_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r4_0x55800000),
kInstruction_sbc_al_r12_r4_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r10_0x2ac00000),
kInstruction_sbc_al_r6_r10_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r9_0x001fe000),
kInstruction_sbc_al_r7_r9_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r12_0x00005580),
kInstruction_sbc_al_r4_r12_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r8_0x0ab00000),
kInstruction_sbc_al_r9_r8_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r4_0xff00ff00),
kInstruction_sbc_al_r2_r4_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r14_0x00001fe0),
kInstruction_sbc_al_r8_r14_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r3_0x003fc000),
kInstruction_sbc_al_r5_r3_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r10_0x00ff00ff),
kInstruction_sbc_al_r2_r10_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r12_0x15600000),
kInstruction_sbc_al_r11_r12_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r5_0x00002ac0),
kInstruction_sbc_al_r1_r5_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r7_0x2ac00000),
kInstruction_sbc_al_r3_r7_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r1_0xffffffff),
kInstruction_sbc_al_r5_r1_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r10_0xff00ff00),
kInstruction_sbc_al_r4_r10_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r2_0x00001fe0),
kInstruction_sbc_al_r1_r2_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r14_0x000000ff),
kInstruction_sbc_al_r5_r14_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r0_0x000ab000),
kInstruction_sbc_al_r14_r0_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r3_0x00ab0000),
kInstruction_sbc_al_r10_r3_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r12_0x03fc0000),
kInstruction_sbc_al_r10_r12_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r11_0x0007f800),
kInstruction_sbc_al_r8_r11_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r13_0x0001fe00),
kInstruction_sbc_al_r9_r13_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r13_0x02ac0000),
kInstruction_sbc_al_r12_r13_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r9_0x00ab00ab),
kInstruction_sbc_al_r3_r9_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r1_0x3fc00000),
kInstruction_sbc_al_r10_r1_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r8_0x00000558),
kInstruction_sbc_al_r6_r8_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r12_0x0000ab00),
kInstruction_sbc_al_r6_r12_0x0000ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r13_0x000ab000),
kInstruction_sbc_al_r14_r13_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r5_0x1fe00000),
kInstruction_sbc_al_r1_r5_0x1fe00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r3_0x02ac0000),
kInstruction_sbc_al_r11_r3_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r5_0x55800000),
kInstruction_sbc_al_r9_r5_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r5_0x000ab000),
kInstruction_sbc_al_r5_r5_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r12_0x003fc000),
kInstruction_sbc_al_r0_r12_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r4_0x0000ab00),
kInstruction_sbc_al_r10_r4_0x0000ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r2_0x0000ff00),
kInstruction_sbc_al_r3_r2_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r8_0x3fc00000),
kInstruction_sbc_al_r14_r8_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r13_0x05580000),
kInstruction_sbc_al_r10_r13_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r13_0x00156000),
kInstruction_sbc_al_r4_r13_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r2_0x000002ac),
kInstruction_sbc_al_r7_r2_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r10_0x000002ac),
kInstruction_sbc_al_r5_r10_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r0_0xab000000),
kInstruction_sbc_al_r7_r0_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r10_0x000002ac),
kInstruction_sbc_al_r1_r10_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r9_0x00002ac0),
kInstruction_sbc_al_r11_r9_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r0_0x000001fe),
kInstruction_sbc_al_r4_r0_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r9_0x0003fc00),
kInstruction_sbc_al_r11_r9_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r3_0x00005580),
kInstruction_sbc_al_r8_r3_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r4_0xffffffff),
kInstruction_sbc_al_r4_r4_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r9_0x00000558),
kInstruction_sbc_al_r1_r9_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r2_0x00ab0000),
kInstruction_sbc_al_r9_r2_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r6_0x00003fc0),
kInstruction_sbc_al_r11_r6_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r11_0x01fe0000),
kInstruction_sbc_al_r11_r11_0x01fe0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r10_0x0001fe00),
kInstruction_sbc_al_r6_r10_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r3_0x00000156),
kInstruction_sbc_al_r8_r3_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r12_0x0002ac00),
kInstruction_sbc_al_r12_r12_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r6_0x7f800000),
kInstruction_sbc_al_r8_r6_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r13_0x000002ac),
kInstruction_sbc_al_r5_r13_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r13_0x15600000),
kInstruction_sbc_al_r5_r13_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r8_0x000000ab),
kInstruction_sbc_al_r8_r8_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r14_0x00156000),
kInstruction_sbc_al_r12_r14_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r7_0x003fc000),
kInstruction_sbc_al_r1_r7_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r0_0x00003fc0),
kInstruction_sbc_al_r8_r0_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r11_0x0007f800),
kInstruction_sbc_al_r14_r11_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r8_0x00ab00ab),
kInstruction_sbc_al_r3_r8_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r8_0x55800000),
kInstruction_sbc_al_r14_r8_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r8_0x000ff000),
kInstruction_sbc_al_r7_r8_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r11_0x01fe0000),
kInstruction_sbc_al_r4_r11_0x01fe0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r4_0x01560000),
kInstruction_sbc_al_r2_r4_0x01560000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r3_0xffffffff),
kInstruction_sbc_al_r4_r3_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r8_0xab000000),
kInstruction_sbc_al_r7_r8_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r13_0x00000ab0),
kInstruction_sbc_al_r0_r13_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r2_0x000001fe),
kInstruction_sbc_al_r1_r2_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r14_0x02ac0000),
kInstruction_sbc_al_r8_r14_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r5_0x00558000),
kInstruction_sbc_al_r4_r5_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r7_0xff00ff00),
kInstruction_sbc_al_r6_r7_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r12_0x001fe000),
kInstruction_sbc_al_r8_r12_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r4_0x07f80000),
kInstruction_sbc_al_r6_r4_0x07f80000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r0_0x00001fe0),
kInstruction_sbc_al_r4_r0_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r3_0xff00ff00),
kInstruction_sbc_al_r14_r3_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r6_0xab000000),
kInstruction_sbc_al_r0_r6_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r13_0x00000ab0),
kInstruction_sbc_al_r12_r13_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r8_0x00000558),
kInstruction_sbc_al_r12_r8_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r12_0x0003fc00),
kInstruction_sbc_al_r3_r12_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r11_0x7f800000),
kInstruction_sbc_al_r2_r11_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r4_0x15600000),
kInstruction_sbc_al_r10_r4_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r7_0x0ab00000),
kInstruction_sbc_al_r8_r7_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r6_0x000000ff),
kInstruction_sbc_al_r10_r6_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r4_0xff00ff00),
kInstruction_sbc_al_r3_r4_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x00ab0000),
kInstruction_sbc_al_r14_r10_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r3_0x0002ac00),
kInstruction_sbc_al_r8_r3_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r8_0x00000558),
kInstruction_sbc_al_r8_r8_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r4_0x00015600),
kInstruction_sbc_al_r12_r4_0x00015600,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r1_0x002ac000),
kInstruction_sbc_al_r8_r1_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r5_0x000000ab),
kInstruction_sbc_al_r8_r5_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r6_0x000000ab),
kInstruction_sbc_al_r6_r6_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r7_0x00002ac0),
kInstruction_sbc_al_r5_r7_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r4_0x00000ff0),
kInstruction_sbc_al_r11_r4_0x00000ff0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r9_0x00000ff0),
kInstruction_sbc_al_r9_r9_0x00000ff0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0x00ff0000),
kInstruction_sbc_al_r0_r8_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r11_0x000000ab),
kInstruction_sbc_al_r9_r11_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r5_0x000000ff),
kInstruction_sbc_al_r7_r5_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r0_0x15600000),
kInstruction_sbc_al_r14_r0_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r9_0x00000156),
kInstruction_sbc_al_r10_r9_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r7_0x00ff0000),
kInstruction_sbc_al_r3_r7_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r11_0xab00ab00),
kInstruction_sbc_al_r6_r11_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r2_0x002ac000),
kInstruction_sbc_al_r5_r2_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r14_0x55800000),
kInstruction_sbc_al_r9_r14_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r13_0x15600000),
kInstruction_sbc_al_r10_r13_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r7_0x0ff00000),
kInstruction_sbc_al_r13_r7_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r5_0xffffffff),
kInstruction_sbc_al_r12_r5_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r10_0x00000156),
kInstruction_sbc_al_r8_r10_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r6_0x00005580),
kInstruction_sbc_al_r7_r6_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r6_0x0ab00000),
kInstruction_sbc_al_r6_r6_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r7_0x01fe0000),
kInstruction_sbc_al_r3_r7_0x01fe0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r9_0x00558000),
kInstruction_sbc_al_r14_r9_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r13_0x000007f8),
kInstruction_sbc_al_r3_r13_0x000007f8,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r2_0x00055800),
kInstruction_sbc_al_r10_r2_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r14_0x00005580),
kInstruction_sbc_al_r5_r14_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r12_0xab000000),
kInstruction_sbc_al_r9_r12_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r14_0x00000156),
kInstruction_sbc_al_r2_r14_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r10_0x000ff000),
kInstruction_sbc_al_r6_r10_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r7_0x000007f8),
kInstruction_sbc_al_r6_r7_0x000007f8,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r3_0x7f800000),
kInstruction_sbc_al_r8_r3_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r12_0x15600000),
kInstruction_sbc_al_r0_r12_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r6_0x00558000),
kInstruction_sbc_al_r1_r6_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r8_0x55800000),
kInstruction_sbc_al_r3_r8_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r14_0x000003fc),
kInstruction_sbc_al_r1_r14_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r2_0x0ab00000),
kInstruction_sbc_al_r0_r2_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r12_0x00000156),
kInstruction_sbc_al_r10_r12_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r14_0x03fc0000),
kInstruction_sbc_al_r12_r14_0x03fc0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r5_0x0001fe00),
kInstruction_sbc_al_r2_r5_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r11_0x000ab000),
kInstruction_sbc_al_r5_r11_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r14_0x0001fe00),
kInstruction_sbc_al_r14_r14_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r2_0x00003fc0),
kInstruction_sbc_al_r13_r2_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0xab000000),
kInstruction_sbc_al_r0_r8_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r0_0x000000ab),
kInstruction_sbc_al_r12_r0_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r10_0x002ac000),
kInstruction_sbc_al_r11_r10_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r11_0x00ab0000),
kInstruction_sbc_al_r12_r11_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r9_0x0ff00000),
kInstruction_sbc_al_r2_r9_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r4_0x000001fe),
kInstruction_sbc_al_r7_r4_0x000001fe,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r6_0x0000ff00),
kInstruction_sbc_al_r7_r6_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r14_0x05580000),
kInstruction_sbc_al_r11_r14_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r10_0x00000558),
kInstruction_sbc_al_r6_r10_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r6_0x0001fe00),
kInstruction_sbc_al_r11_r6_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r12_0xab00ab00),
kInstruction_sbc_al_r11_r12_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r8_0x7f800000),
kInstruction_sbc_al_r1_r8_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r3_0x0000ff00),
kInstruction_sbc_al_r4_r3_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r4_0x00ff00ff),
kInstruction_sbc_al_r5_r4_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r11_0x2ac00000),
kInstruction_sbc_al_r12_r11_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r6_0xab00ab00),
kInstruction_sbc_al_r1_r6_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r3_0x000000ab),
kInstruction_sbc_al_r6_r3_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r11_0x0007f800),
kInstruction_sbc_al_r2_r11_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r0_0x00001560),
kInstruction_sbc_al_r3_r0_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r14_0x00000558),
kInstruction_sbc_al_r1_r14_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r8_0x00558000),
kInstruction_sbc_al_r10_r8_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r8_0x000ff000),
kInstruction_sbc_al_r0_r8_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r6_0x007f8000),
kInstruction_sbc_al_r13_r6_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r10_0x000002ac),
kInstruction_sbc_al_r3_r10_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r2_0x0003fc00),
kInstruction_sbc_al_r12_r2_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r5_0x02ac0000),
kInstruction_sbc_al_r5_r5_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r12_0x001fe000),
kInstruction_sbc_al_r11_r12_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r14_0x001fe000),
kInstruction_sbc_al_r0_r14_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r14_0x02ac0000),
kInstruction_sbc_al_r0_r14_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r7_0x0ff00000),
kInstruction_sbc_al_r6_r7_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r13_0x00000156),
kInstruction_sbc_al_r10_r13_0x00000156,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r7_0x000007f8),
kInstruction_sbc_al_r3_r7_0x000007f8,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r10_0x000000ab),
kInstruction_sbc_al_r4_r10_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r6_0x00000558),
kInstruction_sbc_al_r0_r6_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r1_0x05580000),
kInstruction_sbc_al_r1_r1_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r2_0x00001560),
kInstruction_sbc_al_r8_r2_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r5_0x0001fe00),
kInstruction_sbc_al_r9_r5_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r9_0x0ab00000),
kInstruction_sbc_al_r13_r9_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r9_0x00007f80),
kInstruction_sbc_al_r13_r9_0x00007f80,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r5_0x0000ab00),
kInstruction_sbc_al_r10_r5_0x0000ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r13_0x007f8000),
kInstruction_sbc_al_r6_r13_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r9_0x000ab000),
kInstruction_sbc_al_r5_r9_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r4_0x000000ab),
kInstruction_sbc_al_r4_r4_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r5_0xab00ab00),
kInstruction_sbc_al_r13_r5_0xab00ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r3_0x00005580),
kInstruction_sbc_al_r12_r3_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r10_0x55800000),
kInstruction_sbc_al_r0_r10_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r8_0x00ab00ab),
kInstruction_sbc_al_r2_r8_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r5_0x0003fc00),
kInstruction_sbc_al_r11_r5_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r0_0x00ab0000),
kInstruction_sbc_al_r11_r0_0x00ab0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r2_0x000002ac),
kInstruction_sbc_al_r10_r2_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r12_0x00055800),
kInstruction_sbc_al_r11_r12_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r13_0x00000ff0),
kInstruction_sbc_al_r5_r13_0x00000ff0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r14_0x15600000),
kInstruction_sbc_al_r4_r14_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r1_0x00003fc0),
kInstruction_sbc_al_r10_r1_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r8_0xff000000),
kInstruction_sbc_al_r14_r8_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r0_0x00ff0000),
kInstruction_sbc_al_r12_r0_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r5_0x3fc00000),
kInstruction_sbc_al_r4_r5_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x3fc00000),
kInstruction_sbc_al_r14_r10_0x3fc00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r1_0x00015600),
kInstruction_sbc_al_r10_r1_0x00015600,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r3_0xff000000),
kInstruction_sbc_al_r4_r3_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r10_0x02ac0000),
kInstruction_sbc_al_r10_r10_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r9_0x000ff000),
kInstruction_sbc_al_r9_r9_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r7_0x0002ac00),
kInstruction_sbc_al_r13_r7_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r8_0x00001fe0),
kInstruction_sbc_al_r7_r8_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r4_0x00001560),
kInstruction_sbc_al_r2_r4_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r7_0x00156000),
kInstruction_sbc_al_r13_r7_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r9_0x000003fc),
kInstruction_sbc_al_r9_r9_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r3_0x000ab000),
kInstruction_sbc_al_r0_r3_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r12_0x0000ab00),
kInstruction_sbc_al_r10_r12_0x0000ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r13_0x00002ac0),
kInstruction_sbc_al_r1_r13_0x00002ac0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r10_0x001fe000),
kInstruction_sbc_al_r3_r10_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r12_0x00ff00ff),
kInstruction_sbc_al_r4_r12_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r5_0x003fc000),
kInstruction_sbc_al_r12_r5_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r2_0x0001fe00),
kInstruction_sbc_al_r11_r2_0x0001fe00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r6_0x0007f800),
kInstruction_sbc_al_r8_r6_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r1_0x000000ff),
kInstruction_sbc_al_r11_r1_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r5_r2_0x007f8000),
kInstruction_sbc_al_r5_r2_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r10_0xab000000),
kInstruction_sbc_al_r8_r10_0xab000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r3_0x000ff000),
kInstruction_sbc_al_r10_r3_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r0_0x00ff0000),
kInstruction_sbc_al_r6_r0_0x00ff0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r14_0x0ff00000),
kInstruction_sbc_al_r7_r14_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r3_0x00001560),
kInstruction_sbc_al_r8_r3_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r9_0x00000558),
kInstruction_sbc_al_r13_r9_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r7_0x00001fe0),
kInstruction_sbc_al_r8_r7_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r3_0x0003fc00),
kInstruction_sbc_al_r13_r3_0x0003fc00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r14_0x000000ab),
kInstruction_sbc_al_r4_r14_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r7_0x000000ab),
kInstruction_sbc_al_r14_r7_0x000000ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r9_0x00558000),
kInstruction_sbc_al_r11_r9_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r10_0x0000ff00),
kInstruction_sbc_al_r3_r10_0x0000ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r12_0x003fc000),
kInstruction_sbc_al_r4_r12_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r1_0x002ac000),
kInstruction_sbc_al_r11_r1_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r0_0x7f800000),
kInstruction_sbc_al_r12_r0_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r9_0x00003fc0),
kInstruction_sbc_al_r3_r9_0x00003fc0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r6_0x0ff00000),
kInstruction_sbc_al_r6_r6_0x0ff00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r11_0xff000000),
kInstruction_sbc_al_r1_r11_0xff000000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r10_0x0007f800),
kInstruction_sbc_al_r2_r10_0x0007f800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r10_0x000002ac),
kInstruction_sbc_al_r12_r10_0x000002ac,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r8_0x000003fc),
kInstruction_sbc_al_r10_r8_0x000003fc,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r0_0x55800000),
kInstruction_sbc_al_r9_r0_0x55800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r7_0x1fe00000),
kInstruction_sbc_al_r8_r7_0x1fe00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r0_0x15600000),
kInstruction_sbc_al_r4_r0_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r0_0xff00ff00),
kInstruction_sbc_al_r4_r0_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r14_0x00007f80),
kInstruction_sbc_al_r1_r14_0x00007f80,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r3_0x00ff00ff),
kInstruction_sbc_al_r7_r3_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r2_0x00001560),
kInstruction_sbc_al_r10_r2_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r14_0xabababab),
kInstruction_sbc_al_r0_r14_0xabababab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r4_0x007f8000),
kInstruction_sbc_al_r3_r4_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r2_0x003fc000),
kInstruction_sbc_al_r0_r2_0x003fc000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r6_0x0002ac00),
kInstruction_sbc_al_r13_r6_0x0002ac00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r5_0x00001fe0),
kInstruction_sbc_al_r11_r5_0x00001fe0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r13_0x00005580),
kInstruction_sbc_al_r1_r13_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r8_0x000007f8),
kInstruction_sbc_al_r13_r8_0x000007f8,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r4_0x0ab00000),
kInstruction_sbc_al_r6_r4_0x0ab00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r10_0x1fe00000),
kInstruction_sbc_al_r14_r10_0x1fe00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r6_0xff00ff00),
kInstruction_sbc_al_r7_r6_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r5_0xffffffff),
kInstruction_sbc_al_r11_r5_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r12_0xffffffff),
kInstruction_sbc_al_r0_r12_0xffffffff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r2_0x15600000),
kInstruction_sbc_al_r12_r2_0x15600000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r3_r12_0x000ff000),
kInstruction_sbc_al_r3_r12_0x000ff000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r6_r8_0x00055800),
kInstruction_sbc_al_r6_r8_0x00055800,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r7_0x05580000),
kInstruction_sbc_al_r12_r7_0x05580000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r5_0x007f8000),
kInstruction_sbc_al_r8_r5_0x007f8000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r1_0x000ab000),
kInstruction_sbc_al_r4_r1_0x000ab000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r12_0x02ac0000),
kInstruction_sbc_al_r13_r12_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r8_0x000000ff),
kInstruction_sbc_al_r9_r8_0x000000ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r1_r11_0x00005580),
kInstruction_sbc_al_r1_r11_0x00005580,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r12_0x02ac0000),
kInstruction_sbc_al_r10_r12_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r7_r9_0x00ab00ab),
kInstruction_sbc_al_r7_r9_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r5_0x0000ab00),
kInstruction_sbc_al_r0_r5_0x0000ab00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r13_r9_0x00558000),
kInstruction_sbc_al_r13_r9_0x00558000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r0_r1_0x002ac000),
kInstruction_sbc_al_r0_r1_0x002ac000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r14_r1_0x00000ab0),
kInstruction_sbc_al_r14_r1_0x00000ab0,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r2_r2_0x00000558),
kInstruction_sbc_al_r2_r2_0x00000558,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r13_0x00ab00ab),
kInstruction_sbc_al_r10_r13_0x00ab00ab,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r6_0x00001560),
kInstruction_sbc_al_r4_r6_0x00001560,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r0_0x00156000),
kInstruction_sbc_al_r10_r0_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r10_r13_0x00156000),
kInstruction_sbc_al_r10_r13_0x00156000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r11_r2_0x001fe000),
kInstruction_sbc_al_r11_r2_0x001fe000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r4_r5_0x2ac00000),
kInstruction_sbc_al_r4_r5_0x2ac00000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r8_0x02ac0000),
kInstruction_sbc_al_r8_r8_0x02ac0000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r1_0x7f800000),
kInstruction_sbc_al_r9_r1_0x7f800000,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r8_r9_0xff00ff00),
kInstruction_sbc_al_r8_r9_0xff00ff00,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r12_r7_0x00ff00ff),
kInstruction_sbc_al_r12_r7_0x00ff00ff,
},
{
ARRAY_SIZE(kInstruction_sbc_al_r9_r10_0x00156000),
kInstruction_sbc_al_r9_r10_0x00156000,
},
};
#endif // VIXL_ASSEMBLER_COND_RD_RN_OPERAND_CONST_T32_SBC_H_
| [
"997530783@qq.com"
] | 997530783@qq.com |
10261cb6f856847edcc2b81b7095cb3a80985b6a | 96d536bd4a8b35b6f17952257df426fd5405cf2e | /Project/Advanced/HeaderFile.h | 7cfb0cc73b17887e8ad61c09011cac04b5774002 | [] | no_license | tristum/FlareTestDiscard | e72364ea4cbae813556ed27120a71d9834d91d76 | cb2e555e8837f4053fcf53c7ec0fe50305c13c4f | refs/heads/master | 2021-01-10T02:24:41.949952 | 2016-04-01T19:21:05 | 2016-04-01T19:21:05 | 51,393,685 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 83 | h |
#define aboutZombies 1000
#define firstName 1001
#define whatsNext 1002
| [
"cmimoso@alertlogic.com"
] | cmimoso@alertlogic.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.