@@ -72,7 +72,7 @@ void fifo_copy_hdr(xf::cv::Mat<SRC_T, ROWS * 2, COLS + NUM_H_BLANK, NPC, XFCVDEP
72
72
template <int SRC_T, int DST_T, int ROWS, int COLS, int NPC = 1 , int XFCVDEPTH_imgInput, int XFCVDEPTH_hdr_out>
73
73
void function_extract_merge (xf::cv::Mat<SRC_T, ROWS * 2 , COLS + NUM_H_BLANK, NPC, XFCVDEPTH_imgInput>& imgInput1,
74
74
xf::cv::Mat<DST_T, ROWS, COLS, NPC, XFCVDEPTH_hdr_out>& hdr_out,
75
- short * wr_hls,
75
+ short wr_hls[NO_EXPS * XF_NPPC * W_B_SIZE] ,
76
76
unsigned short height,
77
77
unsigned short width) {
78
78
// clang-format off
@@ -555,25 +555,25 @@ void ISPpipeline(ap_uint<INPUT_PTR_WIDTH>* img_inp,
555
555
* Description:
556
556
**********************************************************************************/
557
557
extern " C" {
558
- void ISPPipeline_accel (ap_uint<INPUT_PTR_WIDTH>* img_inp, /* Array2xfMat */
559
- ap_uint<OUTPUT_PTR_WIDTH>* img_out, /* xfMat2Array */
560
- ap_uint<OUTPUT_PTR_WIDTH>* img_out_ir, /* xfMat2Array */
561
- int height, /* HDR, rgbir2bayer, fifo_copy */
562
- int width, /* HDR, rgbir2bayer, fifo_copy */
563
- short * wr_hls, /* HDR */
564
- uint16_t rgain, /* gaincontrol */
565
- uint16_t bgain, /* gaincontrol */
566
- char R_IR_C1_wgts[25 ], /* rgbir2bayer */
567
- char R_IR_C2_wgts[25 ], /* rgbir2bayer */
568
- char B_at_R_wgts[25 ], /* rgbir2bayer */
569
- char IR_at_R_wgts[9 ], /* rgbir2bayer */
570
- char IR_at_B_wgts[9 ], /* rgbir2bayer */
571
- char sub_wgts[4 ], /* rgbir2bayer */
572
- int blk_height, /* LTM */
573
- int blk_width, /* LTM */
574
- float c1, /* gtm */
575
- float c2, /* gtm */
576
- unsigned char gamma_lut[256 * 3 ], /* gammacorrection */
558
+ void ISPPipeline_accel (ap_uint<INPUT_PTR_WIDTH>* img_inp, /* Array2xfMat */
559
+ ap_uint<OUTPUT_PTR_WIDTH>* img_out, /* xfMat2Array */
560
+ ap_uint<OUTPUT_PTR_WIDTH>* img_out_ir, /* xfMat2Array */
561
+ int height, /* HDR, rgbir2bayer, fifo_copy */
562
+ int width, /* HDR, rgbir2bayer, fifo_copy */
563
+ short wr_hls[NO_EXPS * XF_NPPC * W_B_SIZE], /* HDR */
564
+ uint16_t rgain, /* gaincontrol */
565
+ uint16_t bgain, /* gaincontrol */
566
+ char R_IR_C1_wgts[25 ], /* rgbir2bayer */
567
+ char R_IR_C2_wgts[25 ], /* rgbir2bayer */
568
+ char B_at_R_wgts[25 ], /* rgbir2bayer */
569
+ char IR_at_R_wgts[9 ], /* rgbir2bayer */
570
+ char IR_at_B_wgts[9 ], /* rgbir2bayer */
571
+ char sub_wgts[4 ], /* rgbir2bayer */
572
+ int blk_height, /* LTM */
573
+ int blk_width, /* LTM */
574
+ float c1, /* gtm */
575
+ float c2, /* gtm */
576
+ unsigned char gamma_lut[256 * 3 ], /* gammacorrection */
577
577
unsigned short mode_reg,
578
578
ap_uint<INPUT_PTR_WIDTH>* lut, /* lut3d */
579
579
int lutDim, /* lut3d */
@@ -602,18 +602,37 @@ void ISPPipeline_accel(ap_uint<INPUT_PTR_WIDTH>* img_inp, /* Array2xfMat */
602
602
#pragma HLS ARRAY_PARTITION variable=omax dim=1 complete
603
603
#pragma HLS ARRAY_PARTITION variable=omax dim=2 cyclic factor=2
604
604
#pragma HLS ARRAY_PARTITION variable=omax dim=3 cyclic factor=2
605
-
606
605
// clang-format on
607
606
607
+ static short wr_hls_tmp[NO_EXPS * XF_NPPC * W_B_SIZE];
608
+
609
+ WR_HLS_INIT_LOOP:
610
+ for (int k = 0 ; k < XF_NPPC; k++) {
611
+ // clang-format off
612
+ #pragma HLS LOOP_TRIPCOUNT min=XF_NPPC max=XF_NPPC
613
+ // clang-format on
614
+ for (int i = 0 ; i < NO_EXPS; i++) {
615
+ // clang-format off
616
+ #pragma HLS LOOP_TRIPCOUNT min=NO_EXPS max=NO_EXPS
617
+ // clang-format on
618
+ for (int j = 0 ; j < (W_B_SIZE); j++) {
619
+ // clang-format off
620
+ #pragma HLS LOOP_TRIPCOUNT min=W_B_SIZE max=W_B_SIZE
621
+ // clang-format on
622
+ wr_hls_tmp[(i + k * NO_EXPS) * W_B_SIZE + j] = wr_hls[(i + k * NO_EXPS) * W_B_SIZE + j];
623
+ }
624
+ }
625
+ }
626
+
608
627
if (!flag) {
609
- ISPpipeline (img_inp, img_out, img_out_ir, mode_reg, height, width, wr_hls , R_IR_C1_wgts, R_IR_C2_wgts,
628
+ ISPpipeline (img_inp, img_out, img_out_ir, mode_reg, height, width, wr_hls_tmp , R_IR_C1_wgts, R_IR_C2_wgts,
610
629
B_at_R_wgts, IR_at_R_wgts, IR_at_B_wgts, sub_wgts, rgain, bgain, hist0_awb, hist1_awb, igain_0,
611
630
igain_1, pawb, gamma_lut, omin[0 ], omax[0 ], omin[1 ], omax[1 ], blk_height, blk_width, mean2, mean1,
612
631
L_max2, L_max1, L_min2, L_min1, c1, c2, lut, lutDim);
613
632
flag = 1 ;
614
633
615
634
} else {
616
- ISPpipeline (img_inp, img_out, img_out_ir, mode_reg, height, width, wr_hls , R_IR_C1_wgts, R_IR_C2_wgts,
635
+ ISPpipeline (img_inp, img_out, img_out_ir, mode_reg, height, width, wr_hls_tmp , R_IR_C1_wgts, R_IR_C2_wgts,
617
636
B_at_R_wgts, IR_at_R_wgts, IR_at_B_wgts, sub_wgts, rgain, bgain, hist1_awb, hist0_awb, igain_1,
618
637
igain_0, pawb, gamma_lut, omin[1 ], omax[1 ], omin[0 ], omax[0 ], blk_height, blk_width, mean1, mean2,
619
638
L_max1, L_max2, L_min1, L_min2, c1, c2, lut, lutDim);
0 commit comments