From 9d14082fe5176ec91d006d89ccdb2d62f6ca839f Mon Sep 17 00:00:00 2001 From: Dominic Symes Date: Mon, 15 Apr 2024 15:04:13 +0100 Subject: RFFT2D: Correct pseudo-code when size is one When width or height are one then H/2 or W/2 are not integral. This case is clarified. Signed-off-by: Dominic Symes Change-Id: Iae1346f09b9eecc636d37d40071bdfbce923843b --- pseudocode/operators/RFFT2D.tosac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pseudocode/operators/RFFT2D.tosac b/pseudocode/operators/RFFT2D.tosac index c4dfab2..98a0fd1 100644 --- a/pseudocode/operators/RFFT2D.tosac +++ b/pseudocode/operators/RFFT2D.tosac @@ -19,7 +19,7 @@ for_each(0 <= n < N, 0 <= oy < H, 0 <= ox < W/2 + 1) { int32_t ax = (static_cast(ix) * static_cast(ox)) % static_cast(W); in_out_t a = sign_val * 2 * pi() * (static_cast(ay) / H + static_cast(ax) / W); sum_real += val_real * cos(a); - if ((ay % (H/2)) + (ax % (W/2)) > 0) { + if ((H > 1 && (ay % (H/2)) > 0) || (W > 1 && (ax % (W/2)) > 0)) { sum_imag += -val_real * sin(a); } } -- cgit v1.2.1