Merge daaab7dd748980cd7454a1d613876473c15f9488 into 3e8f91d1a116060d3fedfe856f3721db970de030

This commit is contained in:
Sinseok 2025-03-04 08:42:41 +08:00 committed by GitHub
commit 6668105f27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -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];

View File

@ -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]);