MPD: pcm/dsd2pcm/dsd2pcm.h File Reference

MPD 0.20.15

Typedefs | Functions
dsd2pcm.h File Reference
`#include <stddef.h>`
`#include <string.h>`
Include dependency graph for dsd2pcm.h:

Go to the source code of this file.

## Typedefs
typedef struct dsd2pcm_ctx_s | dsd2pcm_ctx

## Functions
dsd2pcm_ctx * | dsd2pcm_init (void)
| initializes a "dsd2pcm engine" for one channel (precomputes tables and allocates memory) More...
void | dsd2pcm_destroy (dsd2pcm_ctx *ctx)
| deinitializes a "dsd2pcm engine" (releases memory, don't forget!) More...
dsd2pcm_ctx * | dsd2pcm_clone (dsd2pcm_ctx *ctx)
| clones the context and returns a pointer to the newly allocated copy More...
void | dsd2pcm_reset (dsd2pcm_ctx *ctx)
| resets the internal state for a fresh new stream More...
void | dsd2pcm_translate (dsd2pcm_ctx *ctx, size_t samples, const unsigned char *src, ptrdiff_t src_stride, int lsbitfirst, float *dst, ptrdiff_t dst_stride)
| "translates" a stream of octets to a stream of floats (8:1 decimation) More...

## Typedef Documentation

## ◆ dsd2pcm_ctx

typedef struct dsd2pcm_ctx_s dsd2pcm_ctx

Definition at line 43 of file dsd2pcm.h.

## Function Documentation

## ◆ dsd2pcm_clone()

dsd2pcm_ctx* dsd2pcm_clone | ( | dsd2pcm_ctx * | ctx | ) |

clones the context and returns a pointer to the newly allocated copy

## ◆ dsd2pcm_destroy()

void dsd2pcm_destroy | ( | dsd2pcm_ctx * | ctx | ) |

deinitializes a "dsd2pcm engine" (releases memory, don't forget!)

## ◆ dsd2pcm_init()

dsd2pcm_ctx* dsd2pcm_init | ( | void |  | ) |

initializes a "dsd2pcm engine" for one channel (precomputes tables and allocates memory)

This is the only function that is not thread-safe in terms of the POSIX thread-safety definition because it modifies global state (lookup tables are computed during the first call)

## ◆ dsd2pcm_reset()

void dsd2pcm_reset | ( | dsd2pcm_ctx * | ctx | ) |

resets the internal state for a fresh new stream

## ◆ dsd2pcm_translate()

void dsd2pcm_translate | ( | dsd2pcm_ctx * | ctx,
|  | size_t | samples,
|  | const unsigned char * | src,
|  | ptrdiff_t | src_stride,
|  | int | lsbitfirst,
|  | float * | dst,
|  | ptrdiff_t | dst_stride
| ) |  |

"translates" a stream of octets to a stream of floats (8:1 decimation)

Parameters

  ctx | – pointer to abstract context (buffers)
  samples | – number of octets/samples to "translate"
  src | – pointer to first octet (input)
  src_stride | – src pointer increment
  lsbitfirst | – bitorder, 0=msb first, 1=lsbfirst
  dst | – pointer to first float (output)
  dst_stride | – dst pointer increment