Advertisement
Guest User

flac 1.2.1 replaygain samplerate patch

a guest
Dec 17th, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.68 KB | None | 0 0
  1. diff -ur flac-1.2.1.orig/src/share/grabbag/replaygain.c flac-1.2.1/src/share/grabbag/replaygain.c
  2. --- flac-1.2.1.orig/src/share/grabbag/replaygain.c  2007-02-12 18:45:15.000000000 +0000
  3. +++ flac-1.2.1/src/share/grabbag/replaygain.c   2011-12-17 10:55:54.114388173 +0000
  4. @@ -127,7 +127,10 @@
  5.         24000,
  6.         32000,
  7.         44100,
  8. -       48000
  9. +       48000,
  10. +       64000,
  11. +       88200,
  12. +       96000
  13.     };
  14.     static const unsigned n_valid_sample_rates = sizeof(valid_sample_rates) / sizeof(valid_sample_rates[0]);
  15.  
  16. diff -ur flac-1.2.1.orig/src/share/replaygain_analysis/replaygain_analysis.c flac-1.2.1/src/share/replaygain_analysis/replaygain_analysis.c
  17. --- flac-1.2.1.orig/src/share/replaygain_analysis/replaygain_analysis.c 2007-06-14 06:40:45.000000000 +0100
  18. +++ flac-1.2.1/src/share/replaygain_analysis/replaygain_analysis.c  2011-12-17 12:03:01.849273061 +0000
  19. @@ -110,7 +110,7 @@
  20.  #define YULE_ORDER         10
  21.  #define BUTTER_ORDER        2
  22.  #define RMS_PERCENTILE      0.95        /* percentile which is louder than the proposed level */
  23. -#define MAX_SAMP_FREQ   48000.          /* maximum allowed sample frequency [Hz] */
  24. +#define MAX_SAMP_FREQ   96000.          /* maximum allowed sample frequency [Hz] */
  25.  #define RMS_WINDOW_TIME     0.050       /* Time slice size [s] */
  26.  #define STEPS_per_dB      100.          /* Table entries per dB */
  27.  #define MAX_dB            120.          /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */
  28. @@ -163,7 +163,10 @@
  29.  #pragma warning ( disable : 4305 )
  30.  #endif
  31.  
  32. -static const Float_t  AYule [9] [11] = {
  33. +static const Float_t  AYule [12] [11] = {
  34. +    { 1., -7.22103125152679, 24.7034187975904, -52.6825833623896, 77.4825736677539, -82.0074753444205, 63.1566097101925, -34.889569769245, 13.2126852760198, -3.09445623301669, 0.340344741393305 },
  35. +    { 1., -7.19001570087017, 24.4109412087159, -51.6306373580801, 75.3978476863163, -79.4164552507386, 61.0373661948115, -33.7446462547014, 12.8168791146274, -3.01332198541437, 0.223619893831468 },
  36. +    { 1., -5.74819833657784, 16.246507961894, -29.9691822642542, 40.027597579378, -40.3209196052655, 30.8542077487718, -17.5965138737281, 7.10690214103873, -1.82175564515191, 0.223619893831468},
  37.      { 1., -3.84664617118067,  7.81501653005538,-11.34170355132042, 13.05504219327545,-12.28759895145294,  9.48293806319790, -5.87257861775999,  2.75465861874613, -0.86984376593551, 0.13919314567432 },
  38.      { 1., -3.47845948550071,  6.36317777566148, -8.54751527471874,  9.47693607801280, -8.81498681370155,  6.85401540936998, -4.39470996079559,  2.19611684890774, -0.75104302451432, 0.13149317958808 },
  39.      { 1., -2.37898834973084,  2.84868151156327, -2.64577170229825,  2.23697657451713, -1.67148153367602,  1.00595954808547, -0.45953458054983,  0.16378164858596, -0.05032077717131, 0.02347897407020 },
  40. @@ -175,7 +178,10 @@
  41.      { 1., -0.25049871956020, -0.43193942311114, -0.03424681017675, -0.04678328784242,  0.26408300200955,  0.15113130533216, -0.17556493366449, -0.18823009262115,  0.05477720428674, 0.04704409688120 }
  42.  };
  43.  
  44. -static const Float_t  BYule [9] [11] = {
  45. +static const Float_t  BYule [12] [11] = {
  46. +    { 0.006471345933032, -0.02567678242161, 0.049805860704367, 0.049805860704367, -0.05823001743528, 0.040611847441914, -0.010912036887501, -0.00901635868667, 0.012448886238123, -0.007206683749426, 0.002167156433951, -0.000261819276949 },
  47. +    { 0.015415414474287, -0.07691359399407, 0.196677418516518, -0.338855114128061, 0.430094579594561, -0.415015413747894, 0.304942508151101, -0.166191795926663, 0.063198189938739, -0.015003978694525, 0.001748085184539 },
  48. +    { 0.021776466467053, -0.062376961003801, 0.107731165328514, -0.150994515142316, 0.170334807313632, -0.157984942890531, 0.121639833268721, -0.074094040816409, 0.031282852041061, -0.00755421235941, 0.00117925454213 },
  49.      { 0.03857599435200, -0.02160367184185, -0.00123395316851, -0.00009291677959, -0.01655260341619,  0.02161526843274, -0.02074045215285,  0.00594298065125,  0.00306428023191,  0.00012025322027,  0.00288463683916 },
  50.      { 0.05418656406430, -0.02911007808948, -0.00848709379851, -0.00851165645469, -0.00834990904936,  0.02245293253339, -0.02596338512915,  0.01624864962975, -0.00240879051584,  0.00674613682247, -0.00187763777362 },
  51.      { 0.15457299681924, -0.09331049056315, -0.06247880153653,  0.02163541888798, -0.05588393329856,  0.04781476674921,  0.00222312597743,  0.03174092540049, -0.01390589421898,  0.00651420667831, -0.00881362733839 },
  52. @@ -187,7 +193,10 @@
  53.      { 0.53648789255105, -0.42163034350696, -0.00275953611929,  0.04267842219415, -0.10214864179676,  0.14590772289388, -0.02459864859345, -0.11202315195388, -0.04060034127000,  0.04788665548180, -0.02217936801134 }
  54.  };
  55.  
  56. -static const Float_t  AButter [9] [3] = {
  57. +static const Float_t  AButter [12] [3] = {
  58. +    { 1., -1.98611621154089, 0.986211929160751 },
  59. +    { 1., -1.98488843762334, 0.979389350028798 },
  60. +    { 1., -1.97917472731008, 0.979389350028798 },
  61.      { 1., -1.97223372919527, 0.97261396931306 },
  62.      { 1., -1.96977855582618, 0.97022847566350 },
  63.      { 1., -1.95835380975398, 0.95920349965459 },
  64. @@ -199,7 +208,10 @@
  65.      { 1., -1.88903307939452, 0.89487434461664 }
  66.  };
  67.  
  68. -static const Float_t  BButter [9] [3] = {
  69. +static const Float_t  BButter [12] [3] = {
  70. +    { 0.99308203517541, -1.98616407035082, 0.99308203517541 },
  71. +    { 0.992472550461293, -1.98494510092258, 0.992472550461293 },
  72. +    { 0.989641019334721, -1.97928203866944, 0.989641019334721 },
  73.      { 0.98621192462708, -1.97242384925416, 0.98621192462708 },
  74.      { 0.98500175787242, -1.97000351574484, 0.98500175787242 },
  75.      { 0.97938932735214, -1.95877865470428, 0.97938932735214 },
  76. @@ -243,15 +255,18 @@
  77.          linprebuf[i] = lstepbuf[i] = loutbuf[i] = rinprebuf[i] = rstepbuf[i] = routbuf[i] = 0.;
  78.  
  79.      switch ( (int)(samplefreq) ) {
  80. -        case 48000: freqindex = 0; break;
  81. -        case 44100: freqindex = 1; break;
  82. -        case 32000: freqindex = 2; break;
  83. -        case 24000: freqindex = 3; break;
  84. -        case 22050: freqindex = 4; break;
  85. -        case 16000: freqindex = 5; break;
  86. -        case 12000: freqindex = 6; break;
  87. -        case 11025: freqindex = 7; break;
  88. -        case  8000: freqindex = 8; break;
  89. +        case 96000: freqindex = 0; break;
  90. +        case 88200: freqindex = 1; break;
  91. +        case 64000: freqindex = 2; break;
  92. +        case 48000: freqindex = 3; break;
  93. +        case 44100: freqindex = 4; break;
  94. +        case 32000: freqindex = 5; break;
  95. +        case 24000: freqindex = 6; break;
  96. +        case 22050: freqindex = 7; break;
  97. +        case 16000: freqindex = 8; break;
  98. +        case 12000: freqindex = 9; break;
  99. +        case 11025: freqindex = 10; break;
  100. +        case  8000: freqindex = 11; break;
  101.          default:    return INIT_GAIN_ANALYSIS_ERROR;
  102.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement