[xiph-commits] r12028 - in branches/vorbis-aotuv: . debian doc doc/vorbisfile doc/xml lib lib/modes

j at svn.xiph.org j at svn.xiph.org
Sun Nov 5 07:06:28 PST 2006


Author: j
Date: 2006-11-05 07:05:50 -0800 (Sun, 05 Nov 2006)
New Revision: 12028

Added:
   branches/vorbis-aotuv/debian/watch
   branches/vorbis-aotuv/doc/draft-ietf-avt-vorbis-rtp-00.txt
   branches/vorbis-aotuv/doc/draft-ietf-avt-vorbis-rtp-00.xml
   branches/vorbis-aotuv/doc/draft-kerr-avt-vorbis-rtp-04.xml
Modified:
   branches/vorbis-aotuv/
   branches/vorbis-aotuv/CHANGES
   branches/vorbis-aotuv/autogen.sh
   branches/vorbis-aotuv/configure.in
   branches/vorbis-aotuv/doc/
   branches/vorbis-aotuv/doc/Makefile.am
   branches/vorbis-aotuv/doc/index.html
   branches/vorbis-aotuv/doc/lspmap.png
   branches/vorbis-aotuv/doc/vorbisfile/ov_open_callbacks.html
   branches/vorbis-aotuv/doc/vorbisfile/ov_pcm_total.html
   branches/vorbis-aotuv/doc/vorbisfile/ov_raw_total.html
   branches/vorbis-aotuv/doc/vorbisfile/ov_read_float.html
   branches/vorbis-aotuv/doc/vorbisfile/ov_test_callbacks.html
   branches/vorbis-aotuv/doc/vorbisfile/ov_time_total.html
   branches/vorbis-aotuv/doc/vorbisfile/reference.html
   branches/vorbis-aotuv/doc/xml/06-floor0.xml
   branches/vorbis-aotuv/lib/block.c
   branches/vorbis-aotuv/lib/codec_internal.h
   branches/vorbis-aotuv/lib/envelope.c
   branches/vorbis-aotuv/lib/info.c
   branches/vorbis-aotuv/lib/mapping0.c
   branches/vorbis-aotuv/lib/masking.h
   branches/vorbis-aotuv/lib/modes/psych_11.h
   branches/vorbis-aotuv/lib/modes/psych_16.h
   branches/vorbis-aotuv/lib/modes/psych_44.h
   branches/vorbis-aotuv/lib/modes/psych_8.h
   branches/vorbis-aotuv/lib/modes/residue_16.h
   branches/vorbis-aotuv/lib/modes/residue_44.h
   branches/vorbis-aotuv/lib/modes/residue_44u.h
   branches/vorbis-aotuv/lib/modes/residue_8.h
   branches/vorbis-aotuv/lib/modes/setup_11.h
   branches/vorbis-aotuv/lib/modes/setup_16.h
   branches/vorbis-aotuv/lib/modes/setup_22.h
   branches/vorbis-aotuv/lib/modes/setup_32.h
   branches/vorbis-aotuv/lib/modes/setup_44.h
   branches/vorbis-aotuv/lib/modes/setup_44u.h
   branches/vorbis-aotuv/lib/modes/setup_8.h
   branches/vorbis-aotuv/lib/modes/setup_X.h
   branches/vorbis-aotuv/lib/psy.c
   branches/vorbis-aotuv/lib/psy.h
   branches/vorbis-aotuv/lib/vorbisenc.c
Log:
merge changes from /tags/vorbis/libvorbis-1.1.1/


Property changes on: branches/vorbis-aotuv
___________________________________________________________________
Name: svn:ignore
   - aclocal.m4
autom4te.cache
configure
config.guess
config.h
config.h.in
config.log
config.status
config.sub
depcomp
install-sh
libtool
libvorbis.spec
ltmain.sh
missing
Makefile
Makefile.in
stamp-h1
*.pc

   + aclocal.m4
autom4te.cache
configure
config.guess
config.h
config.h.in
config.log
config.status
config.sub
depcomp
install-sh
libtool
libvorbis.spec
ltmain.sh
missing
Makefile
Makefile.in
stamp-h1
*.pc

libvorbis-*.tar.gz
libvorbis-*.zip


Modified: branches/vorbis-aotuv/CHANGES
===================================================================
--- branches/vorbis-aotuv/CHANGES	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/CHANGES	2006-11-05 15:05:50 UTC (rev 12028)
@@ -1,3 +1,10 @@
+libvorbis 1.1.1 (2005-06-27) -- "Xiph.Org libVorbis I 20050304"
+
+ * bug fix to the bitrate management encoder interface
+ * bug fix to properly set packetno field in the encoder
+ * new draft RTP encapsulation spec
+ * library API documentation improvements
+
 libvorbis 1.1.0 (2004-09-22) -- "Xiph.Org libVorbis I 20040629"
 
  * merges tuning improvements from Aoyumi's aoTuV with fixups

Modified: branches/vorbis-aotuv/autogen.sh
===================================================================
--- branches/vorbis-aotuv/autogen.sh	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/autogen.sh	2006-11-05 15:05:50 UTC (rev 12028)
@@ -32,7 +32,7 @@
 
 echo -n "checking for libtool... "
 for LIBTOOLIZE in libtoolize glibtoolize nope; do
-  (which $LIBTOOLIZE) > /dev/null 2>&1 && break
+  (type $LIBTOOLIZE) > /dev/null 2>&1 && break
 done
 if test x$LIBTOOLIZE = xnope; then
   echo "nope."
@@ -72,4 +72,4 @@
 autoconf || exit 1
 
 cd $olddir
-$srcdir/configure "$@" && echo
+$srcdir/configure --enable-maintainer-mode "$@" && echo


Property changes on: branches/vorbis-aotuv/autogen.sh
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: branches/vorbis-aotuv/configure.in
===================================================================
--- branches/vorbis-aotuv/configure.in	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/configure.in	2006-11-05 15:05:50 UTC (rev 12028)
@@ -11,7 +11,7 @@
 
 AM_CONFIG_HEADER([config.h])
 
-AM_INIT_AUTOMAKE(libvorbis,1.1.0)
+AM_INIT_AUTOMAKE(libvorbis,1.1.1)
 AM_MAINTAINER_MODE
 
 dnl Library versioning
@@ -23,7 +23,7 @@
 VF_LIB_REVISION=0
 VF_LIB_AGE=1
 VE_LIB_CURRENT=2
-VE_LIB_REVISION=0
+VE_LIB_REVISION=1
 VE_LIB_AGE=0
 AC_SUBST(V_LIB_CURRENT)
 AC_SUBST(V_LIB_REVISION)


Property changes on: branches/vorbis-aotuv/configure.in
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: branches/vorbis-aotuv/debian/watch (from rev 12024, tags/vorbis/libvorbis-1.1.1/debian/watch)


Property changes on: branches/vorbis-aotuv/doc
___________________________________________________________________
Name: svn:ignore
   + Makefile.in
Makefile
Vorbis_I_spec.fo
Vorbis_I_spec.html
Vorbis_I_spec.pdf
build


Modified: branches/vorbis-aotuv/doc/Makefile.am
===================================================================
--- branches/vorbis-aotuv/doc/Makefile.am	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/Makefile.am	2006-11-05 15:05:50 UTC (rev 12028)
@@ -112,10 +112,15 @@
 Vorbis_I_spec.fo: $(BUILDDIR)/Vorbis_I_spec.xml
 	cd build; xsltproc --xinclude --output $@ spec-fo.xsl Vorbis_I_spec.xml && mv $@ ..
 
+# we add the two newlines to pdfxmltex because on a number of Fedora systems
+# tex prompts for input complaining about something;
+# and surprisingly there's no way to tell tex to ignore that
+# also, --interaction doesn't seem to actually do anything different
+# if you change it
 Vorbis_I_spec.pdf: Vorbis_I_spec.fo $(SPEC_PNG_BUILD) $(SPEC_PDF_BUILD)
 	cp $< build/spec.fo # work around a passivetex bug
-	cd build; pdfxmltex --interaction nonstopmode spec.fo
-	cd build; pdfxmltex --interaction nonstopmode spec.fo
+	cd build; echo -e -n "\n\n" | pdfxmltex --interaction nonstopmode spec.fo
+	cd build; echo -e -n "\n\n" | pdfxmltex --interaction nonstopmode spec.fo
 	rm build/spec.fo
 	mv build/spec.pdf $@
 else

Copied: branches/vorbis-aotuv/doc/draft-ietf-avt-vorbis-rtp-00.txt (from rev 12024, tags/vorbis/libvorbis-1.1.1/doc/draft-ietf-avt-vorbis-rtp-00.txt)

Copied: branches/vorbis-aotuv/doc/draft-ietf-avt-vorbis-rtp-00.xml (from rev 12024, tags/vorbis/libvorbis-1.1.1/doc/draft-ietf-avt-vorbis-rtp-00.xml)

Copied: branches/vorbis-aotuv/doc/draft-kerr-avt-vorbis-rtp-04.xml (from rev 12024, tags/vorbis/libvorbis-1.1.1/doc/draft-kerr-avt-vorbis-rtp-04.xml)

Modified: branches/vorbis-aotuv/doc/index.html
===================================================================
--- branches/vorbis-aotuv/doc/index.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/index.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -23,7 +23,7 @@
       [<a href="Vorbis_I_spec.html">html</a>]
       [<a href="Vorbis_I_spec.pdf">pdf</a>]
 <li><a href="v-comment.html">Vorbis comment header specification</a>
-<li><a href="draft-kerr-avt-vorbis-rtp-02.txt">Embedding Vorbis encoded 
+<li><a href="draft-kerr-avt-vorbis-rtp-03.txt">Embedding Vorbis encoded 
 audio in an RTP payload format</a>
 </ul>
 

Modified: branches/vorbis-aotuv/doc/lspmap.png
===================================================================
--- branches/vorbis-aotuv/doc/lspmap.png	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/lspmap.png	2006-11-05 15:05:50 UTC (rev 12028)
@@ -1,25 +1,14 @@
 ‰PNG
 
