summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-04-01 21:25:51 +0200
committerMartijn van Beurden <mvanb1@gmail.com>2022-06-12 18:38:21 +0200
commit9df24ac202149214a170e105604a35e04e65be15 (patch)
treefb0404b73e6b8d67c1d1826f1ddc4aa4c16ccc3f /include
parent9b3826006a3fc27b34d9297a9a8194accacc2c44 (diff)
downloadflac-9df24ac202149214a170e105604a35e04e65be15.tar.gz
Add 32-bit decoding capability
Decoding for 32-bit files is added, including the ability to decode a 33-bit side subframe. However, residuals are assumed to be limited to a 32-bit signed int, the encoder must make sure of this
Diffstat (limited to 'include')
-rw-r--r--include/FLAC/format.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/FLAC/format.h b/include/FLAC/format.h
index cf5c25aa..28eda599 100644
--- a/include/FLAC/format.h
+++ b/include/FLAC/format.h
@@ -282,14 +282,24 @@ extern FLAC_API const char * const FLAC__SubframeTypeString[];
/** CONSTANT subframe. (c.f. <A HREF="../format.html#subframe_constant">format specification</A>)
*/
typedef struct {
- FLAC__int32 value; /**< The constant signal value. */
+ FLAC__int64 value; /**< The constant signal value. */
} FLAC__Subframe_Constant;
+/** An enumeration of the possible verbatim subframe data types. */
+typedef enum {
+ FLAC__VERBATIM_SUBFRAME_DATA_TYPE_INT32, /**< verbatim subframe has 32-bit int */
+ FLAC__VERBATIM_SUBFRAME_DATA_TYPE_INT64 /**< verbatim subframe has 64-bit int */
+} FLAC__VerbatimSubframeDataType;
+
/** VERBATIM subframe. (c.f. <A HREF="../format.html#subframe_verbatim">format specification</A>)
*/
typedef struct {
- const FLAC__int32 *data; /**< A pointer to verbatim signal. */
+ union {
+ const FLAC__int32 *int32; /**< A FLAC__int32 pointer to verbatim signal. */
+ const FLAC__int64 *int64; /**< A FLAC__int64 pointer to verbatim signal. */
+ } data;
+ FLAC__VerbatimSubframeDataType data_type;
} FLAC__Subframe_Verbatim;
@@ -302,7 +312,7 @@ typedef struct {
uint32_t order;
/**< The polynomial order. */
- FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER];
+ FLAC__int64 warmup[FLAC__MAX_FIXED_ORDER];
/**< Warmup samples to prime the predictor, length == order. */
const FLAC__int32 *residual;
@@ -328,7 +338,7 @@ typedef struct {
FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER];
/**< FIR filter coefficients. */
- FLAC__int32 warmup[FLAC__MAX_LPC_ORDER];
+ FLAC__int64 warmup[FLAC__MAX_LPC_ORDER];
/**< Warmup samples to prime the predictor, length == order. */
const FLAC__int32 *residual;