From 330a68f8a347b51e588fcc2935ba50207d0b730f Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sun, 3 Jul 2016 21:23:02 +0900 Subject: [PATCH] =?UTF-8?q?Y=E3=83=A2=E3=83=87=E3=83=AB=E3=81=A7=E5=BC=B7?= =?UTF-8?q?=E5=88=B6=E7=B5=82=E4=BA=86=E3=81=99=E3=82=8B=E3=83=90=E3=82=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/cNet.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/common/cNet.cpp b/common/cNet.cpp index 88718a6..b6e5c0a 100644 --- a/common/cNet.cpp +++ b/common/cNet.cpp @@ -738,27 +738,19 @@ Waifu2x::eWaifu2xError cNet::ReconstructImage(const bool UseTTA, const int crop_ const float *fptr = outputBlockBuf + (output_block_plane_size * n); + const auto Line = outim.step1(); + // 結果を出力画像にコピー if (outim.channels() == 1) { for (int i = 0; i < output_crop_block_height; i++) - memcpy(imptr + (h + i) * InputLine + w, fptr + (i + output_crop_h) * output_block_width + output_crop_w, output_crop_block_width * sizeof(float)); + memcpy(imptr + (h + i) * Line + w, fptr + (i + output_crop_h) * output_block_width + output_crop_w, output_crop_block_width * sizeof(float)); } else { - const auto LinePixel = outim.step1() / outim.channels(); + const auto LinePixel = Line / outim.channels(); const auto Channel = outim.channels(); - //for (int i = 0; i < output_no_padding_block_height; i++) - //{ - // for (int j = 0; j < output_no_padding_block_width; j++) - // { - // for (int ch = 0; ch < Channel; ch++) - // imptr[((h + i) * LinePixel + (w + j)) * Channel + ch] - // = fptr[(ch * output_block_height + i + output_crop_h) * output_block_width + j + output_padding]; - // } - //} - for (int i = 0; i < output_crop_block_height; i++) { for (int j = 0; j < output_crop_block_width; j++)