diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-04-08 06:25:06 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-04-08 06:25:06 +0000 |
commit | 1541c313a08b1674a8a0603146697bee21429839 (patch) | |
tree | beea89f0215cbf6a969f5e6a715f96500e606cab /apps/recorder/resize.c | |
parent | 05875e4ce11a807da508eb9e07c0316bcd17846a (diff) |
Improve scaler reciprocal precision by 1 bit, and remove unused SC_NUM, SC_FIX, and SC_SHIFT.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20654 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/resize.c')
-rw-r--r-- | apps/recorder/resize.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c index e75638140b..79be59804a 100644 --- a/apps/recorder/resize.c +++ b/apps/recorder/resize.c @@ -253,7 +253,7 @@ static inline bool scale_v_area(struct rowset *rset, struct scaler_context *ctx) /* Set up rounding and scale factors */ ctx->divisor *= ctx->src->height; ctx->round = ctx->divisor >> 1; - ctx->divisor = (((ctx->divisor >> 1) + SC_NUM) / ctx->divisor) << SC_FIX; + ctx->divisor = 1 + (-((ctx->divisor + 1) >> 1)) / ctx->divisor; mul = 0; oy = rset->rowstart; oye = 0; @@ -451,7 +451,7 @@ static inline bool scale_v_linear(struct rowset *rset, /* Set up scale and rounding factors, the divisor is bm->height - 1 */ ctx->divisor *= (ctx->bm->height - 1); ctx->round = ctx->divisor >> 1; - ctx->divisor = (((ctx->divisor >> 1) + SC_NUM) / ctx->divisor) << SC_FIX; + ctx->divisor = 1 + (-((ctx->divisor + 1) >> 1)) / ctx->divisor; /* Set up our two temp buffers. The names are generic because they'll be swapped each time a new input row is read */ |