Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
resize_bgr2yuyv_diff
作成日
4 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
26 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
100 行
すべてコピー
20 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
94 行
すべてコピー
#include "hls_stream.h"
#include "hls_stream.h"
コピー
コピー済み
コピー
コピー済み
#include "ap_int.h"
#include "common/xf_common.hpp"
#include "common/xf_common.hpp"
コピー
コピー済み
コピー
コピー済み
#include "common/xf_
infra
.hpp"
#include "common/xf_
utility.hpp"
#include "imgproc/xf_
resize
.hpp"
#include "imgproc/xf_cvt_color
.hpp"
#include "imgproc/xf_
cvt_color_1
.hpp"
#define DATA_WIDTH 24
#define DATA_WIDTH 24
コピー
コピー済み
コピー
コピー済み
#define WIDTH 1920
#define HEIGHT 1080
#define NPIX XF_NPPC1
#define NPIX XF_NPPC1
コピー
コピー済み
コピー
コピー済み
#define
WIDTH 3840
#define
IN_
TYPE
XF_8UC3
#define HEIGHT 2160
#define
OUT_TYPE
XF_
16UC1
#define FILTER_SIZE 3
#define
TYPE
XF_8UC3
#define
INTERPOLATION
XF_
INTERPOLATION_BILINEAR
#define MAXDOWNSCALE 9
typedef xf::cv::ap_axiu<DATA_WIDTH,1,1,1> interface_t;
typedef xf::cv::ap_axiu<DATA_WIDTH,1,1,1> interface_t;
typedef hls::stream<interface_t> stream_t;
typedef hls::stream<interface_t> stream_t;
template <int W, int TYPE, int ROWS, int COLS, int NPPC>
template <int W, int TYPE, int ROWS, int COLS, int NPPC>
void axis2xfMat (hls::stream<ap_axiu<W, 1, 1, 1> >& AXI_video_strm, xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img) {
void axis2xfMat (hls::stream<ap_axiu<W, 1, 1, 1> >& AXI_video_strm, xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img) {
ap_axiu<W, 1, 1, 1> axi;
ap_axiu<W, 1, 1, 1> axi;
const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC);
const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC);
int rows = img.rows;
int rows = img.rows;
int cols = img.cols >> XF_BITSHIFT(NPPC);
int cols = img.cols >> XF_BITSHIFT(NPPC);
assert(img.rows <= ROWS);
assert(img.rows <= ROWS);
assert(img.cols <= COLS);
assert(img.cols <= COLS);
loop_row_axi2mat:
loop_row_axi2mat:
for (int i = 0; i < rows; i++) {
for (int i = 0; i < rows; i++) {
loop_col_zxi2mat:
loop_col_zxi2mat:
for (int j = 0; j < cols; j++) {
for (int j = 0; j < cols; j++) {
#pragma HLS loop_flatten off
#pragma HLS loop_flatten off
#pragma HLS pipeline II=1
#pragma HLS pipeline II=1
AXI_video_strm.read(axi);
AXI_video_strm.read(axi);
img.write(i*rows + j, axi.data(m_pix_width - 1, 0));
img.write(i*rows + j, axi.data(m_pix_width - 1, 0));
}
}
}
}
}
}
template <int W, int TYPE, int ROWS, int COLS, int NPPC>
template <int W, int TYPE, int ROWS, int COLS, int NPPC>
void xfMat2axis(xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img, hls::stream<ap_axiu<W, 1, 1, 1> >& dst) {
void xfMat2axis(xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img, hls::stream<ap_axiu<W, 1, 1, 1> >& dst) {
ap_axiu<W, 1, 1, 1> axi;
ap_axiu<W, 1, 1, 1> axi;
int rows = img.rows;
int rows = img.rows;
int cols = img.cols >> XF_BITSHIFT(NPPC);
int cols = img.cols >> XF_BITSHIFT(NPPC);
assert(img.rows <= ROWS);
assert(img.rows <= ROWS);
assert(img.cols <= COLS);
assert(img.cols <= COLS);
const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC);
const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC);
loop_row_mat2axi:
loop_row_mat2axi:
for (int i = 0; i < rows; i++) {
for (int i = 0; i < rows; i++) {
loop_col_mat2axi:
loop_col_mat2axi:
for (int j = 0; j < cols; j++) {
for (int j = 0; j < cols; j++) {
#pragma HLS loop_flatten off
#pragma HLS loop_flatten off
#pragma HLS pipeline II = 1
#pragma HLS pipeline II = 1
if ((j == cols-1) && (i == rows-1)) {
if ((j == cols-1) && (i == rows-1)) {
axi.last = 1;
axi.last = 1;
} else {
} else {
axi.last = 0;
axi.last = 0;
}
}
axi.data = 0;
axi.data = 0;
axi.data(m_pix_width - 1, 0) = img.read(i*rows + j);
axi.data(m_pix_width - 1, 0) = img.read(i*rows + j);
axi.keep = -1;
axi.keep = -1;
dst.write(axi);
dst.write(axi);
}
}
}
}
}
}
コピー
コピー済み
コピー
コピー済み
void
resize
_accel(stream_t& src, stream_t& dst
,
void
bgr2yuyv
_accel(stream_t& src, stream_t& dst
) {
int src_rows, int src_cols,
int dst_rows, int dst_cols
) {
#pragma HLS INTERFACE axis register both port=src
#pragma HLS INTERFACE axis register both port=src
#pragma HLS INTERFACE axis register both port=dst
#pragma HLS INTERFACE axis register both port=dst
コピー
コピー済み
コピー
コピー済み
#pragma HLS INTERFACE s_axilite port=src_rows
#pragma HLS INTERFACE s_axilite port=src_cols
#pragma HLS INTERFACE s_axilite port=dst_rows
#pragma HLS INTERFACE s_axilite port=dst_cols
#pragma HLS INTERFACE s_axilite port=return
#pragma HLS INTERFACE s_axilite port=return
コピー
コピー済み
コピー
コピー済み
xf::cv::Mat<
TYPE, HEIGHT, WIDTH, NPIX> src_mat(
src_rows, src_cols
);
xf::cv::Mat<
IN_
TYPE, HEIGHT, WIDTH, NPIX> src_mat(
HEIGHT, WIDTH
);
xf::cv::Mat<
TYPE, HEIGHT, WIDTH, NPIX> dst_mat(
dst_rows, dst_cols
);
xf::cv::Mat<
OUT_
TYPE, HEIGHT, WIDTH, NPIX> dst_mat(
HEIGHT, WIDTH
);
#pragma HLS DATAFLOW
#pragma HLS DATAFLOW
コピー
コピー済み
コピー
コピー済み
axis2xfMat<DATA_WIDTH,
TYPE, HEIGHT, WIDTH, NPIX>(src, src_mat);
axis2xfMat<DATA_WIDTH,
IN_
TYPE, HEIGHT, WIDTH, NPIX>(src, src_mat);
xf::cv::
resize<INTERPOLATION,
TYPE, HEIGHT, WIDTH,
HEIGHT, WIDTH,
NPIX
, MAXDOWNSCALE
>(src_mat, dst_mat);
xf::cv::
bgr2yuyv<IN_TYPE, OUT_
TYPE, HEIGHT, WIDTH,
NPIX
>(src_mat, dst_mat);
xfMat2axis<DATA_WIDTH,
TYPE, HEIGHT, WIDTH, NPIX>(dst_mat, dst);
xfMat2axis<DATA_WIDTH,
OUT_
TYPE, HEIGHT, WIDTH, NPIX>(dst_mat, dst);
}
}
保存された差分
原文
ファイルを開く
#include "hls_stream.h" #include "common/xf_common.hpp" #include "common/xf_infra.hpp" #include "imgproc/xf_resize.hpp" #define DATA_WIDTH 24 #define NPIX XF_NPPC1 #define WIDTH 3840 #define HEIGHT 2160 #define FILTER_SIZE 3 #define TYPE XF_8UC3 #define INTERPOLATION XF_INTERPOLATION_BILINEAR #define MAXDOWNSCALE 9 typedef xf::cv::ap_axiu<DATA_WIDTH,1,1,1> interface_t; typedef hls::stream<interface_t> stream_t; template <int W, int TYPE, int ROWS, int COLS, int NPPC> void axis2xfMat (hls::stream<ap_axiu<W, 1, 1, 1> >& AXI_video_strm, xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img) { ap_axiu<W, 1, 1, 1> axi; const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC); int rows = img.rows; int cols = img.cols >> XF_BITSHIFT(NPPC); assert(img.rows <= ROWS); assert(img.cols <= COLS); loop_row_axi2mat: for (int i = 0; i < rows; i++) { loop_col_zxi2mat: for (int j = 0; j < cols; j++) { #pragma HLS loop_flatten off #pragma HLS pipeline II=1 AXI_video_strm.read(axi); img.write(i*rows + j, axi.data(m_pix_width - 1, 0)); } } } template <int W, int TYPE, int ROWS, int COLS, int NPPC> void xfMat2axis(xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img, hls::stream<ap_axiu<W, 1, 1, 1> >& dst) { ap_axiu<W, 1, 1, 1> axi; int rows = img.rows; int cols = img.cols >> XF_BITSHIFT(NPPC); assert(img.rows <= ROWS); assert(img.cols <= COLS); const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC); loop_row_mat2axi: for (int i = 0; i < rows; i++) { loop_col_mat2axi: for (int j = 0; j < cols; j++) { #pragma HLS loop_flatten off #pragma HLS pipeline II = 1 if ((j == cols-1) && (i == rows-1)) { axi.last = 1; } else { axi.last = 0; } axi.data = 0; axi.data(m_pix_width - 1, 0) = img.read(i*rows + j); axi.keep = -1; dst.write(axi); } } } void resize_accel(stream_t& src, stream_t& dst, int src_rows, int src_cols, int dst_rows, int dst_cols) { #pragma HLS INTERFACE axis register both port=src #pragma HLS INTERFACE axis register both port=dst #pragma HLS INTERFACE s_axilite port=src_rows #pragma HLS INTERFACE s_axilite port=src_cols #pragma HLS INTERFACE s_axilite port=dst_rows #pragma HLS INTERFACE s_axilite port=dst_cols #pragma HLS INTERFACE s_axilite port=return xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> src_mat(src_rows, src_cols); xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPIX> dst_mat(dst_rows, dst_cols); #pragma HLS DATAFLOW axis2xfMat<DATA_WIDTH, TYPE, HEIGHT, WIDTH, NPIX>(src, src_mat); xf::cv::resize<INTERPOLATION, TYPE, HEIGHT, WIDTH, HEIGHT, WIDTH, NPIX, MAXDOWNSCALE>(src_mat, dst_mat); xfMat2axis<DATA_WIDTH, TYPE, HEIGHT, WIDTH, NPIX>(dst_mat, dst); }
変更されたテキスト
ファイルを開く
#include "hls_stream.h" #include "ap_int.h" #include "common/xf_common.hpp" #include "common/xf_utility.hpp" #include "imgproc/xf_cvt_color.hpp" #include "imgproc/xf_cvt_color_1.hpp" #define DATA_WIDTH 24 #define WIDTH 1920 #define HEIGHT 1080 #define NPIX XF_NPPC1 #define IN_TYPE XF_8UC3 #define OUT_TYPE XF_16UC1 typedef xf::cv::ap_axiu<DATA_WIDTH,1,1,1> interface_t; typedef hls::stream<interface_t> stream_t; template <int W, int TYPE, int ROWS, int COLS, int NPPC> void axis2xfMat (hls::stream<ap_axiu<W, 1, 1, 1> >& AXI_video_strm, xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img) { ap_axiu<W, 1, 1, 1> axi; const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC); int rows = img.rows; int cols = img.cols >> XF_BITSHIFT(NPPC); assert(img.rows <= ROWS); assert(img.cols <= COLS); loop_row_axi2mat: for (int i = 0; i < rows; i++) { loop_col_zxi2mat: for (int j = 0; j < cols; j++) { #pragma HLS loop_flatten off #pragma HLS pipeline II=1 AXI_video_strm.read(axi); img.write(i*rows + j, axi.data(m_pix_width - 1, 0)); } } } template <int W, int TYPE, int ROWS, int COLS, int NPPC> void xfMat2axis(xf::cv::Mat<TYPE, ROWS, COLS, NPPC>& img, hls::stream<ap_axiu<W, 1, 1, 1> >& dst) { ap_axiu<W, 1, 1, 1> axi; int rows = img.rows; int cols = img.cols >> XF_BITSHIFT(NPPC); assert(img.rows <= ROWS); assert(img.cols <= COLS); const int m_pix_width = XF_PIXELWIDTH(TYPE, NPPC) * XF_NPIXPERCYCLE(NPPC); loop_row_mat2axi: for (int i = 0; i < rows; i++) { loop_col_mat2axi: for (int j = 0; j < cols; j++) { #pragma HLS loop_flatten off #pragma HLS pipeline II = 1 if ((j == cols-1) && (i == rows-1)) { axi.last = 1; } else { axi.last = 0; } axi.data = 0; axi.data(m_pix_width - 1, 0) = img.read(i*rows + j); axi.keep = -1; dst.write(axi); } } } void bgr2yuyv_accel(stream_t& src, stream_t& dst) { #pragma HLS INTERFACE axis register both port=src #pragma HLS INTERFACE axis register both port=dst #pragma HLS INTERFACE s_axilite port=return xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPIX> src_mat(HEIGHT, WIDTH); xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPIX> dst_mat(HEIGHT, WIDTH); #pragma HLS DATAFLOW axis2xfMat<DATA_WIDTH, IN_TYPE, HEIGHT, WIDTH, NPIX>(src, src_mat); xf::cv::bgr2yuyv<IN_TYPE, OUT_TYPE, HEIGHT, WIDTH, NPIX>(src_mat, dst_mat); xfMat2axis<DATA_WIDTH, OUT_TYPE, HEIGHT, WIDTH, NPIX>(dst_mat, dst); }
違いを見つける