MPD
Functions
pcm_pack.h File Reference

Library for working with packed 24 bit samples. More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Functions

void pcm_pack_24 (uint8_t *dest, const int32_t *src, unsigned num_samples, bool reverse_endian)
 Converts padded 24 bit samples (4 bytes per sample) to packed 24 bit samples (3 bytes per sample).
 
void pcm_unpack_24 (int32_t *dest, const uint8_t *src, unsigned num_samples, bool reverse_endian)
 Converts packed 24 bit samples (3 bytes per sample) to padded 24 bit samples (4 bytes per sample).
 

Detailed Description

Library for working with packed 24 bit samples.

Definition in file pcm_pack.h.

Function Documentation

void pcm_pack_24 ( uint8_t *  dest,
const int32_t *  src,
unsigned  num_samples,
bool  reverse_endian 
)

Converts padded 24 bit samples (4 bytes per sample) to packed 24 bit samples (3 bytes per sample).

This function can be used to convert a buffer in-place.

Parameters
destthe destination buffer (array of triples)
srcthe source buffer
num_samplesthe number of samples to convert
reverse_endianis src and dest in non-host byte order?
void pcm_unpack_24 ( int32_t *  dest,
const uint8_t *  src,
unsigned  num_samples,
bool  reverse_endian 
)

Converts packed 24 bit samples (3 bytes per sample) to padded 24 bit samples (4 bytes per sample).

Parameters
destthe destination buffer
srcthe source buffer (array of triples)
num_samplesthe number of samples to convert
reverse_endianis src and dest in non-host byte order?