psych_44.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: key psychoacoustic settings for 44.1/48kHz
  13. last mod: $Id$
  14. ********************************************************************/
  15. /* preecho trigger settings *****************************************/
  16. static vorbis_info_psy_global _psy_global_44[6]={
  17. /*
  18. { lines per eighth octave,
  19. { pre-echo thresh.},
  20. { post-echo thresh.}, stretch penalty, pre-echo minimum energy,
  21. ampmax att 1/sec,
  22. {coupling point(kHz)},{{coupling point limit0},{coupling point limit1}},
  23. {coupling pre-point amp},{coupling post-point amp},{{sliding lowpass0},{sliding lowpass1}}
  24. },
  25. */
  26. /* q-2 */
  27. {8, /* lines per eighth octave */
  28. {24.f,16.f,16.f,16.f,16.f,16.f,14.f},
  29. {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
  30. -6.f,
  31. {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  32. },
  33. {8, /* lines per eighth octave */
  34. // {20.f,14.f,12.f,12.f,12.f,12.f,12.f},
  35. {20.f,14.f,14.f,14.f,14.f,14.f,14.f},
  36. {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
  37. -6.f,
  38. {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  39. },
  40. {8, /* lines per eighth octave */
  41. {14.f,10.f,10.f,10.f,10.f,10.f,10.f},
  42. {-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f,
  43. -6.f,
  44. {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  45. },
  46. {8, /* lines per eighth octave */
  47. {12.f,10.f,10.f,10.f,10.f,10.f,10.f},
  48. {-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f,
  49. -6.f,
  50. {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  51. },
  52. {8, /* lines per eighth octave */
  53. // {10.f,8.f,8.f,8.f,8.f,8.f,8.f},
  54. {8.f,8.f,8.f,6.f,6.f,6.f,7.f},
  55. {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
  56. -6.f,
  57. {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  58. },
  59. {8, /* lines per eighth octave */
  60. // {10.f,6.f,6.f,6.f,6.f,6.f,6.f},
  61. {6.f,6.f,6.f,6.f,6.f,6.f,6.f},
  62. // {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
  63. {-15.f,-14.f,-10.f,-10.f,-10.f,-11.f,-12.f}, 0,-85.f,
  64. -6.f,
  65. {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
  66. },
  67. };
  68. /* noise compander lookups * low, mid, high quality ****************/
  69. static compandblock _psy_compand_44[6]={
  70. /* sub-mode Z short */
  71. {{
  72. // 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
  73. // 8, 9,10,11,12,13,14, 15, /* 15dB */
  74. // 16,17,18,19,20,21,22, 23, /* 23dB */
  75. // 24,25,26,27,28,29,30, 31, /* 31dB */
  76. // 32,33,34,35,36,37,38, 39, /* 39dB */
  77. 0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
  78. 7, 7, 7, 8, 9, 9,10, 10, /* 15dB */
  79. 11,12,13,14,15,15,15, 15, /* 23dB */
  80. 16,16,17,17,17,18,18, 19, /* 31dB */
  81. 19,19,20,21,22,23,24, 25, /* 39dB */
  82. }},
  83. /* mode_Z nominal short */
  84. {{
  85. // 0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
  86. // 7, 7, 7, 7, 6, 6, 6, 7, /* 15dB */
  87. // 7, 8, 9,10,11,12,13, 14, /* 23dB */
  88. // 15,16,17,17,17,18,18, 19, /* 31dB */
  89. // 19,19,20,21,22,23,24, 25, /* 39dB */
  90. 0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
  91. 7, 7, 7, 7, 7, 7, 7, 7, /* 15dB */
  92. 7, 8, 9,10,11,12,13, 14, /* 23dB */
  93. 15,16,17,17,17,18,18, 19, /* 31dB */
  94. 19,19,20,21,22,23,24, 25, /* 39dB */
  95. }},
  96. /* mode A short */
  97. {{
  98. // 0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */
  99. // 6, 6, 6, 5, 4, 4, 4, 4, /* 15dB */
  100. // 4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
  101. // 7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
  102. // 11,12,13,14,15,16,17, 18, /* 39dB */
  103. 0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */
  104. 6, 6, 6, 6, 6, 6, 6, 6, /* 15dB */
  105. 6, 6, 6, 6, 6, 7, 7, 7, /* 23dB */
  106. 8, 8, 8, 9, 9, 9,10, 11, /* 31dB */
  107. 11,12,13,14,15,16,17, 18, /* 39dB */
  108. }},
  109. /* sub-mode Z long */
  110. {{
  111. 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
  112. 8, 9,10,11,12,13,14, 15, /* 15dB */
  113. 16,17,18,19,20,21,22, 23, /* 23dB */
  114. 24,25,26,27,28,29,30, 31, /* 31dB */
  115. 32,33,34,35,36,37,38, 39, /* 39dB */
  116. }},
  117. /* mode_Z nominal long */
  118. {{
  119. 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
  120. 8, 9,10,11,12,12,13, 13, /* 15dB */
  121. 13,14,14,14,15,15,15, 15, /* 23dB */
  122. 16,16,17,17,17,18,18, 19, /* 31dB */
  123. 19,19,20,21,22,23,24, 25, /* 39dB */
  124. }},
  125. /* mode A long */
  126. {{
  127. // 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
  128. // 8, 8, 7, 6, 5, 4, 4, 4, /* 15dB */
  129. // 4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
  130. // 7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
  131. // 11,12,13,14,15,16,17, 18, /* 39dB */
  132. 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
  133. 7, 7, 7, 6, 6, 6, 6, 6, /* 15dB */
  134. 6, 6, 6, 6, 6, 7, 7, 7, /* 23dB */
  135. 8, 8, 8, 9, 9, 9,10, 11, /* 31dB */
  136. 11,12,13,14,15,16,17, 18, /* 39dB */
  137. }}
  138. };
  139. /* tonal masking curve level adjustments *************************/
  140. static vp_adjblock _vp_tonemask_adj_longblock[13]={
  141. /* 63 125 250 500 1 2 4 8 16 */
  142. {{-16,-16,-16,-15,-15,-15,-15,-15,-14,-13,-12,-11,-11, -4, 0, 0, 5}}, /* -2(addition) */
  143. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-14,-13, -7, -2, -2, 3}}, /* -1 */
  144. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-14,-13, -8, -3, -3, 1}}, /* 0 */
  145. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-14,-10, -3, -3, 0}}, /* 1 */
  146. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-14,-11, -5, -5, 0}}, /* 2 */
  147. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-14,-12, -7, -6, 0}}, /* 3 */
  148. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -8, -9, 0}}, /* 4 */
  149. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -8, -9, 0}}, /* 5 */
  150. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 6 */
  151. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 7 */
  152. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 8 */
  153. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 9 */
  154. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12,-10,-10, 0}}, /* 10 */
  155. };
  156. static vp_adjblock _vp_tonemask_adj_otherblock[13]={
  157. /* 63 125 250 500 1 2 4 8 16 */
  158. {{-16,-16,-16,-15,-15,-15,-15,-15,-14,-13,-12,-11,-11, -4, 0, 0, 5}}, /* -2(addition) */
  159. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-14,-13, -7, -2, -2, 3}}, /* -1 */
  160. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-14,-13, -8, -3, -3, 1}}, /* 0 */
  161. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-14,-10, -3, -3, 0}}, /* 1 */
  162. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-14,-11, -5, -5, 0}}, /* 2 */
  163. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-15,-15,-14,-12, -7, -6, 0}}, /* 3 */
  164. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -8, -9, 0}}, /* 4 */
  165. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -8, -9, 0}}, /* 5 */
  166. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 6 */
  167. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 7 */
  168. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 8 */
  169. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12, -9,-10, 0}}, /* 9 */
  170. {{-16,-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-14,-12,-10,-10, 0}}, /* 10 */
  171. };
  172. /* noise bias (transition block) */
  173. static noise3 _psy_noisebias_trans[13]={
  174. /* 63 125 250 500 1k 2k 4k 8k 16k*/
  175. /* -2(addition mode) */
  176. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  177. {-28,-28,-26,-26,-22,-18,-16,-10, -2, 2, 2, 2, 3, 5, 6, 7, 14},
  178. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
  179. /* -1 */
  180. /*{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  181. {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
  182. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
  183. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  184. {-30,-30,-28,-28,-24,-20,-18,-12, -4, 0, 0, 0, 1, 3, 4, 5, 12},
  185. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
  186. /* 0 */
  187. /*{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
  188. {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 4, 10},
  189. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
  190. {{{-15,-15,-15,-15,-15,-12, -6, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
  191. {-30,-30,-30,-30,-26,-22,-20,-14, -6, 0, 0, 0, 1, 1, 2, 3, 8},
  192. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},
  193. /* 1 */
  194. /*{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
  195. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
  196. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
  197. {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
  198. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, -1, 1, 4},
  199. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
  200. /* 2 */
  201. /*{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
  202. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
  203. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, */
  204. {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
  205. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -2, -2, -1, 1, 3},
  206. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -7, -4}}},
  207. /* 3 */
  208. /*{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
  209. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
  210. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
  211. {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
  212. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 3},
  213. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
  214. /* 4 */
  215. /*{{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  216. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
  217. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
  218. {{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  219. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 1},
  220. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
  221. /* 5 */
  222. /*{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  223. {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
  224. {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}}, */
  225. {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  226. {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0},
  227. {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},
  228. /* 6 */
  229. /*{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  230. {-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
  231. {-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
  232. {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  233. {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -6, -6, -6, -6, -4, -2, 0},
  234. {-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},
  235. /* 7 */
  236. /*{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  237. {-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4, 0},
  238. {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},*/
  239. {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
  240. {-34,-34,-34,-34,-30,-30,-24,-20,-14,-12,-10, -8, -8, -8, -6, -4, 0},
  241. {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},
  242. /* 8 */
  243. /*{{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
  244. {-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
  245. {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
  246. {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
  247. {-34,-34,-34,-34,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
  248. {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
  249. /* 9 */
  250. /*{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
  251. {-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
  252. {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
  253. {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
  254. {-36,-36,-36,-36,-32,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
  255. {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
  256. /* 10 */
  257. {{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10},
  258. {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
  259. {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
  260. };
  261. /* noise bias (long block) */
  262. static noise3 _psy_noisebias_long[13]={
  263. /* 63 125 250 500 1k 2k 4k 8k 16k*/
  264. /* -2(addition mode) */
  265. {{{-10,-10,-10,-10,-10, -4, 0, 0, 2, 6, 6, 6, 6, 10, 10, 12, 20},
  266. {-20,-20,-20,-20,-20,-18,-12, -6, 0, 2, 2, 2, 3, 5, 6, 7, 14},
  267. {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
  268. /* -1 */
  269. /*{{{-10,-10,-10,-10,-10, -4, 0, 0, 0, 6, 6, 6, 6, 10, 10, 12, 20},
  270. {-20,-20,-20,-20,-20,-20,-10, -2, 0, 0, 0, 0, 0, 2, 4, 6, 15},
  271. {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
  272. {{{-10,-10,-10,-10,-10, -4, 0, 0, 0, 6, 6, 6, 6, 10, 10, 12, 20},
  273. {-20,-20,-20,-20,-20,-18,-12, -8, -2, 0, 0, 0, 1, 3, 4, 5, 12},
  274. {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
  275. /* 0 */
  276. /*{{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
  277. {-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 4, 10},
  278. {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
  279. {{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
  280. {-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 1, 1, 2, 3, 8},
  281. {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},
  282. /* 1 */
  283. /*{{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
  284. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
  285. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
  286. {{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
  287. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, -1, 1, 4},
  288. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
  289. /* 2 */
  290. /*{{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
  291. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
  292. {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
  293. {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
  294. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -2, -2, -1, 1, 3},
  295. {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
  296. /* 3 */
  297. /*{{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
  298. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
  299. {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
  300. {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
  301. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 3},
  302. {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -5}}},
  303. /* 4 */
  304. /*{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  305. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
  306. {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
  307. {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  308. {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 1},
  309. {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -7}}},
  310. /* 5 */
  311. /*{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  312. {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
  313. {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},*/
  314. {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  315. {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0},
  316. {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -8}}},
  317. /* 6 */
  318. /*{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  319. {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
  320. {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
  321. {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  322. {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 0},
  323. {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},
  324. /* 7 */
  325. // {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  326. // {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4, 0},
  327. // {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
  328. {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
  329. {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4, 0},
  330. {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
  331. /* 8 */
  332. {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 0, 0, 0, 0, 1, 2, 3, 7},
  333. {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
  334. {-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
  335. /* 9 */
  336. {{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2, 2},
  337. {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
  338. {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
  339. /* 10 */
  340. {{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10},
  341. {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-20},
  342. {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
  343. };
  344. /* noise bias (impulse block) */
  345. static noise3 _psy_noisebias_impulse[13]={
  346. /* 63 125 250 500 1k 2k 4k 8k 16k*/
  347. /* -2(addition mode) */
  348. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  349. {-28,-28,-26,-26,-22,-18,-16,-10, -2, 2, 2, 2, 3, 5, 6, 7, 14},
  350. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
  351. /* -1 */
  352. /*{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  353. {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
  354. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
  355. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  356. {-30,-30,-28,-28,-24,-20,-18,-12, -4, 0, 0, 0, 1, 2, 4, 5, 12},
  357. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
  358. /* 0 */
  359. /*{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
  360. {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 4, 10},
  361. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
  362. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
  363. {-30,-30,-30,-30,-26,-22,-20,-14, -6, 0, 0, 0, 1, 1, 2, 3, 8},
  364. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
  365. /* 1 */
  366. /*{{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
  367. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2, 2},
  368. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},*/
  369. {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
  370. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -1, 1, 4},
  371. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},
  372. /* 2 */
  373. // {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
  374. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
  375. // {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
  376. {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
  377. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -3, 0, 1},
  378. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
  379. /* 3 */
  380. // {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
  381. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
  382. // {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
  383. {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
  384. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -3, 0, 1},
  385. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
  386. /* 4 */
  387. // {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
  388. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
  389. // {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
  390. {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
  391. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -3, 0, 1},
  392. {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
  393. /* 5 */
  394. /*{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
  395. {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
  396. {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},*/
  397. {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
  398. {-32,-32,-32,-32,-28,-24,-22,-16,-12, -8, -8, -8, -6, -6, -5, -4, -2},
  399. {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
  400. /* 6 */
  401. /*{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
  402. {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
  403. {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/
  404. {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
  405. {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-14,-14,-10, -9, -8, -6, -4},
  406. {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},
  407. /* 7 */
  408. /*{{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
  409. {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
  410. {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},*/
  411. {{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
  412. {-34,-34,-34,-34,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10,-10, -8},
  413. {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},
  414. /* 8 */
  415. {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10},
  416. {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
  417. {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
  418. /* 9 */
  419. // {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
  420. // {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
  421. // {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
  422. {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
  423. {-36,-36,-36,-36,-32,-32,-32,-28,-24,-24,-24,-24,-24,-22,-20,-20,-18},
  424. {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
  425. /* 10 */
  426. {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
  427. {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26},
  428. {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
  429. };
  430. /* noise bias (padding block) */
  431. static noise3 _psy_noisebias_padding[13]={
  432. /* 63 125 250 500 1k 2k 4k 8k 16k*/
  433. /* -2(addition mode) */
  434. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  435. {-28,-28,-26,-26,-22,-18,-16,-10, -2, 2, 2, 2, 4, 6, 7, 8, 14},
  436. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
  437. /* -1 */
  438. /*{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  439. {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
  440. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
  441. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  442. {-30,-30,-28,-28,-24,-20,-18,-12, -4, 0, 0, 1, 2, 4, 5, 6, 12},
  443. {-30,-30,-30,-30,-30,-24,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}},
  444. /* 0 */
  445. /*{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  446. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, 2, 3, 6, 6, 8, 10},
  447. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}},*/
  448. {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
  449. {-30,-30,-30,-30,-26,-22,-20,-14, -6, 0, 0, 0, 1, 2, 3, 4, 8},
  450. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}},
  451. /* 1 */
  452. // {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
  453. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
  454. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2, 0}}},
  455. {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
  456. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 1, 1, 2, 4, 8},
  457. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2, 0}}},
  458. /* 2 */
  459. // {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
  460. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
  461. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
  462. {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
  463. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 0, 2, 4, 8},
  464. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
  465. /* 3 */
  466. {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
  467. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6},
  468. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
  469. /* 4 */
  470. // {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
  471. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1, 0, 2, 6},
  472. // {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
  473. {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
  474. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1, 0, 0, 6},
  475. {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
  476. /* 5 */
  477. {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
  478. {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -3, -3, -3, -3, -2, 0, 4},
  479. {-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10,-10,-10, -8, -5, -3}}},
  480. /* 6 */
  481. {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
  482. {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1, 4},
  483. {-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}},
  484. /* 7 */
  485. /*{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
  486. {-34,-34,-34,-34,-30,-30,-30,-24,-16,-10, -8, -6, -6, -6, -5, -3, 1},
  487. {-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}},*/
  488. {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
  489. {-34,-34,-34,-34,-30,-30,-24,-20,-14,-10, -8, -6, -6, -6, -5, -3, 1},
  490. {-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}},
  491. /* 8 */
  492. {{{-22,-22,-22,-22,-22,-20,-14,-10, -4, 0, 0, 0, 0, 3, 5, 5, 11},
  493. {-34,-34,-34,-34,-30,-30,-30,-24,-16,-12,-10, -8, -8, -8, -7, -5, -2},
  494. {-36,-36,-36,-36,-36,-34,-28,-22,-20,-20,-20,-20,-20,-20,-20,-16,-14}}},
  495. /* 9 */
  496. // {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2, 0, 2, 6},
  497. // {-36,-36,-36,-36,-34,-32,-32,-24,-16,-12,-12,-12,-12,-12,-10, -8, -5},
  498. // {-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}},
  499. {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2, 0, 2, 6},
  500. {-36,-36,-36,-36,-32,-32,-32,-26,-18,-14,-12,-12,-12,-12,-10, -8, -5},
  501. {-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}},
  502. /* 10 */
  503. {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8},
  504. {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-25,-25,-25,-25,-25,-25,-15},
  505. {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
  506. };
  507. static noiseguard _psy_noiseguards_44[4]={
  508. {3,3,15},
  509. {3,3,15},
  510. {10,10,100},
  511. {10,10,100},
  512. };
  513. static int _psy_tone_suppress[13]={
  514. /* -20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45, */
  515. -20,-20,-20,-20,-20,-20,-24,-30,-40,-40,-42,-45,-45,
  516. };
  517. static int _psy_tone_0dB[13]={
  518. /* 90,90,95,95,95,95,105,105,105,105,105,105, */
  519. 90,90,90,95,95,95,95,105,105,105,105,105,105,
  520. };
  521. static int _psy_noise_suppress[13]={
  522. /* -20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45, */
  523. -20,-20,-20,-24,-24,-24,-24,-30,-40,-40,-42,-45,-45,
  524. };
  525. static vorbis_info_psy _psy_info_template={
  526. /* blockflag */
  527. -1,
  528. /* ath_adjatt, ath_maxatt */
  529. -140.,-140.,
  530. /* tonemask att boost/decay,suppr,curves */
  531. {0.f,0.f,0.f}, 0.,0., -40.f, {0.},
  532. /*noisemaskp,supp, low/high window, low/hi guard, minimum */
  533. 1, -0.f, .5f, .5f, 0,0,0,
  534. /* noiseoffset*3, noisecompand, max_curve_dB */
  535. {{-1},{-1},{-1}},{-1},105.f,
  536. /* noise normalization - channel_p, point_p, start, partition, thresh. */
  537. 0,0,-1,-1,0.,
  538. };
  539. /* ath ****************/
  540. static int _psy_ath_floater[13]={
  541. /* -100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120, */
  542. -100,-100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
  543. };
  544. static int _psy_ath_abs[13]={
  545. /* -130,-130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150, */
  546. -130,-130,-130,-130,-130,-135,-140,-140,-140,-140,-140,-140,-150,
  547. };
  548. /* stereo setup. These don't map directly to quality level, there's
  549. an additional indirection as several of the below may be used in a
  550. single bitmanaged stream
  551. ****************/
  552. /* various stereo possibilities */
  553. /* stereo mode by base quality level */
  554. static adj_stereo _psy_stereo_modes_44[13]={
  555. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -2(addition mode) */
  556. {{ 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, 0, 0, 0},
  557. { 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 6, 6, 5, 4, 3},
  558. { 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 5, 6, 7, 8, 8},
  559. { 10,10.5, 11,11.5, 12,12.5, 13, 99, 99, 99, 99, 99, 99, 99, 99}},
  560. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -1 */
  561. /*{{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
  562. { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3},
  563. { 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8},
  564. { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},*/
  565. {{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
  566. { 8, 8, 8, 8, 8, 7, 7, 6, 6, 6, 6, 6, 5, 4, 3},
  567. { 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8},
  568. { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
  569. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 */
  570. /*{{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
  571. { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3},
  572. { 1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8},
  573. { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},*/
  574. {{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, 0, 0, 0, 0},
  575. { 8, 8, 8, 8, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3},
  576. { 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8},
  577. { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
  578. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 */
  579. /*{{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0},
  580. { 8, 8, 8, 8, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3},
  581. { 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8},
  582. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
  583. {{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0},
  584. { 8, 8, 8, 8, 6, 6, 5, 4, 4, 4, 4, 4, 4, 3, 3},
  585. { 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8},
  586. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  587. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 */
  588. /*{{ 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 0, 0, 0, 0, 0},
  589. { 8, 8, 8, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3, 2, 1},
  590. { 3, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8},
  591. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, */
  592. {{ 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 0, 0, 0, 0, 0},
  593. { 8, 8, 6, 6, 5, 5, 4, 4, 4, 4, 4, 4, 3, 2, 1},
  594. { 3, 4, 4, 5, 5, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8},
  595. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  596. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 */
  597. {{ 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
  598. { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1},
  599. { 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 10, 10, 10, 10, 10},
  600. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  601. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 */
  602. {{ 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  603. { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2, 1, 0},
  604. { 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10},
  605. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  606. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 */
  607. /*{{ 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  608. { 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0},
  609. { 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10},
  610. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
  611. {{ 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  612. { 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 0, 0, 0, 0},
  613. { 6, 7, 8, 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12},
  614. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  615. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 */
  616. /*{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  617. { 3, 3, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  618. { 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
  619. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, */
  620. {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  621. { 3, 3, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  622. { 8, 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
  623. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  624. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 */
  625. /*{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  626. { 3, 3, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  627. { 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
  628. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
  629. {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  630. { 3, 3, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  631. { 8, 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
  632. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  633. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 */
  634. /*{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  635. { 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  636. { 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
  637. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
  638. {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  639. { 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  640. { 8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
  641. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  642. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 */
  643. {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  644. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  645. { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
  646. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  647. /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 */
  648. {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  649. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  650. { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
  651. { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
  652. };
  653. /* tone master attenuation by base quality mode and bitrate tweak */
  654. static att3 _psy_tone_masteratt_44[13]={
  655. {{ 40, 32, 16}, 0, 0}, /* -2 */
  656. // {{ 35, 21, 9}, 0, 0}, /* -1 */
  657. {{ 36, 25, 10}, 0, 0}, /* -1 */
  658. // {{ 30, 20, 8}, -2, 1.25}, /* 0 */
  659. {{ 32, 20, 8}, 0, 0}, /* 0 */
  660. {{ 25, 14, 4}, 0, 0}, /* 1 */
  661. {{ 20, 10, -2}, 0, 0}, /* 2 */
  662. // {{ 20, 9, -4}, 0, 0}, /* 3 */
  663. {{ 20, 10, -3}, 0, 0}, /* 3 */
  664. {{ 20, 9, -4}, 0, 0}, /* 4 */
  665. {{ 20, 6, -6}, 0, 0}, /* 5 */
  666. {{ 20, 3, -10}, 0, 0}, /* 6 */
  667. {{ 18, 1, -14}, 0, 0}, /* 7 */
  668. {{ 18, 0, -16}, 0, 0}, /* 8 */
  669. {{ 18, -2, -16}, 0, 0}, /* 9 */
  670. {{ 12, -2, -20}, 0, 0}, /* 10 */
  671. };
  672. /* lowpass by mode **************/
  673. static double _psy_lowpass_44[13]={
  674. /* 15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999. */
  675. // 13.9,15.1,15.8,16.5,17.2,18.9,20.1,48.,999.,999.,999.,999.
  676. 13.0,14.3,15.1,15.8,16.5,17.2,18.3,20.1,48.,999.,999.,999.,999.
  677. };
  678. /* noise normalization **********/
  679. static int _noise_start_short_44[12]={
  680. /* 16,16,16,16,32,32,9999,9999,9999,9999 */
  681. // 32,16,16,16,32,9999,9999,9999,9999,9999,9999
  682. 32,32,16,16,32,64,9999,9999,9999,9999,9999,9999
  683. };
  684. static int _noise_start_long_44[12]={
  685. /* 128,128,128,256,512,512,9999,9999,9999,9999 */
  686. // 256,128,128,256,512,9999,9999,9999,9999,9999,9999
  687. 256,256,128,128,256,512,9999,9999,9999,9999,9999,9999
  688. };
  689. static int _noise_part_short_44[12]={
  690. /* 8,8,8,8,8,8,8,8,8,8,8 */
  691. 8,8,8,8,8,8,8,8,8,8,8,8
  692. };
  693. static int _noise_part_long_44[12]={
  694. /* 32,32,32,32,32,32,32,32,32,32,32 */
  695. 32,32,32,32,32,32,32,32,32,32,32,32
  696. };
  697. static double _noise_thresh_44[12]={
  698. /* .2,.2,.3,.4,.5,.5,9999.,9999.,9999.,9999., */
  699. // .2,.2,.2,.4,.6,9999.,9999.,9999.,9999.,9999.,9999.,
  700. .17,.2,.2,.2,.35,.6,9999.,9999.,9999.,9999.,9999.,9999.,
  701. };
  702. /* 0~8kHz */
  703. static double _noise_thresh_5only[3]={
  704. .5,.5,.5
  705. };
  706. /* 32kHz only */
  707. static int _noise_start_short_32[12]={
  708. // 40,40,20,20,40,80,9999,9999,9999,9999,9999,9999
  709. 48,48,24,24,40,80,9999,9999,9999,9999,9999,9999
  710. };
  711. static int _noise_start_long_32[12]={
  712. // 320,320,160,160,320,640,9999,9999,9999,9999,9999,9999
  713. 320,320,160,160,320,640,9999,9999,9999,9999,9999,9999
  714. };