Page MenuHomeFreeBSD

sound: Remove FEEDEQ_CLAMP()
AbandonedPublic

Authored by christos on Wed, Dec 11, 4:49 PM.
Tags
None
Referenced Files
F106166890: D48033.id.diff
Thu, Dec 26, 11:59 AM
F106138775: D48033.diff
Thu, Dec 26, 1:08 AM
Unknown Object (File)
Sun, Dec 22, 5:14 PM
Unknown Object (File)
Sun, Dec 22, 3:05 AM
Unknown Object (File)
Tue, Dec 17, 4:09 PM
Unknown Object (File)
Fri, Dec 13, 12:32 PM
Subscribers

Details

Summary

There is PCM_CLAMP_S32() already.

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61089
Build 57973: arc lint + arc unit

Event Timeline

Hm, PCM_CLAMP_S32 does something different when the SND_PCM_64 option is not set?

Hm, PCM_CLAMP_S32 does something different when the SND_PCM_64 option is not set?

It does, but I am wondering whether the non-SND_PCM_64 is useful. I am not exactly sure why it does what it does.

Hm, PCM_CLAMP_S32 does something different when the SND_PCM_64 option is not set?

It does, but I am wondering whether the non-SND_PCM_64 is useful. I am not exactly sure why it does what it does.

From sys/conf/NOTES:

# SND_PCM_64                   (Only applicable for i386/32bit arch)
#                              Process 32bit samples through 64bit
#                              integer/arithmetic. Slight increase of dynamic
#                              range at a cost of possible slowdown.

I think the default on 32bit platforms is to process 32bit samples at only 24bit precision, to prevent overflow while using 32bit integers for performance reasons. Option SND_PCM_64 turns on proper 64bit integer processing, which can handle 32bit samples easily. See also PCM_FXSHIFT and the comment you deleted in D47932.

What is really questionable from a readability POV is typedef int64_t intpcm32_t;, IMHO. We have to be extra careful refactoring this stuff.