summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/lib/gray_core.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/apps/plugins/lib/gray_core.c b/apps/plugins/lib/gray_core.c
index 5f565218ff..a9a3e7698f 100644
--- a/apps/plugins/lib/gray_core.c
+++ b/apps/plugins/lib/gray_core.c
@@ -200,25 +200,11 @@ static int exp_s16p16(int x)
200 int t; 200 int t;
201 int y = 0x00010000; 201 int y = 0x00010000;
202 202
203 if (x == 0) 203 if (x < 0) x += 0xb1721, y >>= 16;
204 { 204 t = x - 0x58b91; if (t >= 0) x = t, y <<= 8;
205 return y; 205 t = x - 0x2c5c8; if (t >= 0) x = t, y <<= 4;
206 } 206 t = x - 0x162e4; if (t >= 0) x = t, y <<= 2;
207 else if (x > 0) 207 t = x - 0x0b172; if (t >= 0) x = t, y <<= 1;
208 {
209 t = x - 0x58b91; if (t >= 0) x = t, y <<= 8;
210 t = x - 0x2c5c8; if (t >= 0) x = t, y <<= 4;
211 t = x - 0x162e4; if (t >= 0) x = t, y <<= 2;
212 t = x - 0x0b172; if (t >= 0) x = t, y <<= 1;
213 }
214 else
215 {
216 t = x + 0x58b91; if (t < 0) x = t, y >>= 8;
217 t = x + 0x2c5c8; if (t < 0) x = t, y >>= 4;
218 t = x + 0x162e4; if (t < 0) x = t, y >>= 2;
219 t = x + 0x0b172; if (t < 0) x = t, y >>= 1;
220 x += 0x0b172; y >>= 1;
221 }
222 t = x - 0x067cd; if (t >= 0) x = t, y += y >> 1; 208 t = x - 0x067cd; if (t >= 0) x = t, y += y >> 1;
223 t = x - 0x03920; if (t >= 0) x = t, y += y >> 2; 209 t = x - 0x03920; if (t >= 0) x = t, y += y >> 2;
224 t = x - 0x01e27; if (t >= 0) x = t, y += y >> 3; 210 t = x - 0x01e27; if (t >= 0) x = t, y += y >> 3;