template.c: extract/optimize BIT_DEPTH / 8
This commit is contained in:
parent
c593b3e3b4
commit
19b2edfc4b
@ -142,6 +142,10 @@ main(void)
|
||||
bit_depth_limiter = BIT_DEPTH_LIMITER
|
||||
#if FP_RETURN_TYPE
|
||||
+ 1
|
||||
#endif
|
||||
#if BIT_DEPTH < 8
|
||||
,
|
||||
bit_depth_stretch = ((long double) BIT_DEPTH) / 8.L
|
||||
#endif
|
||||
;
|
||||
|
||||
@ -164,7 +168,7 @@ main(void)
|
||||
// 4. if bit depth is less than 8, stretch it
|
||||
#if BIT_DEPTH < 8
|
||||
sample_res = (SAMPLE_TYPE)
|
||||
((long double) sample_res * ((long double) BIT_DEPTH / 8.L));
|
||||
((long double) sample_res * bit_depth_stretch);
|
||||
#endif
|
||||
|
||||
// 5. save sample into buffer
|
||||
|
Loading…
Reference in New Issue
Block a user