2 * Direct Stream Digital (DSD) decoder
3 * based on BSD licensed dsd2pcm by Sebastian Gesemann
4 * Copyright (c) 2009, 2011 Sebastian Gesemann. All rights reserved.
5 * Copyright (c) 2014 Peter Ross
7 * This file is part of FFmpeg.
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 #include "libavcodec/internal.h"
28 #include "libavcodec/mathops.h"
31 #define HTAPS 48 /** number of FIR constants */
32 #define FIFOSIZE 16 /** must be a power of two */
33 #define FIFOMASK (FIFOSIZE - 1) /** bit mask for FIFO offsets */
35 #if FIFOSIZE * 8 < HTAPS * 2
36 #error "FIFOSIZE too small"
42 typedef struct DSDContext {
43 unsigned char buf[FIFOSIZE];
47 void ff_init_dsd_data(void);
49 void ff_dsd2pcm_translate(DSDContext* s, size_t samples, int lsbf,
50 const unsigned char *src, ptrdiff_t src_stride,
51 float *dst, ptrdiff_t dst_stride);
52 #endif /* AVCODEC_DSD_H */