Global Namespace

// namespaces

namespace xf
    namespace xf::codec
        namespace xf::codec::details
    namespace xf::common
        namespace xf::common::utils_hw
            namespace xf::common::utils_hw::details

// typedefs

typedef uint16_t CHType
typedef ap_uint <14> HCODE_T
typedef ap_fixed <38, 24> ca_x_t
typedef ap_fixed <38, 24> cb_x_t
typedef ap_fixed <38, 18> ca_b_t
typedef ap_fixed <38, 21> cb_b_t
typedef int16_t coef_t
typedef uint8_t pix_t
typedef int16_t epix_t
typedef ap_int <8* (4)> DT
typedef ap_uint <32> HLS_SIZE_T
typedef ap_uint <5> HLS_CHANNEL_T
typedef ap_uint <32> HLS_SIZE_T
typedef ap_uint <5> HLS_CHANNEL_T
typedef unsigned char uint8_t
typedef int int32_t
typedef short int16_t
typedef unsigned int uint32_t
typedef unsigned short int uint16_t

// enums

enum
{
    B_DC_PRED = 0
    B_TM_PRED = 1
    B_VE_PRED = 2
    B_HE_PRED = 3
    B_RD_PRED = 4
    B_VR_PRED = 5
    B_LD_PRED = 6
    B_VL_PRED = 7
    B_HD_PRED = 8
    B_HU_PRED = 9
    NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED
    DC_PRED = B_DC_PRED
    V_PRED = B_VE_PRED
    H_PRED = B_HE_PRED
    TM_PRED = B_TM_PRED
    B_PRED = NUM_BMODES
    NUM_PRED_MODES = 4
    B_DC_PRED_NOTOP = 4
    B_DC_PRED_NOLEFT = 5
    B_DC_PRED_NOTOPLEFT = 6
    NUM_B_DC_MODES = 7
}

enum
{
    NZ_CNT_7x7
    NZ_CNT_1x8
    NZ_CNT_8x1
    NOIS_CNT
    NOIS_CNT_DC
    THRE_CNT
    EXP_CNT
    EXP_CNT_X
    EXP_CNT_DC
    SIGN_CNT
}

enum COLOR_FORMAT
enum Type
enum hls_Index

// structs

struct AllPicInfo
struct AllPicInfo_kernel
struct COEF8
struct Config
struct ConfigKernel3
struct Quantizer
struct WD_AXI
struct ap_NoneZero
struct coeff_64
struct coeff_77_t
struct coeff_edge_t
struct decOutput
struct hls_Branch
struct hls_Model
struct hls_QMatrix
struct pix_edge_t
struct str_dis
struct str_rd
struct str_rd_i4
struct struct_arith
struct struct_ctx_edge
struct struct_edge_data
struct tmp_struct

// unions

template <
    typename MType,
    typename DType
    >
union cast

template <typename DT>
union cast <DT, int8_t>

template <typename DT>
union cast <DT, int64_t>

template <typename DT>
union cast <DT, int32_t>

template <typename DT>
union cast <DT, uint32_t>

// classes

class Bicubic

template <
    int ROWS,
    int COLS,
    typename T
    >
class LineBuffer <ROWS, COLS, T, 1>

template <
    int ROWS,
    int COLS,
    typename T,
    int RESHAPE = 0
    >
class LineBuffer

template <
    int ROWS,
    int COLS,
    typename T
    >
class LineBuffer <ROWS, COLS, T, 0>

template <
    int ROWS,
    int COLS,
    typename T
    >
class Window

class hls_AlignedBlock
class stt_dis
class stt_range

// global variables

