1
0

template.c: extract/optimize BIT_DEPTH / 8

This commit is contained in:
Intel A80486DX2-66 2024-01-09 18:37:32 +03:00
parent c593b3e3b4
commit 19b2edfc4b
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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