pcm/Dsd32: fix the byte order
The byte order of DSD_U32 was wrong from the start. The oldest bits must be in the MSB, not in the LSB, according to snd_pcm_format_descriptions in alsa-lib.
This commit is contained in:
@@ -29,8 +29,11 @@
|
||||
static constexpr inline uint32_t
|
||||
Construct32(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
|
||||
{
|
||||
return uint32_t(a) | (uint32_t(b) << 8) |
|
||||
(uint32_t(c) << 16) | (uint32_t(d) << 24);
|
||||
/* "a" is the oldest byte, which must be in the most
|
||||
significant byte */
|
||||
|
||||
return uint32_t(d) | (uint32_t(c) << 8) |
|
||||
(uint32_t(b) << 16) | (uint32_t(a) << 24);
|
||||
}
|
||||
|
||||
static constexpr inline uint32_t
|
||||
|
@@ -28,7 +28,7 @@ template<typename T> struct ConstBuffer;
|
||||
class PcmBuffer;
|
||||
|
||||
/**
|
||||
* Convert DSD_U8 to DSD_U32 (native endian).
|
||||
* Convert DSD_U8 to DSD_U32 (native endian, oldest bits in MSB).
|
||||
*/
|
||||
ConstBuffer<uint32_t>
|
||||
Dsd8To32(PcmBuffer &buffer, unsigned channels, ConstBuffer<uint8_t> src);
|
||||
|
Reference in New Issue
Block a user