const int PIXEL_W
const int PIXEL_H
const int FRAME_DIM
const int ALL_PIXEL
const int MAX_NUM_BLK88_W
const int MAX_NUM_BLK88_H
const int MAX_NUM_BLK88
const int MAX_ORDERS_SIZE
const int MAX_QF_THRESH_SIZE
const int MAX_CTX_MAP_SIZE
const int MAX_AC_TOKEN_SIZE
const int PIXEL_W
const int PIXEL_H
const int FRAME_DIM
const int ALL_PIXEL
const int BLOCK8_W
const int BLOCK8_H
const int BLOCK8_NUM
const int TILE_W
const int TILE_H
const int MAX_ORDER
const int MAX_NUM_CONFIG
const size_t kBlockDim
const size_t kColorTileDim
const size_t kDCTBlockSize
const size_t kEncTileDimInBlocks
const int kGlobalScaleDenom
const size_t kColorTileDimInBlocks
const int global_scale
const float global_scale_float
const float inv_global_scale
static const uint8_t kDefaultColorFactor
static float color_scale
static const float kYToBRatio
static float base_correlation_x
static float base_correlation_b
static const float kDefaultQuantBias[4]
const float qmx8x8[64]
const float qmb8x8[64]
const float qmx16x16[256]
const float qmb16x16[256]
const float qmx32x32[1024]
const float qmb32x32[1024]
static float dequant_table[]
static float inv_dequant_stable[]
static ap_uint <4> hls_nonzero_to_bin_9[50]
static const unsigned char hls_unzigzag49[]
static const uint8_t hls_raster_to_jpeg_zigzag[64]
static const uint8_t hls_jpeg_zigzag_to_raster[64]
static const uint8_t hls_raster_to_aligned[64]
static const uint8_t hls_zigzag_to_aligned[64]
const short hls_icos_base_8192_scaled[64]
const short hls_icos_idct_linear_8192_scaled[64]
uint8_t Shift_table[256][2]
const float kDCTScales2[2]
const float kIDCTScales2[2]
const float kDCTScales4[4]
const float kIDCTScales4[4]
const float kDCTScales8[8]
const float kIDCTScales8[8]
const float kIDCTScales16[16]
const float kDCTScales16[16]
const float kIDCTScales32[32]
const float kDCTScales32[32]
const float kL1Norm2[2]
const float kL1Norm4[4]
const float kL1Norm8[8]
const float kL1Norm16[16]
const float kL1Norm32[32]
const float kL1NormInv2[2]
const float kL1NormInv4[4]
const float kL1NormInv8[8]
const float kL1NormInv16[16]
const float kL1NormInv32[32]
const float dequant0_matrix4x4[3][64]
const float dequant0_matrix8x8[3][64]
const float dequant0_matrix16x16[3][256]
const float dequant0_matrix32x32[3][1024]
const float dequant1_matrix4x4[3][64]
const float dequant1_matrix8x8[3][64]
const float dequant1_matrix16x16[3][256]
const float dequant1_matrix32x32[3][1024]
const float inv_dequant0_matrix8x8[3][64]
const float inv_dequant0_matrix16x16[3][256]
const float inv_dequant0_matrix32x32[3][1024]
const float inv_dequant_matrix4x4[3][64]
const float inv_dequant_matrix8x8[3][64]
const float inv_dequant_matrix16x16[3][256]
const float inv_dequant_matrix32x32[3][1024]
const float dequantY_matrix4x4[64]
const float dequantY_matrix8x8[64]
const float dequantY_matrix16x16[256]
const float dequantY_matrix32x32[1024]
const float inv_dequantY_matrix4x4[64]
const float inv_dequantY_matrix8x8[64]
const float inv_dequantY_matrix16x16[256]
const float inv_dequantY_matrix32x32[1024]
const float dequantDCx
const float dequantDCy
const float dequantDCb
const float invDequantDCx
const float invDequantDCy
const float invDequantDCb
static const int depth_to_buf
static const int kRadius
static const float kScaleR
static const float kScaleG
static const float kInvScaleR
static const float kInvScaleG
static const double kGaborishInverse
static const float kOpsinAbsorbanceMatrix[9]
static const float kOpsinAbsorbanceBias[3]
static const double kGaborish[5]
static float qmxlocal[64]
static float qmblocal[64]
static float qmxglb[64]
static float qmbglb[64]
const int Ninstances
const int NasyncDepth
const ap_uint <12> my_VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES]
static const uint8_t hls_VP8CoeffsUpdateProba[4][8][3][11]
static const ap_uint <11> hls_VP8EntropyCost[256]
static const ap_uint <9> VP8LevelCodes_hls[67][2]
const uint8_t hls_VP8CoeffsProba0[4][8][3][11]

// macros

#define A44
#define ACGROUP_SIZE
#define AC_N
#define ALL_PIXEL

#define AP_AVG2( \
    a, \
    b, \
    wd \
    )

#define AP_AVG3( \
    a, \
    b, \
    c, \
    wd \
    )

#define AP_DST( \
    sb, \
    x, \
    y, \
    wd \
    )

#define AP_TREEADD2( \
    v0, \
    v1, \
    wd \
    )

#define AP_TREEADD4( \
    v0, \
    v1, \
    v2, \
    v3, \
    wd \
    )

#define AP_TREEADD4_VCT( \
    vct4, \
    wd \
    )

#define AVG2( \
    a, \
    b \
    )

#define AVG3( \
    a, \
    b, \
    c \
    )

#define AXI_CMAP
#define AXI_OUT
#define AXI_QF
#define AXI_SZ
#define AXI_WIDTH
#define AXI_WIDTH
#define AXI_WIDTH
#define B44
#define BITS_AXI
#define BITS_DDR
#define BLKDIM
#define BLOCK_SIZE
#define BPS
#define BUF_DEPTH
#define BURST_LENTH
#define BURST_LENTH

