MPD

- Main Page
- Data Structures
- Files

- File List
- Globals

Functions

# src/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:

  dest | the destination buffer (array of triples)
  src | the source buffer
  num_samples | the number of samples to convert
  reverse_endian | is 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:

  dest | the destination buffer
  src | the source buffer (array of triples)
  num_samples | the number of samples to convert
  reverse_endian | is src and dest in non-host byte order?