Path: blob/a-new-beginning/SharedDependencies/Sources/libchdr/include/flac.h
2 views
/* license:BSD-3-Clause1* copyright-holders:Aaron Giles2***************************************************************************34flac.h56FLAC compression wrappers78***************************************************************************/910#pragma once1112#ifndef __FLAC_H__13#define __FLAC_H__1415#include <stdint.h>16#include <FLAC/all.h>1718/***************************************************************************19* TYPE DEFINITIONS20***************************************************************************21*/2223typedef struct _flac_decoder flac_decoder;24struct _flac_decoder {25/* output state */26FLAC__StreamDecoder* decoder; /* actual encoder */27uint32_t sample_rate; /* decoded sample rate */28uint8_t channels; /* decoded number of channels */29uint8_t bits_per_sample; /* decoded bits per sample */30uint32_t compressed_offset; /* current offset in compressed data */31const FLAC__byte * compressed_start; /* start of compressed data */32uint32_t compressed_length; /* length of compressed data */33const FLAC__byte * compressed2_start; /* start of compressed data */34uint32_t compressed2_length; /* length of compressed data */35int16_t * uncompressed_start[8]; /* pointer to start of uncompressed data (up to 8 streams) */36uint32_t uncompressed_offset; /* current position in uncompressed data */37uint32_t uncompressed_length; /* length of uncompressed data */38int uncompressed_swap; /* swap uncompressed sample data */39uint8_t custom_header[0x2a]; /* custom header */40};4142/* ======================> flac_decoder */4344void flac_decoder_init(flac_decoder* decoder);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);4950#endif /* __FLAC_H__ */515253