replace DIV255 with an inline function, the macro version caused unneeded recalculations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19809 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
580d91f097
commit
5d3fd5d5ce
1 changed files with 6 additions and 2 deletions
|
@ -397,8 +397,12 @@ static inline PFreal fcos(int iangle)
|
|||
return fsin(iangle + (IANGLE_MAX >> 2));
|
||||
}
|
||||
|
||||
#define DIV255(val) ((((((val)>>8)+(val))>>8)+(val))>>8)
|
||||
#define SCALE_VAL(val,out) DIV255((val) * (out) + 127)
|
||||
static inline uint32_t div255(uint32_t val)
|
||||
{
|
||||
return ((((val >> 8) + val) >> 8) + val) >> 8;
|
||||
}
|
||||
|
||||
#define SCALE_VAL(val,out) div255((val) * (out) + 127)
|
||||
|
||||
static void output_row_transposed(uint32_t row, void * row_in,
|
||||
struct scaler_context *ctx)
|
||||
|
|
Loading…
Reference in a new issue