You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/10/19 18:28:25 UTC
[2/2] git commit: refs/heads/0.3 - Optimize decoding of similarity
values
Optimize decoding of similarity values
Decoding of similarity values can be optimized in a similar way.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/07df6940
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/07df6940
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/07df6940
Branch: refs/heads/0.3
Commit: 07df6940ed49672f4c71b10321fb3617ac9ccfa0
Parents: 3bbf12d
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Oct 19 18:03:50 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Oct 19 18:25:25 2014 +0200
----------------------------------------------------------------------
core/Lucy/Index/Similarity.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/07df6940/core/Lucy/Index/Similarity.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Similarity.c b/core/Lucy/Index/Similarity.c
index 27794ed..c6a18d4 100644
--- a/core/Lucy/Index/Similarity.c
+++ b/core/Lucy/Index/Similarity.c
@@ -194,9 +194,7 @@ Sim_decode_norm(Similarity *self, uint32_t input) {
result = 0;
}
else {
- const uint32_t mantissa = byte & 7;
- const uint32_t exponent = (byte >> 3) & 31;
- result = ((exponent + (63 - 15)) << 24) | (mantissa << 21);
+ result = (input + EXP_OFFSET) << 21;
}
return *(float*)&result;