#define B_SHORT( \
    v1, \
    v2 \
    )

#define C44
#define CH_W
#define CMPhuff

#define CPY16( \
    vc, \
    ap, \
    wd \
    )

#define CPY16U( \
    vc, \
    ap, \
    wd \
    )

#define D44
#define DCGROUP_SIZE
#define DC_N
#define DEBUG
#define DEBUGAXItoPikAcStream
#define DEBUGAXItoStream

#define DEVLI( \
    s, \
    n \
    )

#define DHT1
#define DHT2
#define DHT_M
#define DHT_S

#define DIVCEIL( \
    a, \
    b \
    )

#define DIV_FOR_WD_AXI

#define DST( \
    x, \
    y \
    )

#define DT_SZ
#define E44
#define ELEM_SPACE
#define F44
#define G44
#define H44
#define I44
#define J44
#define K44
#define L44
#define LG2_MAX_H_PIX
#define LG2_MAX_NUM_MB_H
#define LG2_MAX_NUM_MB_W
#define LG2_MAX_W_PIX
#define LG2_NUM_BURST_READ
#define MAXCMP_BC
#define MAX_AC_GROUP
#define MAX_AC_HISTO_SIZE
#define MAX_AC_SIZE
#define MAX_COEF_AXI
#define MAX_DC_GROUP
#define MAX_DC_HISTO_SIZE
#define MAX_DC_SIZE
#define MAX_DEC_PIX
#define MAX_DEEP_LOOP
#define MAX_EXPONENT_PIX
#define MAX_EXPONENT_PIX
#define MAX_HEIGHT
#define MAX_H_PIX
#define MAX_NUM_AC
#define MAX_NUM_AXI
#define MAX_NUM_BLOCK88
#define MAX_NUM_BLOCK88
#define MAX_NUM_BLOCK88
#define MAX_NUM_BLOCK88_H
#define MAX_NUM_BLOCK88_H
#define MAX_NUM_BLOCK88_H
#define MAX_NUM_BLOCK88_H_TITLE
#define MAX_NUM_BLOCK88_W
#define MAX_NUM_BLOCK88_W
#define MAX_NUM_BLOCK88_W
#define MAX_NUM_BLOCK88_W_TITLE
#define MAX_NUM_COEF
#define MAX_NUM_COEF
#define MAX_NUM_COLOR
#define MAX_NUM_COLOR
#define MAX_NUM_COLOR
#define MAX_NUM_CONFIG
#define MAX_NUM_DC
#define MAX_NUM_GROUP
#define MAX_NUM_MB
#define MAX_NUM_MB_H
#define MAX_NUM_MB_W
#define MAX_NUM_ORDER
#define MAX_NUM_PIX
#define MAX_NUM_PIX
#define MAX_NUM_PIXEL
#define MAX_PIX_H
#define MAX_PIX_H
#define MAX_PIX_W
#define MAX_PIX_W
#define MAX_SIZE_COEF
#define MAX_SIZE_COEF
#define MAX_WIDTH
#define MAX_W_PIX
#define MY_MAX_LEVEL
#define MY_SHARPEN_BITS

#define NUM_B2PIX( \
    bx, \
    by \
    )

#define NUM_B2SB( \
    bx, \
    by \
    )

#define NUM_BURST_READ
#define NUM_Bn(mbn)
#define NUM_COEF_AXI

#define NUM_MB2B( \
    mx, \
    my \
    )

#define NUM_MB2PIX( \
    mx, \
    my \
    )

#define NUM_MB2SB( \
    mx, \
    my \
    )

#define NUM_MBSB(n_sb)
#define NUM_MBn2SBn(mbn)
#define NUM_Sn(mbn)
#define OFF_NUM_MB_32
#define OFF_PID_PROB_8BIT
#define OUT_WIDTH

#define SB2MB_X( \
    Bn, \
    Sbn \
    )

#define SB2MB_XP( \
    Bn, \
    Sbn, \
    pos \
    )

#define SB2MB_Y( \
    Bn, \
    Sbn \
    )

#define SB2MB_YP( \
    Bn, \
    Sbn, \
    pos \
    )

#define SB_GET( \
    sb, \
    line, \
    col, \
    wd \
    )

#define SB_SET( \
    sb, \
    line, \
    col, \
    wd, \
    val \
    )

#define SB_SET_COL_SB( \
    sb, \
    col, \
    wd, \
    sbs \
    )

#define SB_SET_COL_VAL( \
    sb, \
    col, \
    wd, \
    val \
    )

#define SB_SET_COL_VCT( \
    sb, \
    col, \
    wd, \
    vect \
    )

