[gnome-photos/gnome-3-24] operation-insta-hefe-curve: Use single precision floating point
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/gnome-3-24] operation-insta-hefe-curve: Use single precision floating point
- Date: Mon, 11 Dec 2017 17:34:20 +0000 (UTC)
commit 8fc4de81df5fb0aaf0fcc8d11d8a616084493c10
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Dec 11 00:27:54 2017 +0100
operation-insta-hefe-curve: Use single precision floating point
Single precision floating point is all that's needed. It is wasteful to
promote calculations to double precision through the use of such
literals. This can have significant performance impact on architectures
like ARM.
src/photos-operation-insta-hefe-curve.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-operation-insta-hefe-curve.c b/src/photos-operation-insta-hefe-curve.c
index b15a038..3ed7a3f 100644
--- a/src/photos-operation-insta-hefe-curve.c
+++ b/src/photos-operation-insta-hefe-curve.c
@@ -77,9 +77,9 @@ photos_operation_insta_hefe_curve_process (GeglOperation *operation,
const float r2 = r * r;
const float r3 = r2 * r;
- out[0] = -13.47f * r3 * r3 + 41.23f * r3 * r2 - 45.04f * r2 * r2 + 19.17 * r3 - 1.492f * r2 + 0.5954f
* r;
- out[1] = -12.28f * g3 * g3 + 41.09f * g3 * g2 - 50.52f * g2 * g2 + 26.03 * g3 - 3.916f * g2 + 0.58f *
g;
- out[2] = -1.066f * b3 * b3 + 9.679f * b3 * b2 - 19.09f * b2 * b2 + 12.92 * b3 - 1.835f * b2 + 0.3487f
* b;
+ out[0] = -13.47f * r3 * r3 + 41.23f * r3 * r2 - 45.04f * r2 * r2 + 19.17f * r3 - 1.492f * r2 + 0.5954f
* r;
+ out[1] = -12.28f * g3 * g3 + 41.09f * g3 * g2 - 50.52f * g2 * g2 + 26.03f * g3 - 3.916f * g2 + 0.58f *
g;
+ out[2] = -1.066f * b3 * b3 + 9.679f * b3 * b2 - 19.09f * b2 * b2 + 12.92f * b3 - 1.835f * b2 + 0.3487f
* b;
out[3] = in[3];
in += 4;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]