Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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];
Expand Down Expand Up @@ -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++) {
Expand All @@ -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]);
Expand Down