Skip to content

Commit bdd2301

Browse files
SDA USRsdausr
authored andcommitted
JpegDec cornner error fixed (#336)
* Squashed 'hpc/' changes from 1c6ac0e..f28aa9a f28aa9a update release notes e9f956a Merge branch 'dev2021.1' into next 04c17bc update release notes 366f577 update release notes 26599b6 Merge branch 'dev2021.1' into next 4e191d6 updates a40a413 update notes 01d565a Merge branch 'next' of gitenterprise.xilinx.com:FaaSApps/xf_hpc into next fd999c0 Merge branch 'dev2021.1' into next dbe158b fix version error bb0beb4 Merge pull request #77 from liangm/next 95b21eb merge dev2021.1 4ee28f5 Merge branch 'dev2021.1' of gitenterprise.xilinx.com:FaaSApps/xf_hpc into dev2021.1 a188c06 update makefiles 26fd0ea update release notes b7d6078 Update params.mk 550280c Update params.mk git-subtree-dir: hpc git-subtree-split: f28aa9aab61bf0cb761a7844986cad6a2320479f * Squashed 'codec/' changes from de296e9..15255a2 15255a2 Merge pull request #81 from yunleiz/mergenext b0d5c50 [kernel] fixed clamping after the idct c91288a Merge pull request #79 from yunleiz/mergenext d6b90eb [doc] image for document git-subtree-dir: codec git-subtree-split: 15255a29990d2fd5cbdbf24ff74223cb5612419a Co-authored-by: sdausr <sdausr@xilinx.com>
1 parent 3f37aaa commit bdd2301

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

codec/L2/include/hw/jpegDec/XAcc_idct.hpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,15 @@ inline void hls_idct_v(uint32_t hls_mcuc,
260260

261261
for (int j = 0; j < 8; j++) {
262262
#pragma HLS UNROLL
263-
strm_out[j].write(tmp[j] + 128); //+128
263+
idct_out_t cut = 0;
264+
if ((tmp[j] + 128) > 255) {
265+
cut = 255;
266+
} else if ((tmp[j] + 128) < 0) {
267+
cut = 0;
268+
} else {
269+
cut = (tmp[j] + 128);
270+
}
271+
strm_out[j].write(cut); //+128
264272
}
265273
}
266274
}
@@ -702,7 +710,6 @@ void decoder_jpg_full_top(ap_uint<_WAxi>* ptr,
702710

703711
} // namespace details
704712

705-
706713
// ------------------------------------------------------------
707714
/**
708715
* @brief Level 2 : kernel implement for jfif parser + huffman decoder + iQ_iDCT
@@ -726,9 +733,9 @@ void decoder_jpg_full_top(ap_uint<_WAxi>* ptr,
726733
// frequency 250MHz for kernel, for only huffman core 286MHz by vivado 2018.3
727734

728735
inline void kernelJpegDecoderTop(ap_uint<AXI_WIDTH>* jpeg_pointer,
729-
const int size,
730-
ap_uint<64>* yuv_mcu_pointer,
731-
ap_uint<32>* infos) {
736+
const int size,
737+
ap_uint<64>* yuv_mcu_pointer,
738+
ap_uint<32>* infos) {
732739
// clang-format off
733740

734741
//for jfif parser
51.8 KB
Loading
14.2 KB
Loading

0 commit comments

Comments
 (0)