#define SB_SET_LINE_SB( \
    sb, \
    line, \
    wd, \
    sbs \
    )

#define SB_SET_LINE_VAL( \
    sb, \
    line, \
    wd, \
    val \
    )

#define SB_SET_LINE_VCT( \
    sb, \
    line, \
    wd, \
    val \
    )

#define SB_SET_VAL( \
    sb, \
    line, \
    col, \
    wd, \
    val \
    )

#define SCALE1
#define SCALE2
#define SCAL_AXI

#define SET16( \
    vc, \
    ap, \
    wd \
    )

#define SIZE32_AC_STATE
#define SIZE32_MEM_BW
#define SIZE32_MEM_INFO
#define SIZE32_MEM_LEVEL
#define SIZE32_MEM_PRED
#define SIZE32_MEM_RET
#define SIZE32_MEM_UVSRC
#define SIZE32_MEM_YSRC
#define SIZE8_MEM_BW
#define SIZE8_MEM_PRED
#define SIZE8_MEM_PROB
#define SIZE8_MEM_RET
#define SIZE_P_INFO
#define SIZE_P_OUT
#define SIZE_P_USRC
#define SIZE_P_VSRC
#define SIZE_P_YSRC
#define STRIP_COEFF_AXI
#define STTDIS
#define STTRANGE
#define SYSTEM_MAX_COMP_BPP
#define SYSTEM_MIN_COMP_RATIO
#define TILE_SIZE

#define TOKEN_ID2( \
    t, \
    b \
    )

#define VCT4_SET_LINE_SAME_VAL( \
    vector, \
    wd, \
    val \
    )

#define VCT_GET( \
    vect, \
    mi, \
    wd \
    )

#define VCT_SET_COL_SB( \
    sb, \
    col, \
    wd, \
    vect \
    )

#define VCT_SET_VAL( \
    vect, \
    mi, \
    wd, \
    val \
    )

#define VCT_SET_VAL_ALL( \
    vect, \
    mii, \
    wd, \
    val \
    )

#define WD_BUS_BYTE
#define WD_DCT
#define WD_DISTO
#define WD_FAST
#define WD_IDCT
#define WD_IQ
#define WD_IQT
#define WD_IWHT
#define WD_LEVEL
#define WD_LMD
#define WD_MLEVEL
#define WD_MODE
#define WD_PIX
#define WD_Q
#define WD_QT
#define WD_RD_SCORE
#define WD_SSE16
#define WD_SSE4
#define WD_SUB
#define WD_TTR
#define WD_TTW
#define WD_WHT
#define WD_bias
#define WD_iq
#define WD_q
#define WD_sharpen
#define WD_zthresh
#define XBLOCKS_32X32
#define XF_UTILS_HW_ASSERT(b)

#define XF_UTILS_HW_STATIC_ASSERT( \
    b, \
    m \
    )

#define XGROUPS_512X512
#define YBLOCKS_32X32
#define YGROUPS_512X512
#define ZIGZAG(k)
#define _KEEP_PSNR_
#define _MACRO_ABS(a)

#define _MACRO_MIN( \
    a, \
    b \
    )

#define _UTILS_XACC_JPEG_HPP_
#define _XACC_77_H_
#define _XACC_ARITH_H_
#define _XACC_COMMON_HPP_
#define _XACC_DC_HPP_
#define _XACC_EDGES_HPP_
#define _XACC_JPEGDECODER_HPP_
#define _XACC_MODEL_HPP_
#define _XF_IMAGE_PRINT(msg...)
#define _XF_IMAGE_VOID_CAST
#define _XMODIFIED_HPP_
#define hls_ANS_LOG_TAB_SIZE
#define hls_ANS_SIGNATURE
#define hls_ANS_TAB_MASK
#define hls_ANS_TAB_SIZE
#define hls_MAX_ALPHABET_SIZE
#define hls_NumHistograms
#define hls_kANSBufferSize
#define hls_kAlphabetSize
#define hls_kClustersLimit
#define hls_kDcGroupDimInBlocks
#define hls_kEntropyCodingNumSymbols
#define hls_kGroupDim
#define hls_kHybridEncodingDirectSplitExponent
#define hls_kHybridEncodingSplitToken
#define hls_kMaxBufSize
#define hls_kMinClustersForHistogramRemap
#define hls_kNumContexts
#define hls_kNumPredictors
#define hls_kNumStaticContexts
#define hls_kNumStaticOrderFreeContexts
#define hls_kNumStaticZdensContexts
#define hls_kOrderContexts
#define hls_kRleSymStart
#define hls_kTileDim
#define hls_kTokenMaxSize
#define hls_kTotalSize