namespace details


mcu_decoder

#include "XAcc_jpegdecoder.hpp"
void mcu_decoder (
    hls::stream <CHType>& image_strm,
    hls::stream <bool>& eof_strm,
    const uint16_t dht_tbl1 [2][2][1<< (9)],
    const uint16_t dht_tbl2 [2][2][1<< (10)],
    ap_uint <12> hls_cmp,
    const uint8_t hls_cs_cmpc,
    const uint8_t hls_mbs [(3)],
    const uint16_t hls_mcuh,
    const uint32_t hls_mcuc,
    bool& rtn2,
    uint32_t& rst_cnt,
    hls::stream <ap_uint <24>>& block_strm
    )

Level 1 : decode all mcu.

Parameters:

CH_W size of data path in dataflow region, in bit. when CH_W is 16, the decoder could decode one symbol per cycle in about 99% cases. when CH_W is 8 , the decoder could decode one symbol per cycle in about 80% cases, but use less resource.
image_strm the stream of compressed data after SOS marker.
eof_strm the stream of end flag for image_strm, synchronous signal using false and an addtional true in the end.
dht_tbl1/dht_tbl2 the segment data of Define huffman table marker.
hls_cmp the shift register organized by the index of each color component.
image info include hls_cs_cmpc/hls_mbs/hls_mcuh/hls_mcuc is just for csim tests.
block_strm the stream of coefficients in block,23:is_rst, 22:is_endblock,21~16:bpos,15~0:block val

hls_next_mcupos2

#include "XAcc_jpegdecoder.hpp"
void hls_next_mcupos2 (
    hls::stream <ap_uint <24>>& block_strm,
    int16_t hls_block [(3)*(1036800)*64],
    int hls_sfv [4],
    int hls_sfh [4],
    const uint8_t hls_mbs [4],
    int hls_bch,
    int hls_bc,
    int32_t hls_mcuc,
    uint8_t hls_cs_cmpc,
    bool rtn2,
    int& sta
    )

convert strm to Aligned_block

Parameters:

block_strm the stream of coefficients in block,23:is_rst, 22:is_endblock,21~16:bpos,15~0:block val
hls_block the maxsize block, will be copy to the aligned_block
hls_sfv the sample factor vertical for each component
hls_sfh the sample factor horizontal for each component
hls_mbs the blocks in mcu for each component.
hls_bch the max block count horizontal (interleaved)
hls_bc the max block count (all) (interleaved)
sta the status of the process, 0: keep doing, 1: reset decoder(todo), 2: decode done