commit 4c45085fcbd988b9d4abe19dee7e8f22997e099d
parent eb3477e5fb5d0feb4a56d8147a7ec3b0a94ea12e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 2 Mar 2023 15:45:19 +0100
Fix Kmin computation of the voxel
Previously the Kmin of the voxel was computed form the sum of the Kmin
of each component that overlaps the voxel. This is wrong and must be the
min of each these components.
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/rnatm_voxel.h b/src/rnatm_voxel.h
@@ -65,11 +65,16 @@ voxel_accum(float* dst, const float* src)
{
#define ACCUM(K, Op) \
dst[voxel_idata((K), (Op))] += src[voxel_idata((K), (Op))]
- ACCUM(RNATM_RADCOEF_Ka, RNATM_SVX_OP_MIN);
ACCUM(RNATM_RADCOEF_Ka, RNATM_SVX_OP_MAX);
- ACCUM(RNATM_RADCOEF_Ks, RNATM_SVX_OP_MIN);
ACCUM(RNATM_RADCOEF_Ks, RNATM_SVX_OP_MAX);
#undef ACCUM
+
+ #define ACCUM(K, Op) \
+ dst[voxel_idata((K), (Op))] = MMIN \
+ (src[voxel_idata((K), (Op))], dst[voxel_idata((K), (Op))])
+ ACCUM(RNATM_RADCOEF_Ka, RNATM_SVX_OP_MIN);
+ ACCUM(RNATM_RADCOEF_Ks, RNATM_SVX_OP_MIN);
+ #undef ACCUM
}
#endif /* RNATM_VOXEL_H */