summaryrefslogtreecommitdiff
path: root/apps/codecs/libmusepack
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libmusepack')
-rw-r--r--apps/codecs/libmusepack/decoder.h8
-rw-r--r--apps/codecs/libmusepack/mpc_decoder.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/codecs/libmusepack/decoder.h b/apps/codecs/libmusepack/decoder.h
index 499cd53137..9031bf29e7 100644
--- a/apps/codecs/libmusepack/decoder.h
+++ b/apps/codecs/libmusepack/decoder.h
@@ -43,7 +43,15 @@
43#include "reader.h" 43#include "reader.h"
44#include "streaminfo.h" 44#include "streaminfo.h"
45 45
46// define this to enable/disable support for streamversion SV4-6
46//#define MPC_SUPPORT_SV456 47//#define MPC_SUPPORT_SV456
48
49// SCF_HACK is used to avoid possible distortion after seeking with mpc files
50// background: scf's are coded differential in time domain. if you seek to the
51// desired postion it might happen that the baseline is missed and the resulting
52// scf is much too high (hissing noise). this hack uses the lowest scaling until
53// a non-differential scf could be decoded after seek. through this hack subbands
54// are faded out until there was at least a single non-differential scf found.
47#define SCF_HACK 55#define SCF_HACK
48 56
49enum { 57enum {
diff --git a/apps/codecs/libmusepack/mpc_decoder.c b/apps/codecs/libmusepack/mpc_decoder.c
index e63d1efaec..d211980782 100644
--- a/apps/codecs/libmusepack/mpc_decoder.c
+++ b/apps/codecs/libmusepack/mpc_decoder.c
@@ -65,7 +65,7 @@ extern const HuffmanTyp mpc_table_Region_C [ 4];
65#endif 65#endif
66 66
67#ifdef SCF_HACK 67#ifdef SCF_HACK
68#define SCF_DIFF(SCF, D) (SCF == -128 ? -128 : SCF + D) 68#define SCF_DIFF(SCF, D) (SCF == 127 ? 127 : SCF + D)
69#else 69#else
70#define SCF_DIFF(SCF, D) SCF + D 70#define SCF_DIFF(SCF, D) SCF + D
71#endif 71#endif
@@ -1565,8 +1565,8 @@ void mpc_decoder_reset_state(mpc_decoder *d) {
1565 memset(d->Y_L , 0, sizeof Y_L ); 1565 memset(d->Y_L , 0, sizeof Y_L );
1566 memset(d->Y_R , 0, sizeof Y_R ); 1566 memset(d->Y_R , 0, sizeof Y_R );
1567#ifdef SCF_HACK 1567#ifdef SCF_HACK
1568 memset(d->SCF_Index_L , -128, sizeof d->SCF_Index_L ); 1568 memset(d->SCF_Index_L , 127, sizeof d->SCF_Index_L );
1569 memset(d->SCF_Index_R , -128, sizeof d->SCF_Index_R ); 1569 memset(d->SCF_Index_R , 127, sizeof d->SCF_Index_R );
1570#else 1570#else
1571 memset(d->SCF_Index_L , 0, sizeof d->SCF_Index_L ); 1571 memset(d->SCF_Index_L , 0, sizeof d->SCF_Index_L );
1572 memset(d->SCF_Index_R , 0, sizeof d->SCF_Index_R ); 1572 memset(d->SCF_Index_R , 0, sizeof d->SCF_Index_R );