-   
IHDR  $   «   aTwf   KPLTEÿÿÿÿÿÿãã㎎Ž   ªªªÇÇÇUUUrrr999%%%nnn–––***			fff´´´444¬¬¬...º„~|   tRNS @æØf   bKGD ˆH   	pHYs    ÒÝ~ü   tIMEÒ
:¡*W=  _IDATxÚíé¶ì¨
Fói@‚NIº;yÿ'Í°g×pªÎ ­u¾u<È°-@€øBBNä‘!IH@„$!IH@„„$!IH@„$!IH@„„$!ÉW—¢IÈ‘p‚–€$äH€|AHhç]ö¶Ï&M'w=ºÀpý2ÎLç÷ïµèŽõiÚœ¥‹£Õ[$?ɝ¤Ûé
yúdHXÖù—l„|üUw2š²€[üv©TÚÔ¡¾N“ˆH»±u7ÝÑFÇ“gÇ*ÏÑæ4…¶&G®¿çyá:íç% 2¢¼‘Þ’§O·$LyJ6¯O·^Š«ò¨¤ùo3òöò¤¥ §UꬪÆU«sm2…—ÇTä9Úœ¥P­ù™\U©ýî³'Ó¾ö `_§[yú9 ±´(-1Þ}º—-_Èw¾á	nõªeªãƒÉæ7´¡ñÞJ ZfvÇÆòmÎÒ1ŒZFÒ"/UB·´€$5ÿ—éVž¾—L ™ì*¤rS¤€Í‰-p߇¤VSëßÚ}“¸ή /”œRŠœhY¥ÕÔ|7ÛÖfQ™ô™i€µ3is–HqHThÒZEDŽ´ç ’–éø1š¥düjH2QÉ@QpF*™KR©ß‚9 Xk÷:I«¤E¡¤ÂUïQÀ
$D.ký@óÞ ©¬R Z[°Ö›.µYCRÒü˜l:ãAmÎÒÑ’f) T²S¯õZç¹öƒ9Z¦ãŸTˆìՍJ‚%¨4MTȧêƒdȼú¶*<‚4‹¯!i÷˜Q¨L93VPGäT[”fÚ¬²¹³gõØæõç#Ú\†€
-È¥èLëU5#$È9¿§M"
-ûIm£·a¡ýöKD–
“_ïÛøÒ; ¡RKºÝt¡‰t  }æÖFœ
-â1mnÙ SÊB½ÖsHVÚŸCBÂoƒD­·$*]C”‹õ/¶WÝôeÑýfã·K™v¿]ãzî2j›–™ºÒfù-:-Ž­/†µ9K—wÏ ŠõyxbI´¶AViI)ôH„zH`…Zû
äi¨wè ºßpÞ˜m÷ÊÚÀçá&lµl–i«m¦›.µYd³ÓÔÁŽ‡3Õæ,[’¡eÖ£EÛÔ¾u¾5¯Ò)O
å-mv¨0™Ð	Šµ¼‚^hÆÀºº!§Öص$Ã}…‘$ƒE©/6 T(Tk‡eÚú6ãM7´é²Ù²™åúÃqwÆÃÚœ¥
öÚJÒ>µQëõ÷Ôko€3àiŽµmB}1$j¬ ‹S16S$7&6' ìµ×}Ò‹˜¨V^¥þÖÚ)NÅÀÂ`Éd%¹1ù`‡ÊP,dÊÕ2OkmSː·µI]ÝÖLœÙtÜŸñ¨6§)›+ÀbÕ©ªYçZffCûšwÎõÒeZó4YB2KŸh€/ñbÐáé’îm…}.m>…öo‚¤d y/½Ït~.m>‰öo‚¤äø¨&õ}–ósióY´$!?R’€$$ 		HB’€$$ 		HBB’€$$ 		HB’€$$ 		HBB’€$äGC’ôpJè<Ðæ‰wO(M¯¤€äM¢Â
-À©˜íÆ)ÕÂÚ:Qï_ï&Ë+I7ž _"œâw… Ø@i7˜Õ`hvÍBîý²aIÖOb$oƒd\uº)]€¡€dW«…Á	H^+¤Ãò(­+¥³¦vÈl4¥)Sá>R½†jŒuv€\-Ãɼ[UiÄ%‘F‹v”¼Pé‹šL=Õ¦®ZCi}z@òæ&ª)¾iI4\hHÉ„ÍûH7õ‡
-#	,Æf³ø€)…gEjÑŽ’	Ãeª¶²‚^P dÀ.ÉÛmH™BY- É
- at xLU ¬!`Éê•-ö‹ò²ú®î¢a
-Óa µ˜`!¤¬ê5&T@òFFÊ,àÏ
-’!ÖϐîC¢ q!Y}é!é¢õm–<H ñÖøéÛ$ªÓªá€äURínƒ¤04‡Ä´·$–÷ é¢ÍC	Ñ!JÁ,ÜÊp“éô€äUí‘!ØÕ$¹ÅR 0ÔAR£PuÐÌUÒCÒE;ªY³$€ÉpfRxÕÍ{ÅEDä ¬B Ò§@`hº&'˜P*F£Ù™…ê!£QP	‚–zf1 N’‰œ’·Š-k›Á*´ÀK€fõKÌ˜ºpH£ãD9©Ua7O5@Oæ&™%rc°1ÕhG¤â:Cäj5Kj¬ê	Zj3e
I‹mà±Ì~4$²h¶Þ°gÀ¹Èî8ÓJ@òjH.G¢EÌÐíâmrPôCìQڐâäÉk!y©Oø#¹LÉ·…$$ 		HB’€$ 	H’€$ 	H’€$ 		HB’€$ä{BÒ/g¢$[eÝoî-I@òtK¢Q8Ñ&Ù‘…óù!¹²r)äZœ3 v$3-…€”g$7[gM–¡>-Īó K”ÍW€äÂ
-HL³ëÎ.Ž$†CÊE©84ËüÃu•L(Fuûízǵ͗©n.¬€¬§J«)êùu¿æî߸+sûãx<œ<N*&F¾&$;+ 7šBÂEDœ¢d¾$ëe«ºy’ß/Ézdú ê&±°$_’õ
-H}¬ºI¢pá6	¢Mò¥ºÀ+ “lwÁæ”Ì“š¥4üsãÙáR¨ÿ·Dn#OïÝh:
-ŠHz¿ÝÒR⹁#õã,Éž¡¨òë.yÃOr×ã¬hÈ“ðþÊ\Wعãn3Ô"®„Ñ»C‰´q"ñÝßÍZË´ŠB)_
’-ë}j*Ñn—Œ
³óÌÜ~÷›¾Ñ{”Ø<ñ~ãª{Z}$ý
-ȏ\Á-""ü,H†ÛRô ÿË$¤Ä“!Á+!éyYâó!±G qr‚T\©f
-sý½¥ì*I€MþÁ”©pØè¢Ç¡©Å™Èz\·*a¦¥(ÚhHÓIlÓ
-ãÙ€Y¡Ò‡ûRW«Z&VuHÙ_ɇʣP®}èÅGl\c$µ4•ÌÅeže5cب‚ÃP‹dÃ×}à`¼C	XQØ8Ru‚(X{ËÖ
hgh)‰òdþH€\µÔú]Ù`x5/ª1ÔhH»ž÷2Dpب‚­P‹þõçª
-اä%Ì ˆÏFC êiYýW[o;†ìÞ…š7ÈpW͐LŒ,ÊgÈê!=€¤lTÙµü-¯Û	…/ArM	ƒ[O£!Edæa"vàšÌM
vÜÆU$µÆOT7Àdo/”js@Ô€ÃÇyÞ› s$ýh„ç öh§lßÀu)T¡âG–ï‡AÂS“zié€ÐÖ?g
-©c¡lT6B-nU7@)ת›+JTHæ£!Åî$Ih„„¦¬J©šUѝ+åŒ:Kð‡CR¦Ì^¶s?¦ e ù¢§Û6ªP:µØCâ;ý½{”°æ7GCÚ-¼ïºt¨0™ÐxÓá]rí3‰Ö“IY¼>èÛCBG.k•<ÏknQàÆ)›ií&rï
-2¦°Q‘ËQ¨EÛ4©!íL¦»C	¹2Õ`ÔVÔŒ‰Ø<%›ü²³,NÅ`Ù¹»³W-ÝTÕ ù	]à-÷t²nx}R÷ûOµÖ+n«”ëÏúî–d«,¦ì‹Ê²^N}kñ,Ô" “Íx‹OT¢*r\r˜°q[²=(ÿdHHä]sQìí³¥š›ö®,’Í‘ô]Ó=:Ò͐¸d\Ñ`W!ÔÉ*ò¶"zߣŸð]>‰ªo4È6?2¢¼÷™•Î@j×® l·B’‰ÊèŠN%sI*@ay?$]ù3Ëÿû,HH6Gš7-IÖY쨡4BB|;$Z}ϝ+*TûCIýG^)ÿ™A29Û^«Å­ò¿gArà y’ƒó÷ Ùl‘_h“ˆÎ\Ñ*Eßmó7 ùÕMrQï‡Xû¡ƒ3 ìx§Í òB¹âñHzW´Š
-}H¾Huó¼6IÛF³Û@ݵ°ë³¥…kqñ¶yÃ1$å$3W4T`Õù¾9Ôþ•×‚<Él?ľd¹-§àKLSæO Yïw³„„}rEw®à–[ !}â²ô?Év®ÿ.œÝz™tàú¸¿7ùHæC˜{®½!IÍk´q+^íœÕ¿„+ÍÍÃNIÍG~Ë÷¬+Áv»a¼;;ĝøˆ©g+¯&nBL©ö2÷µ9êXÎH*6Þ ™U7šž¶†„­Dl at BëI®—[é†x™ú1ã³öý>vÿÙ¬
¸v¸ŠŽ½Ì]mŽ:–³éܵÚÿê¦ßq·º!Iy°ºiõ
Ý	òåÈ&Jû=ߟõ{Él=ÇÖÒÅn+Û=m;–i¹1%\?¢á:Ûq¯dá3ìúÕ{·CÒö¦{ !¹iË*³«Ý°)ûìÈGœòÜ„–Õbyѱ—)
-«)Æ”\-¯:–ì*T§QSÎJó	Щ<¹lL‹ý6è½A‰ö3Ÿ–Ð°Œ¯Ï{5Ûðû·ÆùHÚ4¡Ëe›®vÃΞºoÀŽ|ÄæóÖi^ÕZsKB…@]Êb\–ÍÁúˆ:ºÍU˜M€^¿Õ§à»ÙŠ'Ÿu„åãpø˜vîŸÿýç‰É;±_'ùˆW×i«¶FoË’ºûqÓqîÑÚ<·iÔf«	Ðëúôæªó~î¾ÉEf×»$ƒ±ÿKä¯ ¡Ãá×#ñú­•4úm琌n¡~·õmHÚ4j³ÕèO
-ɇ:{Ö”\m–Œ
€Ç,É1#‡>âõìvHVK3`˜F=,Z|‘t±våq+èÈGœy«;{PÝ´>äVµìXšÃ4j³ºæ¦› ½~è÷€ä—þúÛóë@3Ëô8$gÊøˆÙ:kľè±n5\ÈiLëŸûŽåømµe¤ÅèyÓþ·_ÿùË·€ä÷_þø׿Ÿ<v§“gÙ»Ùè†=ô qé![O:¬]à6š@™Y–’›§yÇÃôêT&£ùè¹ÛMþý¯?~ùý;@ò2¹Û™v¯$¾`‡žûzùÆ‹’§tò3'¿Šélt }slË€äýòâ é·OHB’€$$ 		HB’€$$ 			HB’€$äËC»$'¢%65
-HNÑØùêÛCrϾÑs	H¾?$×öH~tusmßè¡nÙ˜
ü,H–ûFË0½/
›+t[¾$?’å¾Ñ}8™M³ü<H–ûF€Tƒ»ÊªºLJ@ò³ Yî-@’4Fuóƒ»ÀûûFKý'8Z|K²!c ››%ɉ%	ù‰LûF×6I’$»Í£.pH@ ÂsgZH@„$!IH@„$!IH@„$!IH@„$!ßIþýå°
-;?ë    IEND®B`‚
\ No newline at end of file
+   
IHDR  $   «   aTwf   HPLTEÿÿÿãã㎎Ž   ªªªÇÇÇUUUrrr999%%%nnn–––***			fff´´´444¬¬¬...Ƭd”   bKGD ˆH   	pHYs    ÒÝ~ü   tIMEÔ"9Ø	æ«  øIDATxÚí]Ù’Ä(LH0»síÌìþÿŸî`ã³Î®êCÑAu•
2¤ €@ @ @ @ @ ß.E£gà-Q
3 ù¢rG§×¿¦¹^(¿ß¿Nç+ÓåüG)†Ïú4i.¥;µ±”5ùaáI÷ÓeôrŠ°lë/ÙDvšŸH*š²€[}wU«´Ô¡¾M“ˆHË؆L¤ÑéâÅg•çHs1…Ö!‡:4€,"¼•òÛˆòNº®M}ý f‡$s’-ûÓ½Gãú¨¤åwæÕLK@N›ÔYU«T—¥Éî2¦"Ï‘æR
+UÑé~’«ê‚éPdØ·é¦69}*’XZµÀÌú³ÏyÙš$~@ÿ^‚[½kêT0Ù2ÓYšòVЪtøl,Ï‘æRÚë@…êÿ¶®²D3Ci!E’Zóët§63½œ$.™ 25ØUHä¦H ›[à~L’ÚMm¿kù&qœ]A^(w:¥ÜŸ›hÙ¤U €‘Ù¾4«Îd¬R3 ¬ƒj|HšKi'	‰
+DŠÓ µŠH×·+¹9€¤u:½†f)Uêþj’d¢’¢àŒT2—¤Rßs °Öá¡’V¤U£¤Â;
Uó…(à"‡5;Ð|Th*›¨:¬5Óµ4[’”´üL6_ñ 4—ÒI›ªd' ¤YÊ(õ®ÂªLtN?©PëUÞÐݨ$X‚J“G…|î>HzåÕÿÙ*xIÒ,¾%IËW`D¡2?æÔA‘$§:¢4Û‘fSgƒ>«ŸmÙ>"ÍÕ$A.Ýi¦Â£Ô÷“9ç“1‡IDbŸIRŸ°ÉÂBg²Í„Ȳ£òk¾_zI¨Ô–n™®¤1‘Á Çλ
óææxLš«IbJ¹Ë™m”zª¡µÜ—IB“ô.’¨šDeˆr±Q¶£îfl‹á;›Þ]Êtøî×k×iïmZ•êFšõ9Z˜NskØ3¤¹”ö<<èrÖqQ±šDëd“$)…ÞI$¡‘$°BmüòÔû:én¦ç\f[¾¢@Ù*øÜ3a«m³N[o3gº–fUÙN³;îW<*Í¥tñê÷:È:H}L’ZƒëtÎÉ:ïHèõ$a‡
+“	M$A±VW0À-8°ínÈ©
vmA’ž¯0’d°(Í€Š…jï°N›m3eº#ÍPÙ–Í,×Ç蟇+–æRÚH’¤¾bìó¸È“Äp<mÓ©ŸMhL;hˆƒ+ÈâTŒÍɍ‰Í	 ;Íix¥W˜¨VêT¿kã§b`a°d²’ܘ¼ë¡Ò›…L¹ºC–iímjò¾4ièÛšŠ3›?W<*ÍŔ̀feXLuQ‡Cl3 ÎÕ™ºNkm&KHf	G
ñ.$¾nÒáI%Üt㧒浭âŸKžaž€ü£K¸iZòSIóR:Öβ}x	7ÕÔ§’æµ$A @ @ @ @ @à½Hzºªsi÷»ׄ¦+ïŒE§ï‚
++ §bv¸‰~
+0TkïB-v¯²¾“t§pŠo$	 °Òa¤…)ÀÐâžÌž¨I¶%´ØF÷‘dÚuº·%	žL’C©V
+'HòZªÍ¡9kj™æ4e*<†Cª÷P‘¢Î«e˜!™{B¸$òÂhÑŽ’*cS“©§ºÁÔUkˆ"­¥IÞ<Dµ""Åw5‰f€õ”LØ|ŒtSïq¨0’ÔíÚb\`¶ˆ˜rQxV$¡í(™0\æn++XáÅ Jà$y»É""s(«I²žR [’ °‚dõÎByÝýô»‡hG˜Ã4AHõJ!eU¯1¡‚$oäHY„ýِ¤‡ýèé1IT $ÎIÊ2æÃH’!ÚÑ8vaÉS€oƒŸqL¢:ï’¼
+Uà6’†–$15‰å#’ÑŽ–¡„‹h‡R°·Ò3™/’¼j<Òƒ]‘$·XB=UÆ CIžÝ
-\%#I†hGµ#kš0éW& ÕˆgÑݼ.""'&°
+Ê˜c€¡ùžœ`B©MjgŠj$É툆€J€´Ô+‹p’Lä$y+lÝÛt­Ð/šÕk,uB2cÂ!MŽå¤RT…Ý<Õ0A>«›d–ȍÁÆT£‘Šë†(»AÍ’«z‚–:LÙ’¤Ç6ÂI/ð1Õ°õµm¯/ëôJ‹“l^N’«£Ñ*fè~ó6œ4}=JÇù)<òµ$y©Oø3¹ÓÁß—$ I H’A’@$$	IA’@$$	Ißãv&JA’À^[‡{K$ðtMË 'PIQ_@\±r
ò-Î ;’™–B@Ê‹É
Ä–ÀY“e¨Ï±ê:èXü÷%HrÅHÌ«ëÎ.Ž$†CÊE©84ËòǾB]%ŠQ=†»æX¢·ù2¸bdU8­§¨××󚇿éTæöãô¹_<-*&Ž|M’ì€ÜN<J."â±>ô’d»²ìu7“¤„ñûeI²Ý™>¨»IED,4É$Év¤>ÖÝ$Q¸ðΘ1&ùR&ðÉÈ$û&°1Øœ’yR³”úŸ/~„K¡Òÿ·Dn/žnÝh:ŠHz¿ÞÒ⹁#_ûÆ
û?pß%ïøIî*Ί&€<	ïÌu…]vÜí†ZÄ5aôî"í\H|÷{³•2m¢PÊW#ÉžÇõ>’ê*Ñ¡IƆEeeî?ûMïè=Bì^x¿rÕ#©>‚$ãȏÜÁ-""ü,’ôû(zRÿåI>Hˆ'“¯$ÉÈ—U#>Ÿ$öÈC¸÷š Wª•Â\¿o)»J`³0e*Ü6ºèy¨Ejq&²ž7Ç­B˜i)Š6ÒdÛ¼Ãx1¡AÖÂc¨Œá¾ÔÕª”‰UÝ Rö—‘äCñ(I(Wzõ×I-M%sqYVY
äØ6ªà4Ô"Y»OŒw+
+›fCªLë¨Ù†	¢à-%QžÕ	«”Zßkb {˜^-Û‡j5êé`y¯C·€*صø×ßmº€c–Ü#„ ñÅlD=­»Ÿ~·Õø¶SÈ®þ,„Ô¼¡@΀»j– ÉÌ‘Uûôªîé	IZÀF•P‹À?òÏvœPø*’\'„MÁ­çÙÈÊ"Yx˜ˆ]:¹fuSƒ·yImðÝ
0ëÛ+Úu8 +’Ô€ý弆$|´ æ!:IÆÙ/‰8’DaÇ®K¡ú
?Ó|?Œ$<©×š^õ´þœµ7ÒÀ…°QØ	µ¸×Ý ¥\×Ý\#D%Ér6²:Ý` IšHBsU¥TÕªh‹Î•rF]%øÃIRæÊ^s?¥ e ùÊÒmU(†ZIâöÞ=BXó›L³!-M—$*L&4eÚŸ%W›I´†œLÊâµ oO:sY«äe]s‹º˜ 7f §l¦ÕLäÑdL-`£"—³P‹ ¶yQC:XLw‡ seªÁ¨­¨±yJ6ûeYœŠÁ²ó³W)ÝTÕ ù	&ðž{:Ù0=Èç>©'x›¤ÖkÜV‰ëËúîšd¯-æ›Ê²^»œúR¬ÅK¡˜ìÆ[|¢U“à’}ÁÆIlÉVPþÉ$!‘w­E±·¯–jnÚ»ªü±’wgÒN-L÷ÈH7“Ä%SwEƒ]…TP¨¼íxcÑOx/{tõÙîKCF”^³2(HÆ”íV’d¢2¹¢SÉ\’
+ÐfXÞO’ÁDþÌøïŸE’Ý™æ]M’ua€
”&’ßN­¾çÁ
ªvFo©ÿÈ+ñŸIfgÛk¥¸ÿ{In˜ OrrýIvGäWŒID®h•¢ïÖù;$ùÝMrQ]ž‡XíÐ…Á ¼Óf y¡\éñ’Œ®hú,$ù"ÝÍóÆ$íÍá<D õÔÂÁfK+×âIÄÛá
ç$)Wdኆ
+¬z#ß·†Ú¿ò^ÇI²8qlYnÛ)ø*’ÌKæ/d{ÞÍš$ì³+ºç\‰[n!	é·¥øIö
¸ñ;ºâêfeÒ‰ëã~kò)$YNa¹ön$Ij^£¬xsrÖøj¬4W4÷“’šü–÷Ywv‚šaWxwwÁGL#·òfá&Ä”ª•y,Í™a¹`R±ey/ É¢»Ñ|RÚ–$lu"b‡$´]äzõC¤âdçŒ/°ï/øÜýg‹1àÖá*:Y™‡Òœ–‹åܵÛÿîf<ñ°»!™˜ò`wÓúºë!òÕ‘M”ú³=ƒ$~¼ê÷”$‹ý{[‡£l¤95,Óú`J¸~ÄÀuqâQËÂè+ìÆÝ{·“¤L÷<ÉMGV™]k†]@9Ö`g>â”—*´l6Ë‹NV¦(@®¦˜Rrµ¼1,ÙU¨.£¦œ•– Sy²	lL«ó6é½ÃW>­IB}ßX÷j¶ã÷o'Œó=Á7ÍÞ”t­v©Ôcvæ#6_ŽNó¦×Zj*Rã²Ö"ê2ê¶Va± zûTŸbFáf-ž|aËÊá´˜ví_ÿüóוwA\xæ#Þܧ­Ûš¼-K’Ôӏó”Nk¶ê¹-£6Û,€ÞÖÐç É8a®zeÝÏÓÝ7=„]o’teÿ·Èߐ„N§_Ï|ÄÛÚ(iòÛ.I2¹…ÆÓÖ÷IÒ–Q›m@R’¼ÖÙc×K¦Àcšäœ#§>âmv;I6†¥ЗQO§«IV#¾ž#éJ3쌔磠3qæ=sö¤»i6dO«†Z–f at _FmV÷Ü ·…~’üò¯ÿúü>ÐÌ2=N’KŸøˆÙmľ²X÷®ä4¥õçÑ°œž¢-£¶Œ´Z ½Úÿúïýò-HòÛ/¿ÿñç“ŸDgÏÚºÙ1Ã*èÄG\F’ˆmV¸­…&PfV ¥äæiiX¢/¯nAeR1Z.€^ºÝäÏ?~ÿå7>Ð{‰¯ÐCÏ}¼Íü3ì!=s¡ñ«C1]Z]@GlË/ˆHŠ@ @ @ ðÐ‡.pDãä«o{΍^"HòýIrݹÑA’ë΍î}ËÎj¨ ÉÏ"ÉúÜhéËûR?\a8ò5Hò3I²>7z'³«V‚$?$ës£@ªÁ]eÓÝt•$ùY$YŸ-@’Ô?FwóƒMàãs£¥þ	ÎöI~$¦ 6W„Ø<X$¹ I?³êçF×1I’$	7ÎLà@  „—δ@ @ @ @ ÀwÂÿ5ow•÷Z®=    IEND®B`‚
\ No newline at end of file

Modified: branches/vorbis-aotuv/doc/vorbisfile/ov_open_callbacks.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/ov_open_callbacks.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/ov_open_callbacks.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -23,14 +23,14 @@
 struct should be passed to all the libvorbisfile functions.
 <p>
 It is often useful to call <tt>ov_open_callbacks()</tt>
-simply to determine whether a given file is a vorbis bitstream. If the
+simply to determine whether a given stream is a vorbis bitstream. If the
 <tt>ov_open_callbacks()</tt>
-call fails, then the file is not recognizable as such. When you use <tt>ov_open_callbacks()
+call fails, then the data is not recognizable as such. When you use <tt>ov_open_callbacks()
 </tt>for
-this, you should <tt>fclose()</tt> the file pointer if, and only if, the
+this, you should close or otherwise deallocate your <tt>datasource</tt> if, and only if, the
 <tt>ov_open_callbacks()</tt>
 call fails. If it succeeds, you must call <a href=ov_clear.html>ov_clear()</a> to clear
-the decoder's buffers and close the file for you.<p>
+the decoder's buffers and call your close callback.<p>
 
 See also <a href="callbacks.html">Callbacks and Non-stdio I/O</a> for information on designing and specifying the required callback functions.<p>
 
@@ -47,24 +47,22 @@
 
 <h3>Parameters</h3>
 <dl>
-<dt><i>f</i></dt>
-<dd>File pointer to an already opened file
-or pipe (it need not be seekable--though this obviously restricts what
-can be done with the bitstream).</dd>
+<dt><i>datasource</i></dt>
+<dd>Pointer to a data structure allocated by the calling application, containing any state needed by the callbacks provided.</dd>
 <dt><i>vf</i></dt>
 <dd>A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile
 functions. Once this has been called, the same <tt>OggVorbis_File</tt>
 struct should be passed to all the libvorbisfile functions.</dd>
 <dt><i>initial</i></dt>
 <dd>Typically set to NULL.  This parameter is useful if some data has already been
-read from the file and the stream is not seekable. It is used in conjunction with <tt>ibytes</tt>.  In this case, <tt>initial</tt>
+read from the stream and the stream is not seekable. It is used in conjunction with <tt>ibytes</tt>.  In this case, <tt>initial</tt>
 should be a pointer to a buffer containing the data read.</dd>
 <dt><i>ibytes</i></dt>
 <dd>Typically set to 0.  This parameter is useful if some data has already been
-read from the file and the stream is not seekable. In this case, <tt>ibytes</tt>
+read from the stream and the stream is not seekable. In this case, <tt>ibytes</tt>
 should contain the length (in bytes) of the buffer.  Used together with <tt>initial</tt>.</dd>
 <dt><i>callbacks</i></dt>
-<dd>Pointer to a completed <a href="ov_callbacks.html">ov_callbacks</a> struct which indicates desired custom file manipulation routines.</dd>
+<dd>A completed <a href="ov_callbacks.html">ov_callbacks</a> struct which indicates desired custom file manipulation routines.</dd>
 </dl>
 
 

Modified: branches/vorbis-aotuv/doc/vorbisfile/ov_pcm_total.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/ov_pcm_total.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/ov_pcm_total.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -45,7 +45,7 @@
 <li>OV_EINVAL means that the argument was invalid.  In this case, the requested bitstream did not exist or the bitstream is unseekable.</li>
 <li>
 total length in pcm samples of content if i=-1.</li>
-<li>length in pcm samples of logical bitstream if i=1 to n.</li>
+<li>length in pcm samples of logical bitstream if i=0 to n.</li>
 </blockquote>
 <p>
 

Modified: branches/vorbis-aotuv/doc/vorbisfile/ov_raw_total.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/ov_raw_total.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/ov_raw_total.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -45,7 +45,7 @@
 <li>OV_EINVAL means that the argument was invalid.  In this case, the requested bitstream did not exist or the bitstream is nonseekable</li>
 <li><tt>n</tt>
 total length in compressed bytes of content if i=-1.</li>
-<li><tt>n</tt> length in compressed bytes of logical bitstream if i=1 to n.</li>
+<li><tt>n</tt> length in compressed bytes of logical bitstream if i=0 to n.</li>
 </blockquote>
 <p>
 

Modified: branches/vorbis-aotuv/doc/vorbisfile/ov_read_float.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/ov_read_float.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/ov_read_float.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -46,7 +46,6 @@
 <dt><i>samples</i></dt>
 <dd>Maximum number of decoded samples to produce.</dd>
 <dt><i>bitstream</i></dt>
-<dt><i>bitstream</i></dt>
 <dd>A pointer to the number of the current logical bitstream.</dd>
 </dl>
 

Modified: branches/vorbis-aotuv/doc/vorbisfile/ov_test_callbacks.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/ov_test_callbacks.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/ov_test_callbacks.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -52,7 +52,7 @@
 read from the file and the stream is not seekable. In this case, <tt>ibytes</tt>
 should contain the length (in bytes) of the buffer.  Used together with <tt>initial</tt>.</dd>
 <dt><i>callbacks</i></dt>
-<dd>Pointer to a completed <a href="ov_callbacks.html">ov_callbacks</a> struct which indicates desired custom file manipulation routines.</dd>
+<dd>A completed <a href="ov_callbacks.html">ov_callbacks</a> struct which indicates desired custom file manipulation routines.</dd>
 </dl>
 
 

Modified: branches/vorbis-aotuv/doc/vorbisfile/ov_time_total.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/ov_time_total.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/ov_time_total.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -46,7 +46,7 @@
 <blockquote>
 <li>OV_EINVAL means that the argument was invalid.  In this case, the requested bitstream did not exist or the bitstream is nonseekable.</li>
 <li><tt>n</tt> total length in seconds of content if i=-1.</li>
-<li><tt>n</tt> length in seconds of logical bitstream if i=1 to n.</li>
+<li><tt>n</tt> length in seconds of logical bitstream if i=0 to n.</li>
 </blockquote>
 <p>
 

Modified: branches/vorbis-aotuv/doc/vorbisfile/reference.html
===================================================================
--- branches/vorbis-aotuv/doc/vorbisfile/reference.html	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/vorbisfile/reference.html	2006-11-05 15:05:50 UTC (rev 12028)
@@ -32,6 +32,7 @@
 <br>
 <b>Decoding</b><br>
 <a href="ov_read.html">ov_read()</a><br>
+<a href="ov_read_float.html">ov_read_float()</a><br>
 <a href="ov_crosslap.html">ov_crosslap()</a><br>
 <br>
 <b>Seeking</b><br>

Modified: branches/vorbis-aotuv/doc/xml/06-floor0.xml
===================================================================
--- branches/vorbis-aotuv/doc/xml/06-floor0.xml	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/doc/xml/06-floor0.xml	2006-11-05 15:05:50 UTC (rev 12028)
@@ -170,7 +170,7 @@
     and
                 
     \begin{math}
-      \mathrm{bark}(x) = 13.1 \arctan (.00074x) + 2.24 \arctan (.0000000158x^2)+.0001x
+      \mathrm{bark}(x) = 13.1 \arctan (.00074x) + 2.24 \arctan (.0000000185x^2 + .0001x)
     \end{math}
     ]]>
    </phrase></textobject>

