diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-05-21 16:51:23 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-05-21 16:59:58 -0400 |
commit | 1f76edabf9dca3b1cb25de77f6572a12370e35c4 (patch) | |
tree | da912dd9a37468c6ed4ca6ca8e2bcbced037c47f /lib/rbcodec/codecs/libspc/spc_codec.h | |
parent | de86b4a3c5f6e2add2dc7588e6be37c8df2302f0 (diff) | |
download | rockbox-1f76edabf9dca3b1cb25de77f6572a12370e35c4.tar.gz rockbox-1f76edabf9dca3b1cb25de77f6572a12370e35c4.zip |
SPC Codec: Need to restore a bit more data from cached waves.
'Nuff said. Last update wasn't quite right.
Change-Id: I082a79c4e0c82b968fe2375cb82ee5c3a64a208b
Diffstat (limited to 'lib/rbcodec/codecs/libspc/spc_codec.h')
-rw-r--r-- | lib/rbcodec/codecs/libspc/spc_codec.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/rbcodec/codecs/libspc/spc_codec.h b/lib/rbcodec/codecs/libspc/spc_codec.h index 9686694134..fad5a49916 100644 --- a/lib/rbcodec/codecs/libspc/spc_codec.h +++ b/lib/rbcodec/codecs/libspc/spc_codec.h | |||
@@ -272,18 +272,21 @@ enum state_t | |||
272 | state_release = 2 | 272 | state_release = 2 |
273 | }; | 273 | }; |
274 | 274 | ||
275 | enum { BRR_BLOCK_SIZE = 16 }; | ||
276 | |||
277 | #if SPC_BRRCACHE | ||
275 | struct cache_entry_t | 278 | struct cache_entry_t |
276 | { | 279 | { |
277 | int16_t const* samples; | 280 | int16_t const* samples; /* decoded samples (cached) */ |
278 | unsigned end; /* past-the-end position */ | 281 | unsigned end; /* past-the-end position (cached) */ |
279 | unsigned loop; /* number of samples in loop */ | 282 | unsigned loop; /* number of samples in loop (cached) */ |
280 | unsigned start_addr; | 283 | uint16_t start_addr; /* RAM start address */ |
284 | uint16_t loop_addr; /* RAM loop address */ | ||
285 | uint8_t block_header; /* final wave block header */ | ||
281 | }; | 286 | }; |
282 | 287 | ||
283 | enum { BRR_BLOCK_SIZE = 16 }; | ||
284 | enum { BRR_CACHE_SIZE = 0x20000 + 32}; | 288 | enum { BRR_CACHE_SIZE = 0x20000 + 32}; |
285 | 289 | ||
286 | #if SPC_BRRCACHE | ||
287 | struct voice_wave_t | 290 | struct voice_wave_t |
288 | { | 291 | { |
289 | int16_t const* samples; /* decoded samples in cache */ | 292 | int16_t const* samples; /* decoded samples in cache */ |
@@ -291,7 +294,7 @@ struct voice_wave_t | |||
291 | long end; /* end position in samples buffer */ | 294 | long end; /* end position in samples buffer */ |
292 | int loop; /* length of looping area */ | 295 | int loop; /* length of looping area */ |
293 | unsigned block_header; /* header byte from current BRR block */ | 296 | unsigned block_header; /* header byte from current BRR block */ |
294 | uint8_t const* addr; /* BRR waveform address in RAM */ | 297 | unsigned start_addr; /* BRR waveform address in RAM */ |
295 | unsigned loop_addr; /* Loop address in RAM */ | 298 | unsigned loop_addr; /* Loop address in RAM */ |
296 | }; | 299 | }; |
297 | #else /* !SPC_BRRCACHE */ | 300 | #else /* !SPC_BRRCACHE */ |
@@ -300,7 +303,7 @@ struct voice_wave_t | |||
300 | int16_t samples [3 + BRR_BLOCK_SIZE + 1]; /* last decoded block */ | 303 | int16_t samples [3 + BRR_BLOCK_SIZE + 1]; /* last decoded block */ |
301 | int32_t position; /* position in samples buffer, 12-bit frac */ | 304 | int32_t position; /* position in samples buffer, 12-bit frac */ |
302 | unsigned block_header; /* header byte from current BRR block */ | 305 | unsigned block_header; /* header byte from current BRR block */ |
303 | uint8_t const* addr; /* BRR waveform address in RAM */ | 306 | unsigned start_addr; /* BRR waveform address in RAM */ |
304 | }; | 307 | }; |
305 | #endif /* SPC_BRRCACHE */ | 308 | #endif /* SPC_BRRCACHE */ |
306 | 309 | ||
@@ -359,7 +362,7 @@ struct Spc_Dsp | |||
359 | #endif /* !SPC_NOECHO */ | 362 | #endif /* !SPC_NOECHO */ |
360 | 363 | ||
361 | #if SPC_BRRCACHE | 364 | #if SPC_BRRCACHE |
362 | uint8_t oldsize; | 365 | unsigned oldsize; |
363 | struct cache_entry_t wave_entry [256]; | 366 | struct cache_entry_t wave_entry [256]; |
364 | struct cache_entry_t wave_entry_old [256]; | 367 | struct cache_entry_t wave_entry_old [256]; |
365 | #endif | 368 | #endif |