path: root/apps/codecs/libwma/wmadec.h
diff options
authorDave Chapman <>2007-07-09 17:24:00 +0000
committerDave Chapman <>2007-07-09 17:24:00 +0000
commit88e32c2fc66544dfe55c2e307461ee01d590fef3 (patch)
tree9b192ebacf8b12c6bcbb24335c32207113af56f8 /apps/codecs/libwma/wmadec.h
parent01e8fce28760ab32c45ca330a8506c5cf45abf14 (diff)
Reorganise the wma_decode_superframe() function - split into a separate init and decode functions. Each call to the decode function now decodes a single frame (2048 samples) instead of an entire superframe (which typically contained about 7 or 8 frames and can in theory contain up to 16 frames). This allows us to replace the 256KB output buffer with a 8KB buffer, and also perform more yields in the main decoding loop.
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma/wmadec.h')
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/codecs/libwma/wmadec.h b/apps/codecs/libwma/wmadec.h
index e23d7c20b0..fd2d63c9d4 100644
--- a/apps/codecs/libwma/wmadec.h
+++ b/apps/codecs/libwma/wmadec.h
@@ -137,6 +137,11 @@ typedef struct WMADecodeContext
fixed64 lsp_pow_m_table1[(1 << LSP_POW_BITS)];
fixed64 lsp_pow_m_table2[(1 << LSP_POW_BITS)];
+ /* State of current superframe decoding */
+ int bit_offset;
+ int nb_frames;
+ int current_frame;
#ifdef TRACE
int frame_count;
@@ -145,7 +150,9 @@ typedef struct WMADecodeContext
int wma_decode_init(WMADecodeContext* s, asf_waveformatex_t *wfx);
-int wma_decode_superframe(WMADecodeContext* s,
- void *data, int *data_size,
- uint8_t *buf, int buf_size);
+int wma_decode_superframe_init(WMADecodeContext* s,
+ uint8_t *buf, int buf_size);
+int wma_decode_superframe_frame(WMADecodeContext* s,
+ int16_t *samples,
+ uint8_t *buf, int buf_size);