Modified: branches/vorbis-aotuv/lib/block.c
===================================================================
--- branches/vorbis-aotuv/lib/block.c	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/block.c	2006-11-05 15:05:50 UTC (rev 12028)
@@ -106,7 +106,7 @@
       oggpack_writeinit(vbi->packetblob[i]);
     }    
   }
-  
+
   return(0);
 }
 
@@ -287,16 +287,16 @@
   b=v->backend_state;
   b->psy_g_look=_vp_global_look(vi);
 
-  /* added by aoyumi */
-  b->nblock = _ogg_calloc((128*vi->channels), sizeof(*b->nblock));
-  b->tblock = _ogg_calloc((128*vi->channels), sizeof(*b->tblock));
-
   /* Initialize the envelope state storage */
   b->ve=_ogg_calloc(1,sizeof(*b->ve));
   _ve_envelope_init(b->ve,vi);
 
   vorbis_bitrate_init(vi,&b->bms);
 
+  /* compressed audio packets start after the headers
+     with sequence number 3 */
+  v->sequence=3;
+
   return(0);
 }
 
@@ -348,10 +348,6 @@
 
       drft_clear(&b->fft_look[0]);
       drft_clear(&b->fft_look[1]);
-      
-      /* added by aoyumi */
-      if(b->nblock) _ogg_free(b->nblock);
-      if(b->tblock) _ogg_free(b->tblock);
 
     }
     

Modified: branches/vorbis-aotuv/lib/codec_internal.h
===================================================================
--- branches/vorbis-aotuv/lib/codec_internal.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/codec_internal.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -33,7 +33,10 @@
   float  ampmax;
   int    blocktype;
 
-  ogg_uint32_t   packetblob_markers[PACKETBLOBS];
+  oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed; 
+					      blob [PACKETBLOBS/2] points to
+					      the oggpack_buffer in the 
+					      main vorbis_block */
 } vorbis_block_internal;
 
 typedef void vorbis_look_floor;
@@ -79,14 +82,6 @@
   bitrate_manager_state bms;
 
   ogg_int64_t sample_count;
-
-  /* encode only
-    added by aoyumi */
-  float *nblock; /* lW logmdct buffer */  
-  float *tblock; /* temporal masking buffer (impulse block) */
-  int lW_blocktype; /* last window block type */
-  int lW_modenumber; /* last window mode number (0=short, 1=long) */
-  int lW_no; /* the number of continuous window blocks (last window) */
 } private_state;
 
 /* codec_setup_info contains all the setup information specific to the

Modified: branches/vorbis-aotuv/lib/envelope.c
===================================================================
--- branches/vorbis-aotuv/lib/envelope.c	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/envelope.c	2006-11-05 15:05:50 UTC (rev 12028)
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: PCM data envelope analysis 
- last mod: $Id: envelope.c,v 1.54 2003/09/05 23:17:49 giles Exp $
+ last mod: $Id$
 
  ********************************************************************/
 
@@ -278,7 +278,7 @@
       if(ve->mark[j/ve->searchstep]){
 	if(j>centerW){
 
-	  #if 0
+#if 0
 	  if(j>ve->curmark){
 	    float *marker=alloca(v->pcm_current*sizeof(*marker));
 	    int l,m;
@@ -361,13 +361,13 @@
 
   memmove(e->mark,e->mark+smallshift,(smallsize-smallshift)*sizeof(*e->mark));
   
-  #if 0
+#if 0
   for(i=0;i<VE_BANDS*e->ch;i++)
     memmove(e->filter[i].markers,
 	    e->filter[i].markers+smallshift,
 	    (1024-smallshift)*sizeof(*(*e->filter).markers));
   totalshift+=shift;
-  #endif 
+#endif 
 
   e->current-=shift;
   if(e->curmark>=0)

Modified: branches/vorbis-aotuv/lib/info.c
===================================================================
--- branches/vorbis-aotuv/lib/info.c	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/info.c	2006-11-05 15:05:50 UTC (rev 12028)
@@ -416,7 +416,7 @@
 }
 
 static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
-  char temp[]="AO; aoTuV b3 [20041120] (based on Xiph.Org's libVorbis)";
+  char temp[]="Xiph.Org libVorbis I 20050304";
   int bytes = strlen(temp);
 
   /* preamble */  
@@ -517,6 +517,7 @@
   op->b_o_s=0;
   op->e_o_s=0;
   op->granulepos=0;
+  op->packetno=1;
 
   return 0;
 }
@@ -550,6 +551,7 @@
   op->b_o_s=1;
   op->e_o_s=0;
   op->granulepos=0;
+  op->packetno=0;
 
   /* second header packet (comments) **********************************/
 
@@ -564,6 +566,7 @@
   op_comm->b_o_s=0;
   op_comm->e_o_s=0;
   op_comm->granulepos=0;
+  op_comm->packetno=1;
 
   /* third header packet (modes/codebooks) ****************************/
 
@@ -578,6 +581,7 @@
   op_code->b_o_s=0;
   op_code->e_o_s=0;
   op_code->granulepos=0;
+  op_code->packetno=2;
 
   oggpack_writeclear(&opb);
   return(0);

Modified: branches/vorbis-aotuv/lib/mapping0.c
===================================================================
--- branches/vorbis-aotuv/lib/mapping0.c	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/mapping0.c	2006-11-05 15:05:50 UTC (rev 12028)
@@ -380,9 +380,6 @@
       
       float *logmdct =logfft+n/2;
       float *logmask =logfft;
-      
-      float *lastmdct = b->nblock+i*128;
-      float *tempmdct = b->tblock+i*128;
 
       vb->mode=modenumber;
 
@@ -470,11 +467,7 @@
 			   1,
 			   logmask,
 			   mdct,
-			   logmdct,
-			   lastmdct, tempmdct,
-			   blocktype, modenumber,
-			   vb->nW,
-			   b->lW_blocktype, b->lW_modenumber, b->lW_no);
+			   logmdct);
 	
 #if 0
 	if(vi->channels==2){
@@ -517,11 +510,7 @@
 			   2,
 			   logmask,
 			   mdct,
-			   logmdct,
-			   lastmdct, tempmdct,
-			   blocktype, modenumber,
-			   vb->nW,
-			   b->lW_blocktype, b->lW_modenumber, b->lW_no);
+			   logmdct);
 
 #if 0
 	if(vi->channels==2){
@@ -544,11 +533,7 @@
 			   0,
 			   logmask,
 			   mdct,
-			   logmdct,
-			   lastmdct, tempmdct,
-			   blocktype, modenumber,
-			   vb->nW,
-			   b->lW_blocktype, b->lW_modenumber, b->lW_no);
+			   logmdct);
 
 #if 0
 	if(vi->channels==2)
@@ -706,9 +691,7 @@
 		   mag_sort,
 		   ilogmaskch,
 		   nonzero,
-		   ci->psy_g_param.sliding_lowpass[vb->W][k],
-		   blocktype, modenumber,
-		   b->lW_blocktype, b->lW_modenumber);
+		   ci->psy_g_param.sliding_lowpass[vb->W][k]);
       }
       
       /* classify and encode by submap */
@@ -734,11 +717,6 @@
 		  couple_bundle,NULL,zerobundle,ch_in_bundle,classifications);
       }
       
-      /* set last-window type & number */
-      if((blocktype == b->lW_blocktype) && (modenumber == b->lW_modenumber)) b->lW_no++;
-      else b->lW_no = 1;
-      b->lW_blocktype = blocktype;
-      b->lW_modenumber = modenumber;
       /* ok, done encoding.  Next protopacket. */
     }
     

Modified: branches/vorbis-aotuv/lib/masking.h
===================================================================
--- branches/vorbis-aotuv/lib/masking.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/masking.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -23,29 +23,16 @@
 
 #define MAX_ATH 88
 static float ATH[]={
-/* original ATH */
-  /*15*/  //-51, -52, -53, -54, -55, -56, -57, -58,  
-  /*31*/  //-59, -60, -61, -62, -63, -64, -65, -66,
-  /*63*/  //-67, -68, -69, -70, -71, -72, -73, -74, 
-  /*125*/ //-75, -76, -77, -78, -80, -81, -82, -83,
-  /*250*/ //-84, -85, -86, -87, -88, -88, -89, -89, 
-  /*500*/ //-90, -91, -91, -92, -93, -94, -95, -96,
-  /*1k*/  //-96, -97, -98, -98, -99, -99,-100,-100,
-  /*2k*/ //-101,-102,-103,-104,-106,-107,-107,-107,
-  /*4k*/ //-107,-105,-103,-102,-101, -99, -98, -96,
-  /*8k*/  //-95, -95, -96, -97, -96, -95, -93, -90,
-  /*16k*/ //-80, -70, -50, -40, -30, -30, -30, -30
-/* Aoyumi's ATH (fixed) */
-  /*15*/  -51, -52, -53, -54, -55, -56, -57, -58,
+  /*15*/  -51, -52, -53, -54, -55, -56, -57, -58,  
   /*31*/  -59, -60, -61, -62, -63, -64, -65, -66,
-  /*63*/  -67, -68, -69, -70, -71, -73, -74, -75,
-  /*125*/ -77, -79, -81, -82, -83, -84, -85, -86,
-  /*250*/ -87, -88, -89, -90, -91, -91, -92, -92,
-  /*500*/ -93, -94, -95, -95, -96, -96, -96, -97,
-  /*1k*/  -97, -96, -96, -96, -97, -98, -99,-100,
-  /*2k*/ -101,-102,-103,-104,-106,-107,-107,-106,
-  /*4k*/ -104,-102,-101,-100,-100, -99, -98, -97,
-  /*8k*/  -96, -95, -96, -97, -96, -95, -93, -89,
+  /*63*/  -67, -68, -69, -70, -71, -72, -73, -74, 
+  /*125*/ -75, -76, -77, -78, -80, -81, -82, -83,
+  /*250*/ -84, -85, -86, -87, -88, -88, -89, -89, 
+  /*500*/ -90, -91, -91, -92, -93, -94, -95, -96,
+  /*1k*/  -96, -97, -98, -98, -99, -99,-100,-100,
+  /*2k*/ -101,-102,-103,-104,-106,-107,-107,-107,
+  /*4k*/ -107,-105,-103,-102,-101, -99, -98, -96,
+  /*8k*/  -95, -95, -96, -97, -96, -95, -93, -90,
   /*16k*/ -80, -70, -50, -40, -30, -30, -30, -30
 };
 

