Merge pull request #517 from negativeExponent/input
[pcsx_rearmed.git] / deps / libchdr / include / libchdr / flac.h
CommitLineData
9c659ffe 1/* license:BSD-3-Clause
2 * copyright-holders:Aaron Giles
3 ***************************************************************************
4
5 flac.h
6
7 FLAC compression wrappers
8
9***************************************************************************/
10
11#pragma once
12
13#ifndef __FLAC_H__
14#define __FLAC_H__
15
16#include <stdint.h>
9c659ffe 17
18/***************************************************************************
19 * TYPE DEFINITIONS
20 ***************************************************************************
21 */
22
23typedef struct _flac_decoder flac_decoder;
24struct _flac_decoder {
25 /* output state */
2ff0b512 26 void * decoder; /* actual encoder */
9c659ffe 27 uint32_t sample_rate; /* decoded sample rate */
28 uint8_t channels; /* decoded number of channels */
29 uint8_t bits_per_sample; /* decoded bits per sample */
30 uint32_t compressed_offset; /* current offset in compressed data */
2ff0b512 31 const uint8_t * compressed_start; /* start of compressed data */
9c659ffe 32 uint32_t compressed_length; /* length of compressed data */
2ff0b512 33 const uint8_t * compressed2_start; /* start of compressed data */
9c659ffe 34 uint32_t compressed2_length; /* length of compressed data */
35 int16_t * uncompressed_start[8]; /* pointer to start of uncompressed data (up to 8 streams) */
36 uint32_t uncompressed_offset; /* current position in uncompressed data */
37 uint32_t uncompressed_length; /* length of uncompressed data */
38 int uncompressed_swap; /* swap uncompressed sample data */
39 uint8_t custom_header[0x2a]; /* custom header */
40};
41
42/* ======================> flac_decoder */
43
2ff0b512 44int flac_decoder_init(flac_decoder* decoder);
9c659ffe 45void flac_decoder_free(flac_decoder* decoder);
46int flac_decoder_reset(flac_decoder* decoder, uint32_t sample_rate, uint8_t num_channels, uint32_t block_size, const void *buffer, uint32_t length);
47int flac_decoder_decode_interleaved(flac_decoder* decoder, int16_t *samples, uint32_t num_samples, int swap_endian);
48uint32_t flac_decoder_finish(flac_decoder* decoder);
49
50#endif /* __FLAC_H__ */