From 24bd894ea4cff570dbb74cd45f186aef15471526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=8B=A0=EC=84=9D?= Date: Sat, 18 Feb 2023 21:10:42 +0900 Subject: [PATCH 1/2] fix cpu box filter typo --- Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_cpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_cpu.cpp b/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_cpu.cpp index 765cc849..0d9c3d9b 100644 --- a/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_cpu.cpp +++ b/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_cpu.cpp @@ -74,7 +74,7 @@ void hboxfilter_y(float *id, float *od, int w, int h, int r) { for (int x = 0; x < w; x++) { float t; - // do left edge + // do top edge t = id[x] * r; for (int y = 0; y < r + 1; y++) { @@ -98,7 +98,7 @@ void hboxfilter_y(float *id, float *od, int w, int h, int r) { od[c] = t * scale; } - // do right edge + // do bottom edge for (int y = h - r; y < h; y++) { int c = y * w + x; t += id[(h - 1) * w + x]; From daaab7dd748980cd7454a1d613876473c15f9488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=8B=A0=EC=84=9D?= Date: Sat, 18 Feb 2023 22:52:26 +0900 Subject: [PATCH 2/2] fix cuda box filter typo --- .../boxFilter/boxFilter_kernel.cu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_kernel.cu b/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_kernel.cu index 1f57bef6..f1237316 100644 --- a/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_kernel.cu +++ b/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_kernel.cu @@ -129,7 +129,7 @@ __device__ void d_boxfilter_y(float *id, float *od, int w, int h, int r) { float scale = 1.0f / (float)((r << 1) + 1); float t; - // do left edge + // do top edge t = id[0] * r; for (int y = 0; y < (r + 1); y++) { @@ -151,7 +151,7 @@ __device__ void d_boxfilter_y(float *id, float *od, int w, int h, int r) { od[y * w] = t * scale; } - // do right edge + // do bottom edge for (int y = h - r; y < h; y++) { t += id[(h - 1) * w]; t -= id[((y - r) * w) - w]; @@ -271,7 +271,7 @@ __global__ void d_boxfilter_rgba_y(unsigned int *id, unsigned int *od, int w, float scale = 1.0f / (float)((r << 1) + 1); float4 t; - // do left edge + // do top edge t = rgbaIntToFloat(id[0]) * r; for (int y = 0; y < (r + 1); y++) { @@ -293,7 +293,7 @@ __global__ void d_boxfilter_rgba_y(unsigned int *id, unsigned int *od, int w, od[y * w] = rgbaFloatToInt(t * scale); } - // do right edge + // do bottom edge for (int y = h - r; y < h; y++) { t += rgbaIntToFloat(id[(h - 1) * w]); t -= rgbaIntToFloat(id[((y - r) * w) - w]);