Modified: branches/vorbis-aotuv/lib/modes/psych_11.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/psych_11.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/psych_11.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -15,32 +15,26 @@
 
  ********************************************************************/
 
-static double _psy_lowpass_11[4]={4,4.5,5.5,30.,};
+static double _psy_lowpass_11[3]={4.5,5.5,30.,};
 
-static att3 _psy_tone_masteratt_11[4]={
-  {{ 30,  25,  12},  0,   0},  /* -2 */
-  {{ 30,  25,  12},  0,   0},  /* -1 */
-  {{ 30,  25,  12},  0,   0},  /*  0 */
-  {{ 20,   0, -14},  0,   0},  /* 10 */
+static att3 _psy_tone_masteratt_11[3]={
+  {{ 30,  25,  12},  0,   0},  /* 0 */
+  {{ 30,  25,  12},  0,   0},  /* 0 */
+  {{ 20,   0, -14},  0,   0}, /* 0 */
 };
 
-static vp_adjblock _vp_tonemask_adj_11[4]={
+static vp_adjblock _vp_tonemask_adj_11[3]={
   /* adjust for mode zero */
   /* 63     125     250     500     1     2     4     8    16 */
-  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* -2 */
-  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* -1 */
-  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /*  0 */
-  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 10 */
+  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */
+  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */
+  {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */
 };
 
 
-static noise3 _psy_noisebias_11[4]={
+static noise3 _psy_noisebias_11[3]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
   {{{-10,-10,-10,-10, -5, -5, -5,  0,  4, 10, 10, 12, 12, 12, 99, 99, 99},
-    {-12,-12,-12,-12,-10,-10, -5,  0,  2,  4,  4,  5,  5, 10, 99, 99, 99},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
-
-  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4, 10, 10, 12, 12, 12, 99, 99, 99},
     {-15,-15,-15,-15,-10,-10, -5,  0,  0,  4,  4,  5,  5, 10, 99, 99, 99},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
 
@@ -53,5 +47,5 @@
     {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
 };
 
-static double _noise_thresh_11[4]={ .3,.3,.5,.5 };
+static double _noise_thresh_11[3]={ .3,.5,.5 };
 

Modified: branches/vorbis-aotuv/lib/modes/psych_16.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/psych_16.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/psych_16.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -16,7 +16,7 @@
  ********************************************************************/
 
 /* stereo mode by base quality level */
-static adj_stereo _psy_stereo_modes_16[5]={
+static adj_stereo _psy_stereo_modes_16[4]={
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  */
   {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
    {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
@@ -24,10 +24,6 @@
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
    {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
-   {  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  3,  3,  4,  4},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
-  {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
-   {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
    {  2,  2,  2,  2,  2,  2,  2,  2,  2,  3,  4,  4,  4,  4,  4},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   {{  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
@@ -40,34 +36,28 @@
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 };
 
-static double _psy_lowpass_16[5]={6.,6.5,8,30.,99.};
+static double _psy_lowpass_16[4]={6.5,8,30.,99.};
 
-static att3 _psy_tone_masteratt_16[5]={
-  {{ 30,  25,  12},  0,   0},  /* -2 */
-  {{ 30,  25,  12},  0,   0},  /* -1 */
-  {{ 25,  22,  12},  0,   0},  /* 0.5 */
-  {{ 20,  12,   0},  0,   0},  /*  5 */
-  {{ 15,   0, -14},  0,   0},  /* 10 */
+static att3 _psy_tone_masteratt_16[4]={
+  {{ 30,  25,  12},  0,   0},  /* 0 */
+  {{ 25,  22,  12},  0,   0},  /* 0 */
+  {{ 20,  12,   0},  0,   0},  /* 0 */
+  {{ 15,   0, -14},  0,   0}, /* 0 */
 };
 
-static vp_adjblock _vp_tonemask_adj_16[5]={
+static vp_adjblock _vp_tonemask_adj_16[4]={
   /* adjust for mode zero */
   /* 63     125     250     500       1     2     4     8    16 */
-  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* -2 */
-  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* -1 */
-  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0.5 */
-  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0}}, /*  5 */
-  {{-30,-30,-30,-30,-30,-26,-20,-10, -5, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 10 */
+  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */
+  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 1 */
+  {{-20,-20,-20,-20,-20,-16,-10,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
+  {{-30,-30,-30,-30,-30,-26,-20,-10, -5, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
 };
 
 
-static noise3 _psy_noisebias_16_short[5]={
+static noise3 _psy_noisebias_16_short[4]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
   {{{-15,-15,-15,-15,-15,-10,-10,-5,   4, 10, 10, 10, 10, 12, 12, 14, 20},
-    {-12,-12,-12,-12,-12, -7, -4, -2,  3,  3,  4,  5,  5,  6,  8,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
-
-  {{{-15,-15,-15,-15,-15,-10,-10,-5,   4, 10, 10, 10, 10, 12, 12, 14, 20},
     {-15,-15,-15,-15,-15,-10,-10, -5,  0,  0,  4,  5,  5,  6,  8,  8, 15},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
 
@@ -84,13 +74,9 @@
     {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
 };
 
-static noise3 _psy_noisebias_16_impulse[5]={
+static noise3 _psy_noisebias_16_impulse[4]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
   {{{-15,-15,-15,-15,-15,-10,-10,-5,   4, 10, 10, 10, 10, 12, 12, 14, 20},
-    {-12,-12,-12,-12,-12, -7, -4, -2,  3,  3,  4,  5,  5,  6,  8,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
-
-  {{{-15,-15,-15,-15,-15,-10,-10,-5,   4, 10, 10, 10, 10, 12, 12, 14, 20},
     {-15,-15,-15,-15,-15,-10,-10, -5,  0,  0,  4,  5,  5,  6,  8,  8, 15},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
 
@@ -107,13 +93,9 @@
     {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
 };
 
-static noise3 _psy_noisebias_16[5]={
+static noise3 _psy_noisebias_16[4]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
   {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  6,  8,  8, 10, 10, 10, 14, 20},
-    {-10,-10,-10,-10,-10, -5, -2, -2,  3,  3,  3,  4,  5,  6,  8,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
-
-  {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  6,  8,  8, 10, 10, 10, 14, 20},
     {-10,-10,-10,-10,-10, -5, -2, -2,  0,  0,  0,  4,  5,  6,  8,  8, 15},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
 
@@ -130,17 +112,17 @@
     {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
 };
 
-static double _noise_thresh_16[5]={ .3,.3,.5,.5,.5 };
+static double _noise_thresh_16[4]={ .3,.5,.5,.5 };
 
-static int _noise_start_16[4]={ 256,256,256,9999 };
-static int _noise_part_16[5]={ 8,8,8,8,8 };
+static int _noise_start_16[3]={ 256,256,9999 };
+static int _noise_part_16[4]={ 8,8,8,8 };
 
-static int _psy_ath_floater_16[5]={
-  -100,-100,-100,-100,-105,
+static int _psy_ath_floater_16[4]={
+  -100,-100,-100,-105,
 };
 
-static int _psy_ath_abs_16[5]={
-  -130,-130,-130,-130,-140,
+static int _psy_ath_abs_16[4]={
+  -130,-130,-130,-140,
 };
 
 

Modified: branches/vorbis-aotuv/lib/modes/psych_44.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/psych_44.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/psych_44.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -18,24 +18,9 @@
 
 /* preecho trigger settings *****************************************/
 
-static vorbis_info_psy_global _psy_global_44[6]={
-/*
-  { lines per eighth octave,
-   { pre-echo thresh.}, 
-   { post-echo thresh.}, stretch penalty, pre-echo minimum energy,
-   ampmax att 1/sec,
-   {coupling point(kHz)},{{coupling point limit0},{coupling point limit1}},
-     {coupling pre-point amp},{coupling post-point amp},{{sliding lowpass0},{sliding lowpass1}}
-  },
-*/
-/* q-2 */
+static vorbis_info_psy_global _psy_global_44[5]={
+
   {8,   /* lines per eighth octave */
-   {24.f,14.f,14.f,14.f,14.f,14.f,14.f}, 
-   {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
-   -6.f,
-   {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
-  },
-  {8,   /* lines per eighth octave */
    {20.f,14.f,12.f,12.f,12.f,12.f,12.f}, 
    {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
    -6.f,
@@ -54,16 +39,14 @@
    {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
   },
   {8,   /* lines per eighth octave */
-//   {10.f,8.f,8.f,8.f,8.f,8.f,8.f}, 
-   {10.f,8.f,8.f,6.f,6.f,6.f,7.f},
+   {10.f,8.f,8.f,8.f,8.f,8.f,8.f}, 
    {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
    -6.f,
    {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
   },
   {8,   /* lines per eighth octave */
    {10.f,6.f,6.f,6.f,6.f,6.f,6.f}, 
-//   {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
-   {-15.f,-14.f,-10.f,-10.f,-10.f,-11.f,-12.f}, 0,-85.f,
+   {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
    -6.f,
    {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
   },
@@ -73,15 +56,10 @@
 static compandblock _psy_compand_44[6]={
   /* sub-mode Z short */
   {{
-//    0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
-//    8, 9,10,11,12,13,14, 15,     /* 15dB */
-//    16,17,18,19,20,21,22, 23,     /* 23dB */
-//    24,25,26,27,28,29,30, 31,     /* 31dB */
-//    32,33,34,35,36,37,38, 39,     /* 39dB */
-     0, 1, 2, 3, 4, 5, 6,  6,     /* 7dB */
-     7, 7, 7, 7, 6, 6, 6,  7,     /* 15dB */
-     7, 8, 9,10,11,13,15, 17,     /* 23dB */
-    20,23,26,27,28,29,30, 31,     /* 31dB */
+    0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
+    8, 9,10,11,12,13,14, 15,     /* 15dB */
+    16,17,18,19,20,21,22, 23,     /* 23dB */
+    24,25,26,27,28,29,30, 31,     /* 31dB */
     32,33,34,35,36,37,38, 39,     /* 39dB */
   }},
   /* mode_Z nominal short */
@@ -102,15 +80,10 @@
   }},
   /* sub-mode Z long */
   {{
-//     0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
-//     8, 9,10,11,12,13,14, 15,     /* 15dB */
-//    16,17,18,19,20,21,22, 23,     /* 23dB */
-//    24,25,26,27,28,29,30, 31,     /* 31dB */
-//    32,33,34,35,36,37,38, 39,     /* 39dB */
      0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
-     8, 9,10,11,12,12,13, 13,     /* 15dB */
-    13,14,14,14,15,15,15, 17,     /* 23dB */
-    20,23,26,27,28,29,30, 31,     /* 31dB */
+     8, 9,10,11,12,13,14, 15,     /* 15dB */
+    16,17,18,19,20,21,22, 23,     /* 23dB */
+    24,25,26,27,28,29,30, 31,     /* 31dB */
     32,33,34,35,36,37,38, 39,     /* 39dB */
   }},
   /* mode_Z nominal long */
@@ -133,136 +106,126 @@
 
 /* tonal masking curve level adjustments *************************/
 
-static vp_adjblock _vp_tonemask_adj_longblock[13]={
+static vp_adjblock _vp_tonemask_adj_longblock[12]={
+
    /* 63     125     250     500       1       2       4       8      16 */
 
-   {{ -3, -9,-12,-12,-10,-10,-10,-10,-10,-10,-10, -1,  0,  0,  1,  1,  1}}, /* -2(addition) */
+   {{ -3, -8,-13,-15,-10,-10,-10,-10,-10,-10,-10,  0,  0,  0,  0,  0,  0}}, /* -1 */
 
-   {{ -3, -9,-12,-12,-11,-11,-11,-11,-11,-11,-10, -1, -1,  0,  0,  0,  0}}, /* -1 */
-
 /* {{-15,-15,-15,-15,-10, -8, -4, -2,  0,  0,  0, 10,  0,  0,  0,  0,  0}},    0 */
-   {{ -5,-11,-14,-15,-15,-14,-14,-14,-13,-12,-10, -2, -2, -1, -1,  0,  0}}, /* 0 */
+   {{ -4,-10,-14,-16,-15,-14,-13,-12,-12,-12,-11, -1, -1, -1, -1, -1,  0}}, /* 0 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  5,  0,  0,  0,  0,  0}},    1 */
-   {{ -6,-12,-15,-16,-16,-15,-14,-14,-13,-12,-10, -2, -2, -1, -1,  0,  0}}, /* 1 */
+   {{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, -1, -1,  0}}, /* 1 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    2 */
-   {{-12,-13,-15,-16,-16,-15,-15,-14,-14,-12,-12, -5, -4, -2, -1,  0,  0}}, /* 2 */
-   
+   {{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -6, -3, -1, -1, -1,  0}}, /* 2 */
+
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    3 */
-   {{-15,-15,-16,-16,-16,-15,-15,-14,-14,-13,-13,-12, -7  -2, -1, -1 , 0}}, /* 3 */
+   {{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, -1, -1,  0}}, /* 3 */
 
-/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    4 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -1, -1 , 0}}, /* 4 */
+/* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}}, *//* 4 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 4 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    5 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -1 , 0}}, /* 5 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 5 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    6 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 6 */
-   
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2,  0}}, /* 6 */
+
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    7 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 7 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 7 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    8 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 8 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 8 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    9 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 9 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 9 */
 
 /* {{-15,-15,-15,-15,-15,-12,-10, -8,  0,  0,  0,  0,  0,  0,  0,  0,  0}},    10 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 10 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 10 */
 };
 
-static vp_adjblock _vp_tonemask_adj_otherblock[13]={
+static vp_adjblock _vp_tonemask_adj_otherblock[12]={
    /* 63     125     250     500       1       2       4       8      16 */
 
-   {{ -3, -9,-12,-12,-10,-10,-10,-10,-10,-10,-10, -1,  0,  0,  1,  1,  1}}, /* -2(addition) */
+   {{ -3, -8,-13,-15,-10,-10, -9, -9, -9, -9, -9,  1,  1,  1,  1,  1,  1}}, /* -1 */
 
-   {{ -3, -9,-12,-12,-11,-11,-11,-11,-11,-11,-10, -1, -1,  0,  0,  0,  0}}, /* -1 */
-
 /* {{-20,-20,-20,-20,-14,-12,-10, -8, -4,  0,  0, 10,  0,  0,  0,  0,  0}},    0 */
-   {{ -5,-11,-14,-15,-15,-15,-14,-14,-13,-12,-10, -2, -2, -1, -1,  0,  0}}, /* 0 */
+   {{ -4,-10,-14,-16,-14,-13,-12,-12,-11,-11,-10,  0,  0,  0,  0,  0,  0}}, /* 0 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  5,  0,  0,  0,  0,  0}},    1 */
-   {{ -6,-12,-15,-16,-16,-15,-14,-14,-13,-12,-10, -2, -2, -1, -1,  0,  0}}, /* 1 */
+   {{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1,  0,  0,  0}}, /* 1 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    2 */
-   {{-12,-13,-15,-16,-16,-15,-15,-14,-14,-12,-12, -5, -4, -2, -1,  0,  0}}, /* 2 */
+   {{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -5, -2, -1,  0,  0,  0}}, /* 2 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    3 */
-   {{-15,-15,-16,-16,-16,-15,-15,-14,-14,-13,-13,-12, -7  -2, -1, -1 , 0}}, /* 3 */
+   {{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2,  0,  0,  0}}, /* 3 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    4 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13, -9  -3, -1, -1 , 0}}, /* 4 */
-   
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 4 */
+
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    5 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -1, -1 , 0}}, /* 5 */
-   
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7  -3, -1, -1 , 0}}, /* 5 */
+
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    6 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 6 */
-   
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2,  0}}, /* 6 */
+
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    7 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 7 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 7 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    8 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 8 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 8 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    9 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 9 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 9 */
 
 /* {{-20,-20,-20,-20,-20,-18,-16,-14,-10,  0,  0,  0,  0,  0,  0,  0,  0}},    10 */
-   {{-16,-16,-16,-16,-16,-16,-16,-15,-15,-14,-14,-13,-10  -4, -2, -2 , 0}}, /* 10 */
+   {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2,  0}}, /* 10 */
 };
 
 /* noise bias (transition block) */
-static noise3 _psy_noisebias_trans[13]={
+static noise3 _psy_noisebias_trans[12]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
-  /* -2(addition mode) */
+  /* -1 */
   {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
-    {-26,-26,-26,-26,-22,-16,-12, -4, -2,  0,  1,  1,  5,  6,  7,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
-  /* -1 
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
     {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  3,  6,  6, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
-    {-30,-30,-30,-30,-26,-20,-16, -8, -6, -4, -2,  0,  2,  3,  6,  6, 14},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
   /* 0 
   {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
     {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4,  0,  0,  0,  0,  2,  4,  10},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4,  -2}}},*/
-  {{{-15,-15,-15,-15,-15,-12, -6, -4,  0,  2,  4,  4,  5,  5,  5,  8, 10},
-    {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4,  0,  0,  0,  0,  2,  4,  6},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},
+  {{{-15,-15,-15,-15,-15,-12, -6, -4,  0,  2,  4,  4,  5,  5,  5,  8,  10},
+    {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4,  0,  0,  0,  0,  2,  3,   6},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4,  -2}}},
   /* 1 
   {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  8},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
-  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8, 10},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  1,  4},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
+  {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  4,  4,  5,  5,  5,  8,  10},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  1,   4},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6,  -4}}},
   /* 2 
   {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  6},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, */
   {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -2, -2, -1,  1,  3},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -2, -1,  0,  3},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -7, -4}}},
   /* 3 
   {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  6},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
   {{{-15,-15,-15,-15,-15,-12,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  3},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  2},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
   /* 4 
   {{{-20,-20,-20,-20,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  5},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
   {{{-20,-20,-20,-20,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  1},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1,  1},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
   /* 5 
   {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
@@ -282,32 +245,23 @@
   {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
     {-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4,  0},
     {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},*/
-//  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
-//    {-32,-32,-32,-32,-28,-24,-24,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
-//    {-34,-34,-34,-34,-30,-26,-26,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
   {{{-24,-24,-24,-24,-20,-18,-14, -8, -1,  1,  1,  1,  2,  3,  3,  4,  7},
-    {-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -7, -4, -1},
-    {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},
+    {-32,-32,-32,-32,-28,-24,-24,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
+    {-34,-34,-34,-34,-30,-26,-26,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
   /* 8 
   {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2,  0,  0,  0,  1,  2,  3,  7},
     {-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
     {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
-//  {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2,  0,  0,  0,  1,  2,  3,  7}, 
-//    {-36,-36,-36,-36,-30,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10, -7},
-//    {-36,-36,-36,-36,-34,-30,-28,-26,-24,-30,-30,-30,-30,-30,-30,-24,-20}}},
-  {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2,  0,  0,  0,  1,  2,  3,  7},
-    {-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -9, -6, -3},
-    {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
+  {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2,  0,  0,  0,  1,  2,  3,  7}, 
+    {-36,-36,-36,-36,-30,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10, -7},
+    {-36,-36,-36,-36,-34,-30,-28,-26,-24,-30,-30,-30,-30,-30,-30,-24,-20}}},
   /* 9 
   {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
     {-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
     {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
-//  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
-//    {-38,-38,-38,-38,-36,-34,-34,-30,-24,-20,-20,-20,-20,-18,-16,-12,-10},
-//    {-40,-40,-40,-40,-40,-40,-40,-38,-35,-35,-35,-35,-35,-35,-35,-35,-30}}},
   {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
-    {-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-13,-10, -7},
-    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
+    {-38,-38,-38,-38,-36,-34,-34,-30,-24,-20,-20,-20,-20,-18,-16,-12,-10},
+    {-40,-40,-40,-40,-40,-40,-40,-38,-35,-35,-35,-35,-35,-35,-35,-35,-30}}},
   /* 10 */
   {{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10},
     {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
@@ -315,31 +269,25 @@
 };
 
 /*  noise bias (long block) */
-static noise3 _psy_noisebias_long[13]={
-  /*  63     125     250     500      1k       2k      4k      8k     16k*/
-  /* -2(addition mode) */
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  2,  6,  6,  6,  6, 10, 10, 12,  20},
-    {-20,-20,-20,-20,-20,-20,-10, -2,  2,  2,  2,  1,  5,  6,  7,  8,  15},
-    {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
-  /* -1 
+static noise3 _psy_noisebias_long[12]={
+  /*63     125     250     500      1k       2k      4k      8k     16k*/
+  /* -1 */
   {{{-10,-10,-10,-10,-10, -4,  0,  0,  0,  6,  6,  6,  6, 10, 10, 12,  20},
     {-20,-20,-20,-20,-20,-20,-10, -2,  0,  0,  0,  0,  0,  2,  4,  6,  15},
-    {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  0,  6,  6,  6,  6, 10, 10, 12,  20},
-    {-20,-20,-20,-20,-20,-20,-10, -2,  0,  0,  0,  0,  0,  1,  3,  5,  13},
     {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
+
   /* 0 */
   /*  {{{-10,-10,-10,-10,-10,-10, -8,  2,  2,  2,  4,  4,  5,  5,  5,  8,  10},
       {-20,-20,-20,-20,-20,-20,-20,-14, -6,  0,  0,  0,  0,  0,  2,  4,  10},
       {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
-  {{{-10,-10,-10,-10,-10,-10, -8,  2,  2,  2,  4,  4,  5,  5,  5,  8, 10},
-    {-20,-20,-20,-20,-20,-20,-20,-14, -6,  0,  0,  0,  0,  0,  2,  4,  6},
+  {{{-10,-10,-10,-10,-10,-10, -8,  2,  2,  2,  4,  4,  5,  5,  5,  8,  10},
+    {-20,-20,-20,-20,-20,-20,-20,-14, -6,  0,  0,  0,  0,  0,  2,  3,  6},
     {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},
   /* 1 */
   /*  {{{-10,-10,-10,-10,-10,-10, -8, -4,  0,  2,  4,  4,  5,  5,  5,  8,  10},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  8},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
-  {{{-10,-10,-10,-10,-10,-10, -8, -4,  0,  2,  4,  4,  5,  5,  5,  8, 10},
+  {{{-10,-10,-10,-10,-10,-10, -8, -4,  0,  2,  4,  4,  5,  5,  5,  8,  10},
     {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2,  0,  1,  4},
     {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
   /* 2 */
@@ -347,21 +295,21 @@
       {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2,  0,  2,  6},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
   {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  5,  6,  10},
-    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -2, -2, -1,  1,  3},
+    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -2, -1,  0,  3},
     {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
   /* 3 */
   /*  {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  6},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
   {{{-10,-10,-10,-10,-10,-10,-10, -8,  0,  2,  2,  2,  4,  4,  4,  5,  8},
-    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  3},
+    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  2},
     {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -5}}},
   /* 4 */
   /*  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1,  1,  5},
       {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
   {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
-    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2,  0,  1},
+    {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1,  1},
     {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -7}}},
   /* 5 */
   /*  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
@@ -378,25 +326,16 @@
     {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2,  0},
     {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12,-10}}},
   /* 7 */
-//  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
-//    {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4,  0},
-//    {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
   {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  1,  1,  1,  2,  3,  3,  4,  7},
-    {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -7, -4, -1},
+    {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4,  0},
     {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
   /* 8 */
-//  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  0,  0,  0,  0,  1,  2,  3,  7},
-//    {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
-//    {-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
   {{{-15,-15,-15,-15,-15,-15,-15,-10, -4,  0,  0,  0,  0,  1,  2,  3,  7},
-    {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -9, -6, -3},
+    {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
     {-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
   /* 9 */
-//  {{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2,  2},
-//    {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
-//    {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
   {{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2,  2},
-    {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-13,-10, -7},
+    {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
     {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
   /* 10 */
   {{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10},
@@ -405,25 +344,19 @@
 };
 
 /* noise bias (impulse block) */
-static noise3 _psy_noisebias_impulse[13]={
+static noise3 _psy_noisebias_impulse[12]={
   /*  63     125     250     500      1k      2k      4k      8k     16k*/
-  /* -2(addition mode) */
+  /* -1 */
   {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
-    {-26,-26,-26,-26,-22,-16,-12, -4, -2,  0,  0,  1,  6,  7,  8,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
-  /* -1 
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
     {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  3,  6,  6, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
-    {-30,-30,-30,-30,-26,-20,-16, -8, -6, -4, -2,  0,  2,  3,  6,  6, 14},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
-  /* 0 
+
+  /* 0 */
+  /*  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  4,  8,  8,  8, 10, 12, 14, 20},
+      {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2,  0,  0,  0,  0,  2,  4,  10},
+      {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
   {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  4,  8,  8,  8, 10, 12, 14, 20},
-    {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2,  0,  0,  0,  0,  2,  4, 10},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  4,  8,  8,  8, 10, 12, 14, 20},
-    {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2,  0,  0,  0,  0,  2,  4,  6},
+    {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2,  0,  0,  0,  0,  2,  3,  6},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
   /* 1 */
   {{{-12,-12,-12,-12,-12, -8, -6, -4,  0,  4,  4,  4,  4, 10, 12, 14, 20},
@@ -442,43 +375,37 @@
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2,  0},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
   /* 5 */
-//  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
-//    {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
-//    {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
   {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
-    {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -5, -5, -2},
+    {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
     {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
   /* 6 
   {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
-    {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
-    {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/
-//  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
-//    {-34,-34,-34,-34,-30,-30,-30,-24,-16,-16,-16,-16,-16,-16,-14,-14,-12},
-//    {-36,-36,-36,-36,-36,-34,-28,-24,-20,-20,-20,-20,-20,-20,-20,-18,-16}}},
+      {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
+      {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/
   {{{-20,-20,-20,-20,-20,-18,-14,-10, -4,  0,  0,  0,  0,  4,  4,  6, 11},
-    {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -8, -4},
-    {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},
+    {-34,-34,-34,-34,-30,-30,-30,-24,-16,-16,-16,-16,-16,-16,-14,-14,-12},
+    {-36,-36,-36,-36,-36,-34,-28,-24,-20,-20,-20,-20,-20,-20,-20,-18,-16}}},
   /* 7 */
+  /*  {{{-22,-22,-22,-22,-22,-20,-14,-10, -6,  0,  0,  0,  0,  4,  4,  6, 11},
+      {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
+      {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},*/
   {{{-22,-22,-22,-22,-22,-20,-14,-10, -6,  0,  0,  0,  0,  4,  4,  6, 11},
-    {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
-    {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},
-//  {{{-22,-22,-22,-22,-22,-20,-14,-10, -6,  0,  0,  0,  0,  4,  4,  6, 11},
-//    {-34,-34,-34,-34,-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-24,-22},
-//    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
+    {-34,-34,-34,-34,-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-24,-22},
+    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
   /* 8 */
+  /*  {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1,  3,  3,  5, 10},
+      {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
+      {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
   {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1,  3,  3,  5, 10},
-    {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
-    {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
-//  {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1,  3,  3,  5, 10},
-//    {-34,-34,-34,-34,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-24},
-//    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
+    {-34,-34,-34,-34,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-24},
+    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
   /* 9 */
+  /*  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
+      {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
+      {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
   {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
-    {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
+    {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26},
     {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
-//  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2,  2},
-//    {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26},
-//    {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
   /* 10 */
   {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
     {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26},
@@ -486,19 +413,14 @@
 };
 
 /* noise bias (padding block) */
-static noise3 _psy_noisebias_padding[13]={
+static noise3 _psy_noisebias_padding[12]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
-  /* -2(addition mode) */
+  
+  /* -1 */
   {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
-    {-26,-26,-26,-26,-22,-16,-12, -4, -2, -1,  0,  2,  7,  8,  8,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
-  /* -1 
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
     {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2,  2,  2,  3,  6,  6, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
-  {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
-    {-30,-30,-30,-30,-26,-20,-16, -8, -6, -4, -2,  2,  4,  6,  8,  8, 15},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -4, -4, -4, -4, -4, -2,  0,  2}}},
+    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
+
   /* 0 */
   {{{-10,-10,-10,-10,-10, -4,  0,  0,  4,  8,  8,  8,  8, 10, 12, 14, 20},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2,  2,  3,  6,  6,  8, 10},
@@ -508,8 +430,11 @@
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4,  0,  0,  0,  2,  2,  4,  8},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2,  0}}},
   /* 2 */
+  /*  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  8, 10, 10, 16},
+      {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4,  0,  0,  0,  2,  2,  4,  8},
+      {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},*/
   {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  8, 10, 10, 16},
-    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4,  0,  0,  0,  2,  2,  4,  8},
+    {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1,  0,  0,  2,  6},
     {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
   /* 3 */
   {{{-14,-14,-14,-14,-14,-10, -8, -6, -2,  2,  2,  2,  2,  6,  8,  8, 14},
@@ -553,17 +478,14 @@
   {10,10,100},
 };
 
-static int _psy_tone_suppress[13]={
-//  -20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,
-  -20,-20,-20,-20,-20,-20,-24,-30,-40,-40,-42,-45,-45,
+static int _psy_tone_suppress[12]={
+  -20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,
 };
-static int _psy_tone_0dB[13]={
-//  90,90,95,95,95,95,105,105,105,105,105,105,
-   90,90,90,95,95,95,95,105,105,105,105,105,105,
+static int _psy_tone_0dB[12]={
+  90,90,95,95,95,95,105,105,105,105,105,105,
 };
-static int _psy_noise_suppress[13]={
-//  -20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,
-  -20,-20,-20,-24,-24,-24,-24,-30,-40,-40,-42,-45,-45,
+static int _psy_noise_suppress[12]={
+  -20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,
 };
 
 static vorbis_info_psy _psy_info_template={
@@ -584,13 +506,11 @@
 
 /* ath ****************/
 
-static int _psy_ath_floater[13]={
-//  -100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
-  -100,-100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
+static int _psy_ath_floater[12]={
+  -100,-100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
 };
-static int _psy_ath_abs[13]={
-//  -130,-130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150,
-  -130,-130,-130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150,
+static int _psy_ath_abs[12]={
+  -130,-130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150,
 };
 
 /* stereo setup.  These don't map directly to quality level, there's
@@ -602,22 +522,14 @@
 /* various stereo possibilities */
 
 /* stereo mode by base quality level */
-static adj_stereo _psy_stereo_modes_44[13]={
-  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         -2(addition mode)  */
-  {{  4,  4,  4,  4,  4,  4,  4,  4,  3,  2,  1,  0,  0,  0,  0},
-   {  8,  8,  8,  8,  8,  8,  8,  7,  7,  7,  7,  7,  5,  4,  3},
-   {  1,  2,  2,  2,  2,  3,  3,  4,  4,  4,  5,  6,  7,  8,  8},
-   { 10,10.5, 11,11.5, 12,12.5, 13, 99, 99, 99, 99, 99, 99, 99, 99}},
+static adj_stereo _psy_stereo_modes_44[12]={
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         -1  */
-/*{{  4,  4,  4,  4,  4,  4,  4,  3,  2,  2,  1,  0,  0,  0,  0},
+  {{  4,  4,  4,  4,  4,  4,  4,  3,  2,  2,  1,  0,  0,  0,  0},
    {  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  5,  4,  3},
    {  1,  2,  3,  4,  4,  4,  4,  4,  4,  5,  6,  7,  8,  8,  8},
-   { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},*/
-  {{  4,  4,  4,  4,  4,  4,  4,  3,  2,  2,  1,  0,  0,  0,  0},
-   {  8,  8,  8,  8,  8,  7,  7,  6,  6,  6,  6,  6,  5,  4,  3},
-   {  1,  2,  3,  4,  4,  4,  4,  4,  4,  5,  6,  7,  8,  8,  8},
    { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
- /*   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         0  */
+
+/*    0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         0  */
 /*{{  4,  4,  4,  4,  4,  4,  4,  3,  2,  2,  1,  0,  0,  0,  0},
    {  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  5,  4,  3},
    {  1,  2,  3,  4,  5,  5,  6,  6,  6,  6,  6,  7,  8,  8,  8},
@@ -626,20 +538,20 @@
    {  8,  8,  8,  8,  6,  6,  5,  5,  5,  5,  5,  5,  5,  4,  3},
    {  1,  2,  3,  4,  4,  5,  6,  6,  6,  6,  6,  8,  8,  8,  8},
    { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
+
+
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         1  */
-/*{{  3,  3,  3,  3,  3,  3,  3,  3,  2,  1,  0,  0,  0,  0,  0},
+  {{  3,  3,  3,  3,  3,  3,  3,  3,  2,  1,  0,  0,  0,  0,  0},
    {  8,  8,  8,  8,  6,  6,  5,  5,  5,  5,  5,  5,  5,  4,  3},
    {  1,  2,  3,  4,  4,  5,  6,  6,  6,  6,  6,  8,  8,  8,  8},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
-  {{  3,  3,  3,  3,  3,  3,  3,  3,  2,  1,  0,  0,  0,  0,  0},
-   {  8,  8,  8,  8,  6,  6,  5,  4,  4,  4,  4,  4,  4,  3,  3},
-   {  1,  2,  3,  4,  4,  5,  6,  6,  6,  6,  6,  8,  8,  8,  8},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+
+
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         2  */
-/*{{  3,  3,  3,  3,  3,  3,  2,  2,  2,  1,  0,  0,  0,  0,  0},
-   {  8,  8,  8,  6,  5,  5,  5,  5,  5,  5,  5,  4,  3,  2,  1},
-   {  3,  4,  4,  4,  5,  6,  6,  6,  6,  6,  6,  8,  8,  8,  8},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, */
+  /*  {{  3,  3,  3,  3,  3,  3,  2,  2,  2,  1,  0,  0,  0,  0,  0},
+      {  8,  8,  8,  6,  5,  5,  5,  5,  5,  5,  5,  4,  3,  2,  1},
+      {  3,  4,  4,  4,  5,  6,  6,  6,  6,  6,  6,  8,  8,  8,  8},
+      { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, */
   {{  3,  3,  3,  3,  3,  3,  3,  2,  1,  1,  0,  0,  0,  0,  0},
    {  8,  8,  6,  6,  5,  5,  4,  4,  4,  4,  4,  4,  3,  2,  1},
    {  3,  4,  4,  5,  5,  6,  6,  6,  6,  6,  6,  8,  8,  8,  8},
@@ -655,37 +567,37 @@
    {  6,  6,  6,  8,  8,  8,  8,  8,  8,  8, 10, 10, 10, 10, 10},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         5  */
-/*{{  2,  2,  2,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0},
-   {  6,  6,  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
+  /*  {{  2,  2,  2,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0},
+      {  6,  6,  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10},
+      { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
   {{  2,  2,  2,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  3,  3,  3,  3,  3,  2,  2,  2,  2,  2,  2,  0,  0,  0,  0},
    {  6,  7,  8,  8,  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
-/*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         6  */
-/*{{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  3,  3,  3,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, */
+  /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         6  */
+  /*  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  3,  3,  3,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
+      { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, */
   {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  3,  3,  3,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  8,  8,  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         7  */
-/*{{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  3,  3,  3,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
+  /*  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  3,  3,  3,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  8,  8,  8,  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
+      { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
   {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  3,  3,  3,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  8,  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14         8  */
-/*{{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
-   {  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
+  /*  {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
+      {  8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
+      { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},*/
   {{  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  2,  2,  2,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0},
    {  8, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
@@ -703,17 +615,14 @@
 };
 
 /* tone master attenuation by base quality mode and bitrate tweak */
-static att3 _psy_tone_masteratt_44[13]={
-  {{ 36,  22,  10},  0,    0}, /* -2 */
+static att3 _psy_tone_masteratt_44[12]={
   {{ 35,  21,   9},  0,    0}, /* -1 */
-//  {{ 30,  20,   8}, -2, 1.25}, /* 0 */
-  {{ 30,  20,   8},  -1,    0}, /* 0 */
+  {{ 30,  20,   8}, -2, 1.25}, /* 0 */
   /*  {{ 25,  14,   4},  0,    0}, *//* 1 */
   {{ 25,  12,   2},  0,    0}, /* 1 */
-//  {{ 20,  10,  -2},  0,    0}, /* 2 */
-  {{ 22,  11,   0},  0,    0}, /* 2 */
-//  {{ 20,   9,  -4},  0,    0}, /* 3 */
-  {{ 21,  11,  -2},  0,    0}, /* 3 */
+  /*  {{ 20,  10,  -2},  0,    0}, *//* 2 */
+  {{ 20,   9,  -3},  0,    0}, /* 2 */
+  {{ 20,   9,  -4},  0,    0}, /* 3 */
   {{ 20,   9,  -4},  0,    0}, /* 4 */
   {{ 20,   6,  -6},  0,    0}, /* 5 */
   {{ 20,   3, -10},  0,    0}, /* 6 */
@@ -724,48 +633,34 @@
 };
 
 /* lowpass by mode **************/
-static double _psy_lowpass_44[13]={
+static double _psy_lowpass_44[12]={
   /*  15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999. */
-//  13.9,15.1,15.8,16.5,17.2,18.9,20.1,48.,999.,999.,999.,999.
-  13.1,14.8,15.1,15.8,16.5,17.2,18.6,20.1,48.,999.,999.,999.,999.
+  13.9,15.1,15.8,16.5,17.2,18.9,20.1,48.,999.,999.,999.,999.
 };
 
 /* noise normalization **********/
 
-static int _noise_start_short_44[12]={
+static int _noise_start_short_44[11]={
   /*  16,16,16,16,32,32,9999,9999,9999,9999 */
-//  32,16,16,16,32,9999,9999,9999,9999,9999,9999
-  32,32,16,16,32,64,9999,9999,9999,9999,9999,9999
+  32,16,16,16,32,9999,9999,9999,9999,9999,9999
 };
-static int _noise_start_long_44[12]={
+static int _noise_start_long_44[11]={
   /*  128,128,128,256,512,512,9999,9999,9999,9999 */
-//  256,128,128,256,512,9999,9999,9999,9999,9999,9999
-  256,256,128,128,256,512,9999,9999,9999,9999,9999,9999
+  256,128,128,256,512,9999,9999,9999,9999,9999,9999
 };
 
-static int _noise_part_short_44[12]={
-//    8,8,8,8,8,8,8,8,8,8,8
-    8,8,8,8,8,8,8,8,8,8,8,8
+static int _noise_part_short_44[11]={
+    8,8,8,8,8,8,8,8,8,8,8
 };
-static int _noise_part_long_44[12]={
-//    32,32,32,32,32,32,32,32,32,32,32
-    32,32,32,32,32,32,32,32,32,32,32,32
+static int _noise_part_long_44[11]={
+    32,32,32,32,32,32,32,32,32,32,32
 };
 
-static double _noise_thresh_44[12]={
+static double _noise_thresh_44[11]={
   /*  .2,.2,.3,.4,.5,.5,9999.,9999.,9999.,9999., */
-//   .2,.2,.2,.4,.6,9999.,9999.,9999.,9999.,9999.,9999.,
-   .2,.2,.2,.2,.4,.8,9999.,9999.,9999.,9999.,9999.,9999.,
+   .2,.2,.2,.4,.6,9999.,9999.,9999.,9999.,9999.,9999.,
 };
 
 static double _noise_thresh_5only[2]={
  .5,.5,
 };
-
-/* 32kHz only */
-static int _noise_start_short_32[12]={
-  40,40,16,16,40,80,9999,9999,9999,9999,9999,9999
-};
-static int _noise_start_long_32[12]={
-  320,320,128,128,320,640,9999,9999,9999,9999,9999,9999
-};

Modified: branches/vorbis-aotuv/lib/modes/psych_8.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/psych_8.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/psych_8.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -15,29 +15,23 @@
 
  ********************************************************************/
 
-static att3 _psy_tone_masteratt_8[4]={
-  {{ 32,  25,  12},  0,   0},  /* -2 */
-  {{ 32,  25,  12},  0,   0},  /* -1 */
-  {{ 30,  25,  12},  0,   0},  /*  0 */
-  {{ 20,   0, -14},  0,   0},  /* 10 */
+static att3 _psy_tone_masteratt_8[3]={
+  {{ 32,  25,  12},  0,   0},  /* 0 */
+  {{ 30,  25,  12},  0,   0},  /* 0 */
+  {{ 20,   0, -14},  0,   0}, /* 0 */
 };
 
-static vp_adjblock _vp_tonemask_adj_8[4]={
+static vp_adjblock _vp_tonemask_adj_8[3]={
   /* adjust for mode zero */
   /* 63     125     250     500     1     2     4     8    16 */
-  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 5, 5,99,99,99}}, /* -2 */
-  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* -1 */
-  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /*  0 */
-  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 10 */
+  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
+  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
+  {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */
 };
 
 
-static noise3 _psy_noisebias_8[4]={
+static noise3 _psy_noisebias_8[3]={
   /*  63     125     250     500      1k       2k      4k      8k     16k*/
-  {{{-10,-10,-10,-10, -5, -5, -5,  2,  4,  8,  8,  8, 10, 10, 99, 99, 99},
-    {-10,-10,-10,-10, -5, -4, -4,  2,  3,  4,  4,  4,  7,  8, 99, 99, 99},
-    {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
-
   {{{-10,-10,-10,-10, -5, -5, -5,  0,  4,  8,  8,  8, 10, 10, 99, 99, 99},
     {-10,-10,-10,-10, -5, -5, -5,  0,  0,  4,  4,  4,  4,  4, 99, 99, 99},
     {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
@@ -52,7 +46,7 @@
 };
 
 /* stereo mode by base quality level */
-static adj_stereo _psy_stereo_modes_8[4]={
+static adj_stereo _psy_stereo_modes_8[3]={
   /*  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  */
   {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
    {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
@@ -62,33 +56,21 @@
    {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
    {  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
-  {{  4,  4,  4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
-   {  6,  5,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
-   {  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1},
-   { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
   {{  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3},
    {  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4},
    {  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1},
    { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
 };
 
-static noiseguard _psy_noiseguards_8[3]={
+static noiseguard _psy_noiseguards_8[2]={
   {10,10,-1},
   {10,10,-1},
-  {10,10,-1},
 };
 
-static compandblock _psy_compand_8[3]={
+static compandblock _psy_compand_8[2]={
   {{
      0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
      8, 8, 9, 9,10,10,11, 11,     /* 15dB */
-    12,12,13,13,14,14,15, 16,     /* 23dB */
-    17,18,19,20,21,22,23, 24,     /* 31dB */
-    25,26,27,28,29,30,31, 32,     /* 39dB */
-  }},
-  {{
-     0, 1, 2, 3, 4, 5, 6,  7,     /* 7dB */
-     8, 8, 9, 9,10,10,11, 11,     /* 15dB */
     12,12,13,13,14,14,15, 15,     /* 23dB */
     16,16,17,17,17,18,18, 19,     /* 31dB */
     19,19,20,21,22,23,24, 25,     /* 39dB */
@@ -102,19 +84,19 @@
   }},
 };
 
-static double _psy_lowpass_8[4]={2.6,3.,4.,4.};
-static int _noise_start_8[3]={
-  64,64,64,
+static double _psy_lowpass_8[3]={3.,4.,4.};
+static int _noise_start_8[2]={
+  64,64,
 };
-static int _noise_part_8[3]={
-  8,8,8,
+static int _noise_part_8[2]={
+  8,8,
 };
 
-static int _psy_ath_floater_8[4]={
-  -100,-100,-100,-105,
+static int _psy_ath_floater_8[3]={
+  -100,-100,-105,
 };
 
-static int _psy_ath_abs_8[4]={
-  -130,-130,-130,-140,
+static int _psy_ath_abs_8[3]={
+  -130,-130,-140,
 };
 

Modified: branches/vorbis-aotuv/lib/modes/residue_16.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/residue_16.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/residue_16.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -84,8 +84,7 @@
    &_resbook_16s_2,&_resbook_16s_2}
 };
 
-static vorbis_mapping_template _mapres_template_16_stereo[4]={
-  { _map_nominal, _res_16s_0 }, /* -1 */
+static vorbis_mapping_template _mapres_template_16_stereo[3]={
   { _map_nominal, _res_16s_0 }, /* 0 */
   { _map_nominal, _res_16s_1 }, /* 1 */
   { _map_nominal, _res_16s_2 }, /* 2 */
@@ -157,8 +156,7 @@
 };
 
 
-static vorbis_mapping_template _mapres_template_16_uncoupled[4]={
-  { _map_nominal_u, _res_16u_0 }, /* -1 */
+static vorbis_mapping_template _mapres_template_16_uncoupled[3]={
   { _map_nominal_u, _res_16u_0 }, /* 0 */
   { _map_nominal_u, _res_16u_1 }, /* 1 */
   { _map_nominal_u, _res_16u_2 }, /* 2 */

Modified: branches/vorbis-aotuv/lib/modes/residue_44.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/residue_44.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/residue_44.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -278,7 +278,6 @@
 };
 
 static vorbis_mapping_template _mapres_template_44_stereo[]={
-  { _map_nominal, _res_44s_n1 }, /* -2 */
   { _map_nominal, _res_44s_n1 }, /* -1 */
   { _map_nominal, _res_44s_0 }, /* 0 */
   { _map_nominal, _res_44s_1 }, /* 1 */

Modified: branches/vorbis-aotuv/lib/modes/residue_44u.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/residue_44u.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/residue_44u.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -304,7 +304,6 @@
 };
 
 static vorbis_mapping_template _mapres_template_44_uncoupled[]={
-  { _map_nominal_u, _res_44u_n1 }, /* -2 */
   { _map_nominal_u, _res_44u_n1 }, /* -1 */
   { _map_nominal_u, _res_44u_0 }, /* 0 */
   { _map_nominal_u, _res_44u_1 }, /* 1 */

Modified: branches/vorbis-aotuv/lib/modes/residue_8.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/residue_8.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/residue_8.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -48,8 +48,7 @@
    &_resbook_8s_1,&_resbook_8s_1},
 };
 
-static vorbis_mapping_template _mapres_template_8_stereo[3]={
-  { _map_nominal, _res_8s_0 }, /* -1 */
+static vorbis_mapping_template _mapres_template_8_stereo[2]={
   { _map_nominal, _res_8s_0 }, /* 0 */
   { _map_nominal, _res_8s_1 }, /* 1 */
 };
@@ -92,8 +91,7 @@
    &_resbook_8u_1,&_resbook_8u_1},
 };
 
-static vorbis_mapping_template _mapres_template_8_uncoupled[3]={
-  { _map_nominal_u, _res_8u_0 }, /* -1 */
+static vorbis_mapping_template _mapres_template_8_uncoupled[2]={
   { _map_nominal_u, _res_8u_0 }, /* 0 */
   { _map_nominal_u, _res_8u_1 }, /* 1 */
 };

Modified: branches/vorbis-aotuv/lib/modes/setup_11.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_11.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_11.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -17,31 +17,28 @@
 
 #include "psych_11.h"
 
-static int blocksize_11[3]={
-  512,512,512
+static int blocksize_11[2]={
+  512,512
 };
 
-static int _floor_mapping_11[3]={
-  6,6,6
+static int _floor_mapping_11[2]={
+  6,6,
 };
 
-static double rate_mapping_11[4]={
-//  8000.,13000.,44000.,
-  8000.,10000.,13000.,44000.,
+static double rate_mapping_11[3]={
+  8000.,13000.,44000.,
 };
 
-static double rate_mapping_11_uncoupled[4]={
-//  12000.,20000.,50000.,
-  14000.,16000.,20000.,50000.,
+static double rate_mapping_11_uncoupled[3]={
+  12000.,20000.,50000.,
 };
 
-static double quality_mapping_11[4]={
-  -.2,-.1,.0,1.
+static double quality_mapping_11[3]={
+  -.1,.0,1.
 };
 
 ve_setup_data_template ve_setup_11_stereo={
-//  2,
-  3,
+  2,
   rate_mapping_11,
   quality_mapping_11,
   2,
@@ -92,8 +89,7 @@
 };
 
 ve_setup_data_template ve_setup_11_uncoupled={
-//  2,
-  3,
+  2,
   rate_mapping_11_uncoupled,
   quality_mapping_11,
   -1,

Modified: branches/vorbis-aotuv/lib/modes/setup_16.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_16.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_16.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -18,40 +18,36 @@
 #include "psych_16.h"
 #include "residue_16.h"
 
-static int blocksize_16_short[4]={
-  1024,1024,512,512
+static int blocksize_16_short[3]={
+  1024,512,512
 };
-static int blocksize_16_long[4]={
-  1024,1024,1024,1024
+static int blocksize_16_long[3]={
+  1024,1024,1024
 };
 
-static int _floor_mapping_16_short[4]={
-  9,9,3,3
+static int _floor_mapping_16_short[3]={
+  9,3,3
 };
-static int _floor_mapping_16[4]={
-  9,9,9,9
+static int _floor_mapping_16[3]={
+  9,9,9
 };
 
-static double rate_mapping_16[5]={
-//  12000.,20000.,44000.,86000.
-  10000.,12000.,20000.,44000.,86000.
+static double rate_mapping_16[4]={
+  12000.,20000.,44000.,86000.
 };
 
-static double rate_mapping_16_uncoupled[5]={
-//  16000.,28000.,64000.,100000.
-  16000.,18000.,28000.,64000.,100000.
+static double rate_mapping_16_uncoupled[4]={
+  16000.,28000.,64000.,100000.
 };
 
-static double _global_mapping_16[5]={ 2., 2., 3., 4., 5. };
+static double _global_mapping_16[4]={ 1., 2., 3., 4. };
 
-static double quality_mapping_16[5]={ -.2,-.1,.05,.5,1. };
+static double quality_mapping_16[4]={ -.1,.05,.5,1. };
 
-//static double _psy_compand_16_mapping[5]={ 0., 0., .8, 1., 1.};
-static double _psy_compand_16_mapping[5]={ 0., 1., 1.8, 2., 2.};
+static double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.};
 
 ve_setup_data_template ve_setup_16_stereo={
-//  3,
-  4,
+  3,
   rate_mapping_16,
   quality_mapping_16,
   2,
@@ -102,8 +98,7 @@
 };
 
 ve_setup_data_template ve_setup_16_uncoupled={
-//  3,
-  4,
+  3,
   rate_mapping_16_uncoupled,
   quality_mapping_16,
   -1,

Modified: branches/vorbis-aotuv/lib/modes/setup_22.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_22.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_22.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -15,21 +15,18 @@
 
  ********************************************************************/
 
-static double rate_mapping_22[5]={
-//  15000.,20000.,44000.,86000.
-  14000.,16000.,20000.,44000.,86000.
+static double rate_mapping_22[4]={
+  15000.,20000.,44000.,86000.
 };
 
-static double rate_mapping_22_uncoupled[5]={
-//  16000.,28000.,50000.,90000.
-  22000.,24000.,28000.,50000.,90000.
+static double rate_mapping_22_uncoupled[4]={
+  16000.,28000.,50000.,90000.
 };
 
-static double _psy_lowpass_22[5]={8.5,9.5,11.,30.,99.};
+static double _psy_lowpass_22[4]={9.5,11.,30.,99.};
 
 ve_setup_data_template ve_setup_22_stereo={
-//  3,
-  4,
+  3,
   rate_mapping_22,
   quality_mapping_16,
   2,
@@ -80,8 +77,7 @@
 };
 
 ve_setup_data_template ve_setup_22_uncoupled={
-//  3,
-  4,
+  3,
   rate_mapping_22_uncoupled,
   quality_mapping_16,
   -1,

Modified: branches/vorbis-aotuv/lib/modes/setup_32.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_32.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_32.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -15,26 +15,22 @@
 
  ********************************************************************/
 
-static double rate_mapping_32[13]={
-//  18000.,28000.,35000.,45000.,56000.,60000.,
-  14000.,20000.,28000.,35000.,45000.,56000.,60000.,
+static double rate_mapping_32[12]={
+  18000.,28000.,35000.,45000.,56000.,60000.,
   75000.,90000.,100000.,115000.,150000.,190000.,
 };
 
-static double rate_mapping_32_un[13]={
-//  30000.,42000.,52000.,64000.,72000.,78000.,
-  24000.,32000.,42000.,52000.,64000.,72000.,78000.,
+static double rate_mapping_32_un[12]={
+  30000.,42000.,52000.,64000.,72000.,78000.,
   86000.,92000.,110000.,120000.,140000.,190000.,
 };
 
-static double _psy_lowpass_32[13]={
-//  12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.
-  11.9,12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.
+static double _psy_lowpass_32[12]={
+  12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.
 };
 
 ve_setup_data_template ve_setup_32_stereo={
-//  11,
-  12,
+  11,
   rate_mapping_32,
   quality_mapping_44,
   2,
@@ -63,7 +59,7 @@
   _psy_compand_short_mapping,
   _psy_compand_long_mapping,
 
-  {_noise_start_short_32,_noise_start_long_32},
+  {_noise_start_short_44,_noise_start_long_44},
   {_noise_part_short_44,_noise_part_long_44},
   _noise_thresh_44,
 
@@ -85,8 +81,7 @@
 };
 
 ve_setup_data_template ve_setup_32_uncoupled={
-//  11,
-  12,
+  11,
   rate_mapping_32_un,
   quality_mapping_44,
   -1,
@@ -115,7 +110,7 @@
   _psy_compand_short_mapping,
   _psy_compand_long_mapping,
 
-  {_noise_start_short_32,_noise_start_long_32},
+  {_noise_start_short_44,_noise_start_long_44},
   {_noise_part_short_44,_noise_part_long_44},
   _noise_thresh_44,
 

Modified: branches/vorbis-aotuv/lib/modes/setup_44.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_44.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_44.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -19,47 +19,43 @@
 #include "modes/residue_44.h"
 #include "modes/psych_44.h"
 
-static double rate_mapping_44_stereo[13]={
-//  22500.,32000.,40000.,48000.,56000.,64000.,
-  16000.,24000.,32000.,40000.,48000.,56000.,64000.,
+static double rate_mapping_44_stereo[12]={
+  22500.,32000.,40000.,48000.,56000.,64000.,
   80000.,96000.,112000.,128000.,160000.,250001.
 };
 
-static double quality_mapping_44[13]={
-  -.2,-.1,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0
+static double quality_mapping_44[12]={
+  -.1,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0
 };
 
-static int blocksize_short_44[12]={
-  512,512,256,256,256,256,256,256,256,256,256,256
+static int blocksize_short_44[11]={
+  512,256,256,256,256,256,256,256,256,256,256
 };
-static int blocksize_long_44[12]={
-  4096,4096,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048
+static int blocksize_long_44[11]={
+  4096,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048
 };
 
-static double _psy_compand_short_mapping[13]={
-  0., 1., 1., 1., 1.3, 1.6, 2., 2., 2., 2., 2., 2., 2.
+static double _psy_compand_short_mapping[12]={
+  0.5, 1., 1., 1.3, 1.6, 2., 2., 2., 2., 2., 2., 2.
 };
-static double _psy_compand_long_mapping[13]={
-  3., 4., 4., 4., 4.3, 4.6, 5., 5., 5., 5., 5., 5., 5.
+static double _psy_compand_long_mapping[12]={
+  3.5, 4., 4., 4.3, 4.6, 5., 5., 5., 5., 5., 5., 5.
 };
 
-static double _global_mapping_44[13]={
+static double _global_mapping_44[12]={
   /* 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.5, 4., 4. */
-// 0., 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.7, 4., 4.
-  0., 1., 2., 2., 2.5, 3., 3., 3.7, 3.9, 4.0, 4.0, 5., 5. // low
-//  0., 1., 2., 2., 2.5, 3., 3.2, 4.0, 4.0, 4.0, 4.5, 5., 5. // high
+ 0., 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.7, 4., 4.
 };
 
-static int _floor_short_mapping_44[12]={
-  1,1,0,0,2,2,4,5,5,5,5,5
+static int _floor_short_mapping_44[11]={
+  1,0,0,2,2,4,5,5,5,5,5
 };
-static int _floor_long_mapping_44[12]={
-  8,8,7,7,7,7,7,7,7,7,7,7
+static int _floor_long_mapping_44[11]={
+  8,7,7,7,7,7,7,7,7,7,7
 };
 
 ve_setup_data_template ve_setup_44_stereo={
-//  11,
-  12,
+  11,
   rate_mapping_44_stereo,
   quality_mapping_44,
   2,

Modified: branches/vorbis-aotuv/lib/modes/setup_44u.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_44u.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_44u.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -17,15 +17,13 @@
 
 #include "modes/residue_44u.h"
 
-static double rate_mapping_44_un[13]={
-//  32000.,48000.,60000.,70000.,80000.,86000.,
-  26000.,32000.,48000.,60000.,70000.,80000.,86000.,
+static double rate_mapping_44_un[12]={
+  32000.,48000.,60000.,70000.,80000.,86000.,
   96000.,110000.,120000.,140000.,160000.,240001.
 };
 
 ve_setup_data_template ve_setup_44_uncoupled={
-//  11,
-  12,
+  11,
   rate_mapping_44_un,
   quality_mapping_44,
   -1,

Modified: branches/vorbis-aotuv/lib/modes/setup_8.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_8.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_8.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -18,37 +18,32 @@
 #include "psych_8.h"
 #include "residue_8.h"
 
-static int blocksize_8[3]={
-  512,512,512
+static int blocksize_8[2]={
+  512,512
 };
 
-static int _floor_mapping_8[3]={
-  6,6,6
+static int _floor_mapping_8[2]={
+  6,6,
 };
 
-static double rate_mapping_8[4]={
-//  6000.,9000.,32000.,
-  5000.,6000.,9000.,32000.,
+static double rate_mapping_8[3]={
+  6000.,9000.,32000.,
 };
 
-static double rate_mapping_8_uncoupled[4]={
-//  8000.,14000.,42000.,
-  8000.,10000.,14000.,42000.,
+static double rate_mapping_8_uncoupled[3]={
+  8000.,14000.,42000.,
 };
 
-static double quality_mapping_8[4]={
-  -.2,-.1,.0,1.
+static double quality_mapping_8[3]={
+  -.1,.0,1.
 };
 
-//static double _psy_compand_8_mapping[3]={ 0., 1., 1.};
-static double _psy_compand_8_mapping[4]={ 0., 1., 2., 2.};
+static double _psy_compand_8_mapping[3]={ 0., 1., 1.};
 
-//static double _global_mapping_8[3]={ 1., 2., 3. };
-static double _global_mapping_8[4]={ 2., 2., 3., 4. };
+static double _global_mapping_8[3]={ 1., 2., 3. };
 
 ve_setup_data_template ve_setup_8_stereo={
-//  2,
-  3,
+  2,
   rate_mapping_8,
   quality_mapping_8,
   2,
@@ -99,8 +94,7 @@
 };
 
 ve_setup_data_template ve_setup_8_uncoupled={
-//  2,
-  3,
+  2,
   rate_mapping_8_uncoupled,
   quality_mapping_8,
   -1,

Modified: branches/vorbis-aotuv/lib/modes/setup_X.h
===================================================================
--- branches/vorbis-aotuv/lib/modes/setup_X.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/modes/setup_X.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -15,14 +15,13 @@
 
  ********************************************************************/
 
-static double rate_mapping_X[13]={
-  -1.,-1.,-1.,-1.,-1.,-1.,-1.
+static double rate_mapping_X[12]={
+  -1.,-1.,-1.,-1.,-1.,-1.,
   -1.,-1.,-1.,-1.,-1.,-1.
 };
 
 ve_setup_data_template ve_setup_X_stereo={
-//  11,
-  12,
+  11,
   rate_mapping_X,
   quality_mapping_44,
   2,
@@ -73,8 +72,7 @@
 };
 
 ve_setup_data_template ve_setup_X_uncoupled={
-//  11,
-  12,
+  11,
   rate_mapping_X,
   quality_mapping_44,
   -1,
@@ -125,8 +123,7 @@
 };
 
 ve_setup_data_template ve_setup_XX_stereo={
-//  2,
-  3,
+  2,
   rate_mapping_X,
   quality_mapping_8,
   2,
@@ -177,8 +174,7 @@
 };
 
 ve_setup_data_template ve_setup_XX_uncoupled={
-//  2,
-  3,
+  2,
   rate_mapping_X,
   quality_mapping_8,
   -1,

Modified: branches/vorbis-aotuv/lib/psy.c
===================================================================
--- branches/vorbis-aotuv/lib/psy.c	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/psy.c	2006-11-05 15:05:50 UTC (rev 12028)
@@ -31,22 +31,7 @@
 
 #define NEGINF -9999.f
 static double stereo_threshholds[]={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10};
-static double stereo_threshholds_long[]={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10};
-static double stereo_threshholds_trans_post[]={0.0, 0.0, 0.1, 0.1, 0.2, 0.2, 0.3, 0.5, 9e10};
-static double stereo_threshholds_trans_pre[]={0.0, .5, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 9e10};
-static int m3n32[] = {21,13,10,4};
-static int m3n44[] = {15,9,7,3};
-static int m3n48[] = {14,8,6,3};
-static int temp_bfn[128] = {
- 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
- 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
- 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,11,11,11,11,
-12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,
-16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,
-20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,
-24,24,24,24,25,25,25,24,23,22,21,20,19,18,17,16,
-15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
-};
+static double stereo_threshholds_limited[]={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10};
 
 vorbis_look_psy_global *_vp_global_look(vorbis_info *vi){
   codec_setup_info *ci=vi->codec_setup;
@@ -299,19 +284,12 @@
   p->n=n;
   p->rate=rate;
 
-  /* AoTuV HF weighting etc. */
+  /* AoTuV HF weighting */
+  p->m_val = 1.;
   if(rate < 26000) p->m_val = 0;
-  else if(rate < 38000){   /* 32kHz */
-  	p->m_val = .94;
-  	for(i=0; i<4; i++) p->m3n[i] = m3n32[i];
-  }else if(rate > 46000){  /* 48kHz */
-  	p->m_val = 1.275;
-  	for(i=0; i<4; i++) p->m3n[i] = m3n48[i];
-  }else{                   /* 44.1kHz */
-  	p->m_val = 1.;
-  	for(i=0; i<4; i++) p->m3n[i] = m3n44[i];
-  }
-
+  else if(rate < 38000) p->m_val = .94;   /* 32kHz */
+  else if(rate > 46000) p->m_val = 1.275; /* 48kHz */
+  
   /* set up the lookups for a given blocksize and sample rate */
 
   for(i=0,j=0;i<MAX_ATH-1;i++){
@@ -876,119 +854,19 @@
 			int offset_select,
 			float *logmask,
 			float *mdct,
-			float *logmdct,
-			float *lastmdct, float *tempmdct,
-			int blocktype, int modenumber,
-			int nW_modenumber,
-			int lW_blocktype, int lW_modenumber, int lW_no){
-
-  int i,j,n=p->n;
-  int it_sw, *m3n, nquarter=n/4; /* aoTuV for M3&M4 */
-  double ace=0; /* aoTuV for M4 */
-  float de, coeffi, cx; /* aoTuV for M1 */
-  float noise_rate, noise_rate_low, noise_center, rate_mod; /* aoTuV for M3 */
+			float *logmdct){
+  int i,n=p->n;
+  float de, coeffi, cx;/* AoTuV */
   float toneatt=p->vi->tone_masteratt[offset_select];
 
   cx = p->m_val;
-  m3n = p->m3n;
   
-  /** @ M3 PRE **/
-  if((n == 128) && !modenumber && !blocktype){
-  	if(!lW_blocktype && !lW_modenumber){ /* last window "short" - type "impulse" */
-  		if(lW_no < 8){
-  			/* impulse - @impulse case1 */
-  			noise_rate = 0.8-(float)(lW_no-1)/17;
-  			noise_center = (float)(lW_no*3);
-  		}else{
-  			/* impulse - @impulse case2 */
-  			noise_rate = 0.4;
-  			noise_center = 25;
-  		}
-  		if(offset_select == 1){
-  			for(i=0; i<128; i++) tempmdct[i] -= 5;
-  		}
-  	}else{ /* non_impulse - @Short(impulse) case */
-  		noise_rate = 0.95;
-  		noise_center = 0;
-  		if(offset_select == 1){
-  			for(i=0; i<128; i++) tempmdct[i] = lastmdct[i] - 5;
-  		}
-  	}
-  	noise_rate_low = noise_rate*0.6;
-  	it_sw = 1;
-  }else{
-  	it_sw = 0;
-  }
-  
-  /** @ M3&M4 PRE **/
-  if(cx < 0.5){
-  	it_sw = 0;     /* for M3 */
-  	nquarter = 0;  /* for M4 */
-  }else{
-    /*  calculation of the correction value of noise masking (longblock).
-        the magic number should change with psych_44.h's "_psy_compand_44" values
-        and setup_44.h's "_psy_compand_long_mapping" value.     for M4  */
-  	if(modenumber && blocktype && (p->vi->noisecompand[12] > 7.8)){
-  		for(i=nquarter; i<n; i++) ace += logmdct[i];
-  		ace = (float)(n/ace*1000+13);
-  		if(ace < 0) ace = 0;
-  		else ace *= ace*((p->vi->noisecompand[12]-7.8)/4.2); /* range of q-1~q2.99... */
-  	}else nquarter = 0;
-  }
-  
   for(i=0;i<n;i++){
     float val= noise[i]+p->noiseoffset[offset_select][i];
-    float tval= tone[i]+toneatt;
     if(val>p->vi->noisemaxsupp)val=p->vi->noisemaxsupp;
-    
-    /* AoTuV */
-    /** @ M4 MAIN **
-    When the energy of a high frequency is small, the noise level of a low frequency is lowered. 
-    This is the measure against complaints of a solo musical instrument. 
-    by Aoyumi @ 2004/09/18
-    */
-    if(i < nquarter){
-		if(logmdct[i] > -120) val -= (float)ace;
-	}
-	
-    /* AoTuV */
-    /** @ M3 MAIN **
-    Dynamic impulse block noise control. (#3)
-    48/44.1/32kHz only.
-    by Aoyumi @ 2004/08/30
-    */
-    if(it_sw){
-    	for(j=1; j<=temp_bfn[i]; j++){
-    		float tempbuf = logmdct[i]-(75/temp_bfn[i]*j)-5;
-			if( (tempmdct[i+j] < tempbuf) && (tempmdct[i+j] < (logmdct[i+j]-5)) )
-			 tempmdct[i+j] = logmdct[i+j] - 5;
-		}
-		
-    	if(val > tval){
-    		if( logmdct[i] > (tempmdct[i]+noise_center) ){
-    			tempmdct[i] = logmdct[i];
-    			if(logmdct[i] < lastmdct[i]) rate_mod = noise_rate;
-    			else rate_mod = noise_rate_low;
-				
-				if(i > m3n[1]){
-						if((val-tval) > 30) val = val - ((val-tval-30)/10+30)*rate_mod;
-						else val = val - (val-tval)*rate_mod;
-				}else if(i > m3n[2]){
-						if((val-tval) > 20) val = val - ((val-tval-20)/10+20)*rate_mod;
-						else val = val - (val-tval)*rate_mod;
-				}else if(i > m3n[3]){
-						if((val-tval) > 10) val = val - ((val-tval-10)/10+10)*rate_mod*0.5;
-						else val = val - (val-tval)*rate_mod*0.5;
-				}else{
-					if((val-tval) > 10) val = val - ((val-tval-10)/10+10)*rate_mod*0.3;
-					else val = val - (val-tval)*rate_mod*0.3;
-				}
-			}
-   		}
-   	}
-   	
-    logmask[i]=max(val,tval);
+    logmask[i]=max(val,tone[i]+toneatt);
 
+
     /* AoTuV */
     /** @ M1 **
 	The following codes improve a noise problem.  
@@ -1026,24 +904,6 @@
       
     }
   }
-  
-  /** @ M3 SET lastmdct **/
-  if(offset_select == 1){
-	if(n == 1024){
-		if(!nW_modenumber){
-			for(i=0; i<128; i++){
-				lastmdct[i] = logmdct[i*8];
-				for(j=1; j<8; j++){
-					if(lastmdct[i] > logmdct[i*8+j]){
-						lastmdct[i] = logmdct[i*8+j];
-					}
-				}
-			}
-		}
-	}else if(n == 128){
-		for(i=0; i<128; i++) lastmdct[i] = logmdct[i];
-	}
-  }
 }
 
 float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd){
@@ -1161,131 +1021,13 @@
   return (f1<f2)-(f1>f2);
 }
 
-/*** optimization of sort (for 8 or 32 element) ***/
-#ifdef OPT_SORT
-#define C(o,a,b)\
-  (fabs(data[o+a])>=fabs(data[o+b]))
-#define O(o,a,b,c,d)\
-  {n[o]=o+a;n[o+1]=o+b;n[o+2]=o+c;n[o+3]=o+d;}
-#define SORT4(o)\
-  if(C(o,2,3))if(C(o,0,1))if(C(o,0,2))if(C(o,1,2))O(o,0,1,2,3)\
-        else if(C(o,1,3))O(o,0,2,1,3)\
-          else O(o,0,2,3,1)\
-      else if(C(o,0,3))if(C(o,1,3))O(o,2,0,1,3)\
-          else O(o,2,0,3,1)\
-        else O(o,2,3,0,1)\
-    else if(C(o,1,2))if(C(o,0,2))O(o,1,0,2,3)\
-        else if(C(o,0,3))O(o,1,2,0,3)\
-          else O(o,1,2,3,0)\
-      else if(C(o,1,3))if(C(o,0,3))O(o,2,1,0,3)\
-          else O(o,2,1,3,0)\
-        else O(o,2,3,1,0)\
-  else if(C(o,0,1))if(C(o,0,3))if(C(o,1,3))O(o,0,1,3,2)\
-        else if(C(o,1,2))O(o,0,3,1,2)\
-          else O(o,0,3,2,1)\
-      else if(C(o,0,2))if(C(o,1,2))O(o,3,0,1,2)\
-          else O(o,3,0,2,1)\
-        else O(o,3,2,0,1)\
-    else if(C(o,1,3))if(C(o,0,3))O(o,1,0,3,2)\
-        else if(C(o,0,2))O(o,1,3,0,2)\
-          else O(o,1,3,2,0)\
-      else if(C(o,1,2))if(C(o,0,2))O(o,3,1,0,2)\
-          else O(o,3,1,2,0)\
-        else O(o,3,2,1,0)
-
-static void sortindex_fix8(int *index,
-                           float *data,
-                           int offset){
-  int i,j,k,n[8];
-  index+=offset;
-  data+=offset;
-  SORT4(0)
-  SORT4(4)
-  j=0;k=4;
-  for(i=0;i<8;i++)
-    index[i]=n[(k>=8)||(j<4)&&C(0,n[j],n[k])?j++:k++]+offset;
-}
-
-static void sortindex_fix32(int *index,
-                            float *data,
-                            int offset){
-  int i,j,k,n[32];
-  for(i=0;i<32;i+=8)
-    sortindex_fix8(index,data,offset+i);
-  index+=offset;
-  for(i=j=0,k=8;i<16;i++)
-    n[i]=index[(k>=16)||(j<8)&&C(0,index[j],index[k])?j++:k++];
-  for(i=j=16,k=24;i<32;i++)
-    n[i]=index[(k>=32)||(j<24)&&C(0,index[j],index[k])?j++:k++];
-  for(i=j=0,k=16;i<32;i++)
-    index[i]=n[(k>=32)||(j<16)&&C(0,n[j],n[k])?j++:k++];
-}
-
-static void sortindex_shellsort(int *index,
-                                float *data,
-                                int offset,
-                                int count){
-  int gap,pos,left,right,i,j;
-  index+=offset;
-  for(i=0;i<count;i++)index[i]=i+offset;
-  gap=1;
-  while (gap<=count)gap=gap*3+1;
-  gap/=3;
-  if(gap>=4)gap/=3;
-  while(gap>0){
-    for(pos=gap;pos<count;pos++){
-      for(left=pos-gap;left>=0;left-=gap){
-        i=index[left];j=index[left+gap];
-        if(!C(0,i,j)){
-          index[left]=j;
-          index[left+gap]=i;
-        }else break;
-      }
-    }
-    gap/=3;
-  }
-}
-
-static void sortindex(int *index,
-                      float *data,
-                      int offset,
-                      int count){
-  if(count==8)sortindex_fix8(index,data,offset);
-  else if(count==32)sortindex_fix32(index,data,offset);
-  else sortindex_shellsort(index,data,offset,count);
-}
-
-#undef C
-#undef O
-#undef SORT4
-
-#endif
-/*** OPT_SORT End ***/
-
-
 int **_vp_quantize_couple_sort(vorbis_block *vb,
 			       vorbis_look_psy *p,
 			       vorbis_info_mapping0 *vi,
 			       float **mags){
 
-#ifdef OPT_SORT
+
   if(p->vi->normal_point_p){
-    int i,j,n=p->n;
-    int **ret=_vorbis_block_alloc(vb,vi->coupling_steps*sizeof(*ret));
-    int partition=p->vi->normal_partition;
-    
-    for(i=0;i<vi->coupling_steps;i++){
-      ret[i]=_vorbis_block_alloc(vb,n*sizeof(**ret));
-      
-      for(j=0;j<n;j+=partition){
-      sortindex(ret[i],mags[i],j,partition);
-      }
-    }
-    return(ret);
-  }
-  return(NULL);
-#else
-  if(p->vi->normal_point_p){
     int i,j,k,n=p->n;
     int **ret=_vorbis_block_alloc(vb,vi->coupling_steps*sizeof(*ret));
     int partition=p->vi->normal_partition;
@@ -1303,22 +1045,10 @@
     return(ret);
   }
   return(NULL);
-#endif
 }
 
 void _vp_noise_normalize_sort(vorbis_look_psy *p,
 			      float *magnitudes,int *sortedindex){
-#ifdef OPT_SORT
-  int j,n=p->n;
-  vorbis_info_psy *vi=p->vi;
-  int partition=vi->normal_partition;
-  int start=vi->normal_start;
-
-  for(j=start;j<n;j+=partition){
-    if(j+partition>n)partition=n-j;
-    sortindex(sortedindex-start,magnitudes,j,partition);
-  }
-#else
   int i,j,n=p->n;
   vorbis_info_psy *vi=p->vi;
   int partition=vi->normal_partition;
@@ -1333,7 +1063,6 @@
       sortedindex[i+j-start]=work[i]-magnitudes;
     }
   }
-#endif
 }
 
 void _vp_noise_normalize(vorbis_look_psy *p,
@@ -1391,9 +1120,7 @@
 		int   **mag_sort,
 		int   **ifloor,
 		int   *nonzero,
-		int  sliding_lowpass,
-		int blocktype, int modenumber,
-		int lW_blocktype, int lW_modenumber){
+		int  sliding_lowpass){
 
   int i,j,k,n=p->n;
 
@@ -1430,21 +1157,10 @@
       nonzero[vi->coupling_mag[i]]=1; 
       nonzero[vi->coupling_ang[i]]=1; 
 
-       if(p->m_val > 0.5){
-       	/* The threshold of a stereo is changed in specific conditions. */
-       	if(modenumber){
-       		postpoint=stereo_threshholds_long[g->coupling_postpointamp[blobno]]; 
-       		/* impuse/transition - [transition]
-       			this is needed in order to solve the problem on which some are conspicuous. */
-       		if(!blocktype && modenumber){
-       			if((!lW_blocktype && !lW_modenumber) || (!lW_blocktype && lW_modenumber)){
-        			postpoint=stereo_threshholds_trans_post[g->coupling_postpointamp[blobno]]; 
-        			prepoint=stereo_threshholds_trans_pre[g->coupling_prepointamp[blobno]]; 
-        		}
-        	}
-       	}
-       }
-       
+       /* The threshold of a stereo is changed with the size of n */
+       if(n > 1000)
+         postpoint=stereo_threshholds_limited[g->coupling_postpointamp[blobno]]; 
+ 
       for(j=0;j<p->n;j+=partition){
 	float acc=0.f;
 
@@ -1460,8 +1176,7 @@
 				       floorM[l],floorA[l],
 				       qM+l,qA+l);
 
-	      //if(rint(qM[l])==0.f)acc+=qM[l]*qM[l]; /* ? */
-	      if( (rint(qM[l])==0.f) && (l>=limit) )acc+=qM[l]*qM[l];
+	      if(rint(qM[l])==0.f)acc+=qM[l]*qM[l];
 	    }else{
 	      couple_lossless(rM[l],rA[l],qM+l,qA+l);
 	    }
@@ -1488,27 +1203,22 @@
 /* AoTuV */
 /** @ M2 **
    The boost problem by the combination of noise normalization and point stereo is eased. 
-   However, this is a temporary patch. (#2 fixed)
-   by Aoyumi @ 2004/10/24
+   However, this is a temporary patch. 
+   by Aoyumi @ 2004/04/18
 */
 
 void hf_reduction(vorbis_info_psy_global *g,
                       vorbis_look_psy *p, 
                       vorbis_info_mapping0 *vi,
                       float **mdct){
-  int i,j,n=p->n,start;
-  int p_limit=g->coupling_pointlimit[p->vi->blockflag][PACKETBLOBS/2];
-  int n_start=p->vi->normal_start;
-  float de=0.1;
+ 
+  int i,j,n=p->n, de=0.3*p->m_val;
+  int limit=g->coupling_pointlimit[p->vi->blockflag][PACKETBLOBS/2];
+  int start=p->vi->normal_start;
   
-  if(p->m_val < 0.5) return;
-  if(p->m_val < 0.999) de *= p->m_val; /* 32kHz */
-  
-  if(p_limit > n_start) start = p_limit;
-  else start = n_start;
-  
   for(i=0; i<vi->coupling_steps; i++){
-    for(j=start; j<n; j++) 
-      mdct[i][j] *= (1.0 - de*((float)(j-start) / (float)(n-start)));
+    /* for(j=start; j<limit; j++){} // ???*/
+    for(j=limit; j<n; j++) 
+      mdct[i][j] *= (1.0 - de*((float)(j-limit) / (float)(n-limit)));
   }
 }

Modified: branches/vorbis-aotuv/lib/psy.h
===================================================================
--- branches/vorbis-aotuv/lib/psy.h	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/psy.h	2006-11-05 15:05:50 UTC (rev 12028)
@@ -15,8 +15,6 @@
 
  ********************************************************************/
 
-#define OPT_SORT
-
 #ifndef _V_PSY_H_
 #define _V_PSY_H_
 #include "smallft.h"
@@ -112,7 +110,6 @@
   int   total_octave_lines;  
   long  rate; /* cache it */
 
-  int m3n[4]; /* number for M3 */
   float m_val; /* Masking compensation value */
 
 } vorbis_look_psy;
@@ -147,11 +144,7 @@
 			       int offset_select,
 			       float *logmask,
 			       float *mdct,
-			       float *logmdct,
-			       float *lastmdct, float *tempmdct,
-			       int blocktype, int modenumber,
-			       int nW_modenumber,
-			       int lW_blocktype, int lW_modenumber, int lW_no);
+			       float *logmdct);
 
 extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
 
@@ -170,9 +163,7 @@
 		       int   **mag_sort,
 		       int   **ifloor,
 		       int   *nonzero,
-		       int   sliding_lowpass,
-		       int blocktype, int modenumber,
-		       int lW_blocktype, int lW_modenumber);
+		       int   sliding_lowpass);
 
 extern void _vp_noise_normalize(vorbis_look_psy *p,
 				float *in,float *out,int *sortedindex);

Modified: branches/vorbis-aotuv/lib/vorbisenc.c
===================================================================
--- branches/vorbis-aotuv/lib/vorbisenc.c	2006-11-05 15:03:25 UTC (rev 12027)
+++ branches/vorbis-aotuv/lib/vorbisenc.c	2006-11-05 15:05:50 UTC (rev 12028)
@@ -1091,9 +1091,9 @@
 	if(ai==NULL)return OV_EINVAL;
 	
 	ai->management_active=hi->managed;
-	ai->bitrate_limit_min_kbps=hi->bitrate_min;
-	ai->bitrate_limit_max_kbps=hi->bitrate_max;
-	ai->bitrate_average_kbps=hi->bitrate_av;
+	ai->bitrate_limit_min_kbps=hi->bitrate_min/1000;
+	ai->bitrate_limit_max_kbps=hi->bitrate_max/1000;
+	ai->bitrate_average_kbps=hi->bitrate_av/1000;
 	ai->bitrate_average_damping=hi->bitrate_av_damp;
 	ai->bitrate_limit_reservoir_bits=hi->bitrate_reservoir;
 	ai->bitrate_limit_reservoir_bias=hi->bitrate_reservoir_bias;
@@ -1135,9 +1135,9 @@
 	    return OV_EINVAL;
 
 	  hi->managed=ai->management_active;
-	  hi->bitrate_min=ai->bitrate_limit_min_kbps;
-	  hi->bitrate_max=ai->bitrate_limit_max_kbps;
-	  hi->bitrate_av=ai->bitrate_average_kbps;
+	  hi->bitrate_min=ai->bitrate_limit_min_kbps * 1000;
+	  hi->bitrate_max=ai->bitrate_limit_max_kbps * 1000;
+	  hi->bitrate_av=ai->bitrate_average_kbps * 1000;
 	  hi->bitrate_av_damp=ai->bitrate_average_damping;
 	  hi->bitrate_reservoir=ai->bitrate_limit_reservoir_bits;
 	  hi->bitrate_reservoir_bias=ai->bitrate_limit_reservoir_bias;



More information about the commits mailing list